mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-14 06:22:22 +02:00
Added slime card
- Added slime card - Removed test debug
This commit is contained in:
@@ -4,23 +4,16 @@ var _dialogues = []
|
|||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
_dialogues.append([
|
_dialogues.append([
|
||||||
"Hero;I... I... I need to go pee",
|
"Hero: I... I... I need to go pee",
|
||||||
"Boss;After this you won't need to pee ever again!",
|
"Boss: After this you won't need to pee ever again!"
|
||||||
"More text...............",
|
|
||||||
"Even more text................",
|
|
||||||
".................................",
|
|
||||||
".........................",
|
|
||||||
"...................",
|
|
||||||
"...",
|
|
||||||
"We're done here."
|
|
||||||
])
|
])
|
||||||
_dialogues.append([
|
_dialogues.append([
|
||||||
"Hero;I've come to slay you, you beast!",
|
"Hero: I've come to slay you, you beast!",
|
||||||
"Boss;Well then... step forward!"
|
"Boss: Well then... step forward!"
|
||||||
])
|
])
|
||||||
_dialogues.append([
|
_dialogues.append([
|
||||||
"Hero;You've killed so many, but you won't kill me!",
|
"Hero: You've killed so many, but you won't kill me!",
|
||||||
"Boss;We'll see about that!"
|
"Boss: We'll see about that!"
|
||||||
])
|
])
|
||||||
|
|
||||||
func get_dialogue(id):
|
func get_dialogue(id):
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
var usedCards = [cards.BARREL,cards.BEAR,cards.EMPTY,cards.EMPTY,cards.EMPTY]
|
var usedCards = [cards.BARREL,cards.BEAR,cards.EMPTY,cards.EMPTY,cards.EMPTY]
|
||||||
var cardPositions = [Vector2(10,223), Vector2(60,223), Vector2(110,223), Vector2(160,223), Vector2(210, 223)]
|
var cardPositions = [Vector2(10,223), Vector2(65,223), Vector2(120,223), Vector2(175,223), Vector2(230, 223)]
|
||||||
|
|
||||||
enum cards {
|
enum cards {
|
||||||
BANANA,
|
BANANA,
|
||||||
@@ -11,6 +11,7 @@ enum cards {
|
|||||||
BEAR,
|
BEAR,
|
||||||
FLAME,
|
FLAME,
|
||||||
SPIKE,
|
SPIKE,
|
||||||
|
SLIME,
|
||||||
EMPTY
|
EMPTY
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ func update_cards():
|
|||||||
index += 1
|
index += 1
|
||||||
var newchild = []
|
var newchild = []
|
||||||
for card in range(index):
|
for card in range(index):
|
||||||
|
|
||||||
match usedCards[card]:
|
match usedCards[card]:
|
||||||
cards.BANANA:
|
cards.BANANA:
|
||||||
newchild.append(load("res://Objects/Banana/BananaCard.tscn").instance())
|
newchild.append(load("res://Objects/Banana/BananaCard.tscn").instance())
|
||||||
@@ -41,8 +41,8 @@ func update_cards():
|
|||||||
newchild.append(load("res://Objects/Traps/Flame/FlameCard.tscn").instance())
|
newchild.append(load("res://Objects/Traps/Flame/FlameCard.tscn").instance())
|
||||||
cards.SPIKE:
|
cards.SPIKE:
|
||||||
newchild.append(load("res://Objects/Traps/Spike/SpikeCard.tscn").instance())
|
newchild.append(load("res://Objects/Traps/Spike/SpikeCard.tscn").instance())
|
||||||
#cards.SLIME:
|
cards.SLIME:
|
||||||
#newchild=(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
newchild.append(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
||||||
for i in range(index):
|
for i in range(index):
|
||||||
$CardsDisplay.add_child(newchild[i])
|
$CardsDisplay.add_child(newchild[i])
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ func _ready():
|
|||||||
func starting():
|
func starting():
|
||||||
shownCards = []
|
shownCards = []
|
||||||
if (showCards):
|
if (showCards):
|
||||||
|
$Button.hide()
|
||||||
randcards[0] = randi() % DrNDrPre.cards.EMPTY
|
randcards[0] = randi() % DrNDrPre.cards.EMPTY
|
||||||
while(DrNDr.usedCards[0]==randcards[0] or
|
while(DrNDr.usedCards[0]==randcards[0] or
|
||||||
DrNDr.usedCards[1]==randcards[0] or
|
DrNDr.usedCards[1]==randcards[0] or
|
||||||
@@ -39,7 +40,6 @@ func starting():
|
|||||||
DrNDr.usedCards[3]==randcards[2] or
|
DrNDr.usedCards[3]==randcards[2] or
|
||||||
DrNDr.usedCards[4]==randcards[2]):
|
DrNDr.usedCards[4]==randcards[2]):
|
||||||
randcards[2] = randi() % DrNDrPre.cards.EMPTY
|
randcards[2] = randi() % DrNDrPre.cards.EMPTY
|
||||||
|
|
||||||
|
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
match randcards[i]:
|
match randcards[i]:
|
||||||
@@ -57,8 +57,8 @@ func starting():
|
|||||||
shownCards.append(load("res://Objects/Traps/Flame/FlameCard.tscn").instance())
|
shownCards.append(load("res://Objects/Traps/Flame/FlameCard.tscn").instance())
|
||||||
DrNDrPre.cards.SPIKE:
|
DrNDrPre.cards.SPIKE:
|
||||||
shownCards.append(load("res://Objects/Traps/Spike/SpikeCard.tscn").instance())
|
shownCards.append(load("res://Objects/Traps/Spike/SpikeCard.tscn").instance())
|
||||||
#DrNDrPre.cards.SLIME:
|
DrNDrPre.cards.SLIME:
|
||||||
#shownCards.append(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
shownCards.append(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
$Cards.add_child(shownCards[i])
|
$Cards.add_child(shownCards[i])
|
||||||
shownCards[0].set_begin (cardPositions[0])
|
shownCards[0].set_begin (cardPositions[0])
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ animations = [ {
|
|||||||
"name": "lvl0",
|
"name": "lvl0",
|
||||||
"speed": 60.0
|
"speed": 60.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ ExtResource( 4 ) ],
|
|
||||||
"loop": false,
|
|
||||||
"name": "lvl1",
|
|
||||||
"speed": 60.0
|
|
||||||
}, {
|
|
||||||
"frames": [ ExtResource( 3 ) ],
|
"frames": [ ExtResource( 3 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "lvl2",
|
"name": "lvl2",
|
||||||
"speed": 60.0
|
"speed": 60.0
|
||||||
|
}, {
|
||||||
|
"frames": [ ExtResource( 4 ) ],
|
||||||
|
"loop": false,
|
||||||
|
"name": "lvl1",
|
||||||
|
"speed": 60.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[node name="BananaCard" type="TextureRect"]
|
[node name="BananaCard" type="TextureRect"]
|
||||||
|
|||||||
@@ -16,15 +16,15 @@ animations = [ {
|
|||||||
"name": "lvl0",
|
"name": "lvl0",
|
||||||
"speed": 60.0
|
"speed": 60.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ ExtResource( 3 ) ],
|
|
||||||
"loop": false,
|
|
||||||
"name": "lvl1",
|
|
||||||
"speed": 60.0
|
|
||||||
}, {
|
|
||||||
"frames": [ ExtResource( 2 ) ],
|
"frames": [ ExtResource( 2 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "lvl2",
|
"name": "lvl2",
|
||||||
"speed": 60.0
|
"speed": 60.0
|
||||||
|
}, {
|
||||||
|
"frames": [ ExtResource( 3 ) ],
|
||||||
|
"loop": false,
|
||||||
|
"name": "lvl1",
|
||||||
|
"speed": 60.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[node name="GenericCard3" type="TextureRect"]
|
[node name="GenericCard3" type="TextureRect"]
|
||||||
|
|||||||
52
src/Objects/Slime/SlimeCard.tscn
Normal file
52
src/Objects/Slime/SlimeCard.tscn
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
[gd_scene load_steps=10 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://Menus/DragNDrop/DragSource.gd" type="Script" id=1]
|
||||||
|
[ext_resource path="res://Objects/Card/level2.png" type="Texture" id=2]
|
||||||
|
[ext_resource path="res://Objects/Card/level1.png" type="Texture" id=3]
|
||||||
|
[ext_resource path="res://Objects/Card/level0.png" type="Texture" id=4]
|
||||||
|
[ext_resource path="res://Objects/Card/card.png" type="Texture" id=5]
|
||||||
|
[ext_resource path="res://Objects/Slime/Slime.tscn" type="PackedScene" id=6]
|
||||||
|
[ext_resource path="res://testSprites/slime.png" type="Texture" id=7]
|
||||||
|
[ext_resource path="res://Objects/Slime/slime_icon.png" type="Texture" id=8]
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id=1]
|
||||||
|
animations = [ {
|
||||||
|
"frames": [ ExtResource( 4 ) ],
|
||||||
|
"loop": false,
|
||||||
|
"name": "lvl0",
|
||||||
|
"speed": 60.0
|
||||||
|
}, {
|
||||||
|
"frames": [ ExtResource( 2 ) ],
|
||||||
|
"loop": false,
|
||||||
|
"name": "lvl2",
|
||||||
|
"speed": 60.0
|
||||||
|
}, {
|
||||||
|
"frames": [ ExtResource( 3 ) ],
|
||||||
|
"loop": false,
|
||||||
|
"name": "lvl1",
|
||||||
|
"speed": 60.0
|
||||||
|
} ]
|
||||||
|
|
||||||
|
[node name="SlimeCard" type="TextureRect"]
|
||||||
|
margin_left = 124.0
|
||||||
|
margin_top = 220.0
|
||||||
|
margin_right = 156.0
|
||||||
|
margin_bottom = 252.0
|
||||||
|
texture = ExtResource( 8 )
|
||||||
|
expand = true
|
||||||
|
script = ExtResource( 1 )
|
||||||
|
__meta__ = {
|
||||||
|
"_edit_use_anchors_": false
|
||||||
|
}
|
||||||
|
Item = ExtResource( 6 )
|
||||||
|
PreviewIcon = ExtResource( 7 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
position = Vector2( 15.729, 15.793 )
|
||||||
|
z_index = -1
|
||||||
|
texture = ExtResource( 5 )
|
||||||
|
|
||||||
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||||
|
position = Vector2( 33.1035, 40.3068 )
|
||||||
|
frames = SubResource( 1 )
|
||||||
|
animation = "lvl0"
|
||||||
BIN
src/Objects/Slime/slime_icon.png
Normal file
BIN
src/Objects/Slime/slime_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 419 B |
34
src/Objects/Slime/slime_icon.png.import
Normal file
34
src/Objects/Slime/slime_icon.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="StreamTexture"
|
||||||
|
path="res://.import/slime_icon.png-dc1d3257111103e477a0d76ad442deeb.stex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Objects/Slime/slime_icon.png"
|
||||||
|
dest_files=[ "res://.import/slime_icon.png-dc1d3257111103e477a0d76ad442deeb.stex" ]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_mode=0
|
||||||
|
compress/bptc_ldr=0
|
||||||
|
compress/normal_map=0
|
||||||
|
flags/repeat=0
|
||||||
|
flags/filter=false
|
||||||
|
flags/mipmaps=false
|
||||||
|
flags/anisotropic=false
|
||||||
|
flags/srgb=2
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/HDR_as_SRGB=false
|
||||||
|
process/invert_color=false
|
||||||
|
stream=false
|
||||||
|
size_limit=0
|
||||||
|
detect_3d=false
|
||||||
|
svg/scale=1.0
|
||||||
@@ -15,15 +15,15 @@ animations = [ {
|
|||||||
"name": "lvl0",
|
"name": "lvl0",
|
||||||
"speed": 60.0
|
"speed": 60.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [ ExtResource( 6 ) ],
|
|
||||||
"loop": false,
|
|
||||||
"name": "lvl1",
|
|
||||||
"speed": 60.0
|
|
||||||
}, {
|
|
||||||
"frames": [ ExtResource( 5 ) ],
|
"frames": [ ExtResource( 5 ) ],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": "lvl2",
|
"name": "lvl2",
|
||||||
"speed": 60.0
|
"speed": 60.0
|
||||||
|
}, {
|
||||||
|
"frames": [ ExtResource( 6 ) ],
|
||||||
|
"loop": false,
|
||||||
|
"name": "lvl1",
|
||||||
|
"speed": 60.0
|
||||||
} ]
|
} ]
|
||||||
|
|
||||||
[node name="TorchCard" type="TextureRect"]
|
[node name="TorchCard" type="TextureRect"]
|
||||||
|
|||||||
29
src/World.gd
29
src/World.gd
@@ -1,14 +1,14 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
export(int) var WinRounds= 10
|
export(int) var WinRounds = 10
|
||||||
export(PackedScene) var HeroTemplate
|
export(PackedScene) var HeroTemplate
|
||||||
export(Vector2) var InitialSpawnPoint=Vector2(344,125)
|
export(Vector2) var InitialSpawnPoint = Vector2(344, 125)
|
||||||
export(Rect2) var SpawnBoxRange=Rect2(20,20,450,180)
|
export(Rect2) var SpawnBoxRange = Rect2(20, 20, 450, 180)
|
||||||
export(float) var MinDistanceToBoss=100.0
|
export(float) var MinDistanceToBoss = 100.0
|
||||||
|
|
||||||
|
var round_counter = 0
|
||||||
|
var passed_final_Round = false
|
||||||
|
|
||||||
var round_counter=0
|
|
||||||
var passed_final_Round=false
|
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
randomize()
|
randomize()
|
||||||
@@ -19,33 +19,34 @@ func _ready():
|
|||||||
|
|
||||||
func determine_spawnpoint():
|
func determine_spawnpoint():
|
||||||
var point = Vector2(rand_range(SpawnBoxRange.position.x,SpawnBoxRange.position.x+SpawnBoxRange.size.x),rand_range(SpawnBoxRange.position.y,SpawnBoxRange.position.y+SpawnBoxRange.size.y))
|
var point = Vector2(rand_range(SpawnBoxRange.position.x,SpawnBoxRange.position.x+SpawnBoxRange.size.x),rand_range(SpawnBoxRange.position.y,SpawnBoxRange.position.y+SpawnBoxRange.size.y))
|
||||||
while(point.distance_to($YSort/SlimeBoss.position)<MinDistanceToBoss):
|
while(point.distance_to($YSort/SlimeBoss.position) < MinDistanceToBoss):
|
||||||
point = Vector2(rand_range(SpawnBoxRange.position.x,SpawnBoxRange.position.x+SpawnBoxRange.size.x),rand_range(SpawnBoxRange.position.y,SpawnBoxRange.position.y+SpawnBoxRange.size.y))
|
point = Vector2(rand_range(SpawnBoxRange.position.x,SpawnBoxRange.position.x+SpawnBoxRange.size.x),rand_range(SpawnBoxRange.position.y,SpawnBoxRange.position.y+SpawnBoxRange.size.y))
|
||||||
return point
|
return point
|
||||||
|
|
||||||
|
|
||||||
func hero_has_died():
|
func hero_has_died():
|
||||||
round_counter+=1
|
round_counter += 1
|
||||||
if (round_counter>=WinRounds and passed_final_Round ==false):
|
if (round_counter >= WinRounds and not passed_final_Round):
|
||||||
passed_final_Round=true
|
passed_final_Round = true
|
||||||
$CanvasLayer/Win.show()
|
$CanvasLayer/Win.show()
|
||||||
|
|
||||||
Engine.time_scale=0
|
Engine.time_scale = 0
|
||||||
var point = determine_spawnpoint()
|
var point = determine_spawnpoint()
|
||||||
spawn_new_hero(point.x,point.y)
|
spawn_new_hero(point.x, point.y)
|
||||||
$CanvasLayer/SelectUpgradeUI.show()
|
$CanvasLayer/SelectUpgradeUI.show()
|
||||||
|
$CanvasLayer/SelectUpgradeUI/Button.show()
|
||||||
$CanvasLayer/SelectUpgradeUI.starting()
|
$CanvasLayer/SelectUpgradeUI.starting()
|
||||||
|
|
||||||
|
|
||||||
func spawn_new_hero(x:float,y:float):
|
func spawn_new_hero(x:float,y:float):
|
||||||
var hero = HeroTemplate.instance()
|
var hero = HeroTemplate.instance()
|
||||||
hero.position=Vector2(x,y)
|
hero.position = Vector2(x, y)
|
||||||
hero.name = "Player"
|
hero.name = "Player"
|
||||||
$YSort.add_child(hero)
|
$YSort.add_child(hero)
|
||||||
|
|
||||||
|
|
||||||
func _on_Win_pressed():
|
func _on_Win_pressed():
|
||||||
if passed_final_Round:
|
if passed_final_Round:
|
||||||
#TODO CHANGE SCENE TO WINSCREEN
|
# TODO CHANGE SCENE TO WINSCREEN
|
||||||
pass
|
pass
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|||||||
Reference in New Issue
Block a user