mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-11 21: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():
|
||||
_dialogues.append([
|
||||
"Hero;I... I... I need to go pee",
|
||||
"Boss;After this you won't need to pee ever again!",
|
||||
"More text...............",
|
||||
"Even more text................",
|
||||
".................................",
|
||||
".........................",
|
||||
"...................",
|
||||
"...",
|
||||
"We're done here."
|
||||
"Hero: I... I... I need to go pee",
|
||||
"Boss: After this you won't need to pee ever again!"
|
||||
])
|
||||
_dialogues.append([
|
||||
"Hero;I've come to slay you, you beast!",
|
||||
"Boss;Well then... step forward!"
|
||||
"Hero: I've come to slay you, you beast!",
|
||||
"Boss: Well then... step forward!"
|
||||
])
|
||||
_dialogues.append([
|
||||
"Hero;You've killed so many, but you won't kill me!",
|
||||
"Boss;We'll see about that!"
|
||||
"Hero: You've killed so many, but you won't kill me!",
|
||||
"Boss: We'll see about that!"
|
||||
])
|
||||
|
||||
func get_dialogue(id):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
extends Control
|
||||
|
||||
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 {
|
||||
BANANA,
|
||||
@@ -11,6 +11,7 @@ enum cards {
|
||||
BEAR,
|
||||
FLAME,
|
||||
SPIKE,
|
||||
SLIME,
|
||||
EMPTY
|
||||
}
|
||||
|
||||
@@ -25,7 +26,6 @@ func update_cards():
|
||||
index += 1
|
||||
var newchild = []
|
||||
for card in range(index):
|
||||
|
||||
match usedCards[card]:
|
||||
cards.BANANA:
|
||||
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())
|
||||
cards.SPIKE:
|
||||
newchild.append(load("res://Objects/Traps/Spike/SpikeCard.tscn").instance())
|
||||
#cards.SLIME:
|
||||
#newchild=(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
||||
cards.SLIME:
|
||||
newchild.append(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
||||
for i in range(index):
|
||||
$CardsDisplay.add_child(newchild[i])
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ func _ready():
|
||||
func starting():
|
||||
shownCards = []
|
||||
if (showCards):
|
||||
$Button.hide()
|
||||
randcards[0] = randi() % DrNDrPre.cards.EMPTY
|
||||
while(DrNDr.usedCards[0]==randcards[0] or
|
||||
DrNDr.usedCards[1]==randcards[0] or
|
||||
@@ -40,7 +41,6 @@ func starting():
|
||||
DrNDr.usedCards[4]==randcards[2]):
|
||||
randcards[2] = randi() % DrNDrPre.cards.EMPTY
|
||||
|
||||
|
||||
for i in range(3):
|
||||
match randcards[i]:
|
||||
DrNDrPre.cards.BANANA:
|
||||
@@ -57,8 +57,8 @@ func starting():
|
||||
shownCards.append(load("res://Objects/Traps/Flame/FlameCard.tscn").instance())
|
||||
DrNDrPre.cards.SPIKE:
|
||||
shownCards.append(load("res://Objects/Traps/Spike/SpikeCard.tscn").instance())
|
||||
#DrNDrPre.cards.SLIME:
|
||||
#shownCards.append(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
||||
DrNDrPre.cards.SLIME:
|
||||
shownCards.append(load("res://Objects/Slime/SlimeCard.tscn").instance())
|
||||
for i in range(3):
|
||||
$Cards.add_child(shownCards[i])
|
||||
shownCards[0].set_begin (cardPositions[0])
|
||||
|
||||
@@ -16,15 +16,15 @@ animations = [ {
|
||||
"name": "lvl0",
|
||||
"speed": 60.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 4 ) ],
|
||||
"loop": false,
|
||||
"name": "lvl1",
|
||||
"speed": 60.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 3 ) ],
|
||||
"loop": false,
|
||||
"name": "lvl2",
|
||||
"speed": 60.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 4 ) ],
|
||||
"loop": false,
|
||||
"name": "lvl1",
|
||||
"speed": 60.0
|
||||
} ]
|
||||
|
||||
[node name="BananaCard" type="TextureRect"]
|
||||
|
||||
@@ -16,15 +16,15 @@ animations = [ {
|
||||
"name": "lvl0",
|
||||
"speed": 60.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 3 ) ],
|
||||
"loop": false,
|
||||
"name": "lvl1",
|
||||
"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="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",
|
||||
"speed": 60.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 6 ) ],
|
||||
"loop": false,
|
||||
"name": "lvl1",
|
||||
"speed": 60.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 5 ) ],
|
||||
"loop": false,
|
||||
"name": "lvl2",
|
||||
"speed": 60.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 6 ) ],
|
||||
"loop": false,
|
||||
"name": "lvl1",
|
||||
"speed": 60.0
|
||||
} ]
|
||||
|
||||
[node name="TorchCard" type="TextureRect"]
|
||||
|
||||
29
src/World.gd
29
src/World.gd
@@ -1,14 +1,14 @@
|
||||
extends Node2D
|
||||
|
||||
export(int) var WinRounds= 10
|
||||
export(int) var WinRounds = 10
|
||||
export(PackedScene) var HeroTemplate
|
||||
export(Vector2) var InitialSpawnPoint=Vector2(344,125)
|
||||
export(Rect2) var SpawnBoxRange=Rect2(20,20,450,180)
|
||||
export(float) var MinDistanceToBoss=100.0
|
||||
export(Vector2) var InitialSpawnPoint = Vector2(344, 125)
|
||||
export(Rect2) var SpawnBoxRange = Rect2(20, 20, 450, 180)
|
||||
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():
|
||||
randomize()
|
||||
@@ -19,33 +19,34 @@ func _ready():
|
||||
|
||||
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))
|
||||
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))
|
||||
return point
|
||||
|
||||
|
||||
func hero_has_died():
|
||||
round_counter+=1
|
||||
if (round_counter>=WinRounds and passed_final_Round ==false):
|
||||
passed_final_Round=true
|
||||
round_counter += 1
|
||||
if (round_counter >= WinRounds and not passed_final_Round):
|
||||
passed_final_Round = true
|
||||
$CanvasLayer/Win.show()
|
||||
|
||||
Engine.time_scale=0
|
||||
Engine.time_scale = 0
|
||||
var point = determine_spawnpoint()
|
||||
spawn_new_hero(point.x,point.y)
|
||||
spawn_new_hero(point.x, point.y)
|
||||
$CanvasLayer/SelectUpgradeUI.show()
|
||||
$CanvasLayer/SelectUpgradeUI/Button.show()
|
||||
$CanvasLayer/SelectUpgradeUI.starting()
|
||||
|
||||
|
||||
func spawn_new_hero(x:float,y:float):
|
||||
var hero = HeroTemplate.instance()
|
||||
hero.position=Vector2(x,y)
|
||||
hero.position = Vector2(x, y)
|
||||
hero.name = "Player"
|
||||
$YSort.add_child(hero)
|
||||
|
||||
|
||||
func _on_Win_pressed():
|
||||
if passed_final_Round:
|
||||
#TODO CHANGE SCENE TO WINSCREEN
|
||||
# TODO CHANGE SCENE TO WINSCREEN
|
||||
pass
|
||||
pass # Replace with function body.
|
||||
|
||||
Reference in New Issue
Block a user