mirror of
https://github.com/creyD/ludum_dare_46.git
synced 2026-06-11 21:22:22 +02:00
Turn System Working, Upgrade UI missing
This commit is contained in:
8
src/Menus/SelectUpgradeUI/SelectUpgradeUI.gd
Normal file
8
src/Menus/SelectUpgradeUI/SelectUpgradeUI.gd
Normal file
@@ -0,0 +1,8 @@
|
||||
extends Control
|
||||
|
||||
|
||||
|
||||
func _on_Button_pressed():
|
||||
Engine.time_scale=1
|
||||
self.hide()
|
||||
pass # Replace with function body.
|
||||
28
src/Menus/SelectUpgradeUI/SelectUpgradeUI.tscn
Normal file
28
src/Menus/SelectUpgradeUI/SelectUpgradeUI.tscn
Normal file
@@ -0,0 +1,28 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://Menus/SelectUpgradeUI/SelectUpgradeUI.gd" type="Script" id=1]
|
||||
|
||||
[node name="SelectUpgradeUI" type="Control"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_right = -480.0
|
||||
margin_bottom = -270.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Button" type="Button" parent="."]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 1.0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 349.105
|
||||
margin_top = 249.473
|
||||
margin_right = 482.105
|
||||
margin_bottom = 269.473
|
||||
text = "Continue"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[connection signal="pressed" from="Button" to="." method="_on_Button_pressed"]
|
||||
@@ -198,7 +198,8 @@ func _on_Hurtbox_area_exited(area):
|
||||
|
||||
func _on_Stats_no_health():
|
||||
queue_free()
|
||||
get_tree().change_scene("res://Menus/TitleScreen/TitleScreen.tscn")
|
||||
get_tree().get_root().get_node("World").hero_has_died()
|
||||
#get_tree().change_scene("res://Menus/TitleScreen/TitleScreen.tscn")
|
||||
|
||||
|
||||
func _on_Hitbox_area_entered(area):
|
||||
|
||||
@@ -619,19 +619,18 @@ height = 0.2
|
||||
radius = 4.03497
|
||||
height = 9.42006
|
||||
|
||||
[sub_resource type="CircleShape2D" id=51]
|
||||
[sub_resource type="CircleShape2D" id=49]
|
||||
radius = 13.3924
|
||||
|
||||
[sub_resource type="DynamicFont" id=50]
|
||||
size = 12
|
||||
font_data = ExtResource( 6 )
|
||||
|
||||
|
||||
[node name="Player" type="KinematicBody2D" groups=[
|
||||
"hero",
|
||||
]]
|
||||
scale = Vector2( 2, 2 )
|
||||
collision_mask = 14
|
||||
|
||||
script = ExtResource( 1 )
|
||||
ROLL_SPEED = 120
|
||||
FRICTION = 270
|
||||
@@ -724,7 +723,7 @@ damage = 0.0
|
||||
|
||||
[node name="CollisionShape2D" parent="Pivot/SwordRange" index="0"]
|
||||
position = Vector2( 0, -4.56405 )
|
||||
shape = SubResource( 51 )
|
||||
shape = SubResource( 49 )
|
||||
|
||||
[node name="DebugLabel" type="Label" parent="."]
|
||||
margin_left = -8.12021
|
||||
|
||||
14
src/World.gd
14
src/World.gd
@@ -1,6 +1,20 @@
|
||||
extends Node2D
|
||||
|
||||
export(PackedScene) var HeroTemplate
|
||||
export(Vector2) var Spawnpoint=Vector2(344,125)
|
||||
|
||||
func _ready():
|
||||
randomize()
|
||||
spawn_new_hero(Spawnpoint.x,Spawnpoint.y)
|
||||
pass # Replace with function body.
|
||||
|
||||
func hero_has_died():
|
||||
Engine.time_scale=0
|
||||
spawn_new_hero(Spawnpoint.x,Spawnpoint.y)
|
||||
$CanvasLayer/SelectUpgradeUI.show()
|
||||
|
||||
|
||||
func spawn_new_hero(x:float,y:float):
|
||||
var hero = HeroTemplate.instance()
|
||||
hero.position=Vector2(x,y)
|
||||
$YSort.add_child(hero)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=2]
|
||||
[gd_scene load_steps=12 format=2]
|
||||
|
||||
[ext_resource path="res://Player/Player.tscn" type="PackedScene" id=1]
|
||||
[ext_resource path="res://World.gd" type="Script" id=2]
|
||||
@@ -8,22 +8,28 @@
|
||||
[ext_resource path="res://Menus/DialogueBox/DialogueBox.tscn" type="PackedScene" id=6]
|
||||
[ext_resource path="res://Maps/Background/Background.tscn" type="PackedScene" id=7]
|
||||
[ext_resource path="res://Boss/SlimeBoss/SlimeBoss.tscn" type="PackedScene" id=8]
|
||||
[ext_resource path="res://Menus/SelectUpgradeUI/SelectUpgradeUI.tscn" type="PackedScene" id=9]
|
||||
[ext_resource path="res://Objects/Bonfire/Bonfire.tscn" type="PackedScene" id=10]
|
||||
[ext_resource path="res://Maps/Grid.tscn" type="PackedScene" id=18]
|
||||
|
||||
[node name="World" type="Node2D"]
|
||||
pause_mode = 2
|
||||
script = ExtResource( 2 )
|
||||
HeroTemplate = ExtResource( 1 )
|
||||
|
||||
[node name="WallSprite" type="Sprite" parent="."]
|
||||
pause_mode = 1
|
||||
position = Vector2( 360, 176 )
|
||||
texture = ExtResource( 4 )
|
||||
region_enabled = true
|
||||
region_rect = Rect2( 0, 0, 1280, 720 )
|
||||
|
||||
[node name="Background" parent="." instance=ExtResource( 7 )]
|
||||
frame = 20
|
||||
pause_mode = 1
|
||||
frame = 17
|
||||
|
||||
[node name="FloorTileMap" type="TileMap" parent="."]
|
||||
pause_mode = 1
|
||||
visible = false
|
||||
position = Vector2( 16, 16 )
|
||||
tile_set = ExtResource( 3 )
|
||||
@@ -38,24 +44,24 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="YSort" type="YSort" parent="."]
|
||||
pause_mode = 1
|
||||
|
||||
[node name="Bonfire" parent="YSort" instance=ExtResource( 10 )]
|
||||
position = Vector2( 265.543, -16 )
|
||||
|
||||
[node name="Player" parent="YSort" instance=ExtResource( 1 )]
|
||||
position = Vector2( 344, 125.768 )
|
||||
scale = Vector2( 2, 2 )
|
||||
ROLL_SPEED = 140
|
||||
FRICTION = 200
|
||||
|
||||
[node name="SlimeBoss" parent="YSort" instance=ExtResource( 8 )]
|
||||
position = Vector2( 104, 80 )
|
||||
|
||||
[node name="Grid" parent="." instance=ExtResource( 18 )]
|
||||
pause_mode = 1
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
pause_mode = 2
|
||||
|
||||
[node name="DialogueBox" parent="CanvasLayer" instance=ExtResource( 6 )]
|
||||
visible = false
|
||||
|
||||
[node name="DragNDropUI" parent="CanvasLayer" instance=ExtResource( 5 )]
|
||||
|
||||
[node name="SelectUpgradeUI" parent="CanvasLayer" instance=ExtResource( 9 )]
|
||||
visible = false
|
||||
|
||||
Reference in New Issue
Block a user