Compare commits

...

3 Commits

Author SHA1 Message Date
Luna Brovchuk c23ad7a0cb Fix the repo lol. 2023-09-30 19:53:37 +02:00
Luna Brovchuk 3bcc5f4401 Merge branch 'main' of http://meowo.cc:3000/meowo/LD54 2023-09-30 19:53:06 +02:00
Luna Brovchuk 7ee336c7d5 Add HP Logic 2023-09-30 19:37:52 +02:00
7 changed files with 64 additions and 25 deletions

View File

@ -20,7 +20,7 @@ compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
@ -31,5 +31,5 @@ process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
detect_3d=false
svg/scale=1.0

View File

@ -8,6 +8,16 @@
config_version=4
_global_script_classes=[ {
"base": "EditorVCSInterface",
"class": "GitAPI",
"language": "NativeScript",
"path": "res://addons/godot-git-plugin/git_api.gdns"
} ]
_global_script_class_icons={
"GitAPI": ""
}
[application]
config/name="LD54"
@ -38,7 +48,7 @@ version_control_plugin_name="GitAPI"
[gdnative]
singletons=[ ]
singletons=[ "res://addons/godot-git-plugin/git_api.gdnlib" ]
[global]

View File

@ -1,3 +1,12 @@
extends Node
var game_scene = preload("res://src/scenes/game/Game.tscn")
var GAME_SCENE = preload("res://src/scenes/game/Game.tscn")
var playing = true
var health = 2
func add_health(amount):
health = clamp(health + amount, 0, 3)
get_tree().get_root().get_node("Game/UI/Health/HealthSprite").frame = health
if health == 0:
pass # TODO endgame

View File

@ -7,6 +7,6 @@ func get_input():
var input_direction = Input.get_vector("left", "right", "up", "down")
velocity = input_direction * speed
func _physics_process(delta):
func _physics_process(_delta):
get_input()
move_and_slide(velocity)
velocity = move_and_slide(velocity)

View File

@ -1,30 +1,37 @@
<<<<<<< HEAD
[gd_scene load_steps=10 format=2]
=======
[gd_scene load_steps=9 format=2]
>>>>>>> parent of f3dd6ee (Change Player Hitbox)
[gd_scene load_steps=16 format=2]
[ext_resource path="res://src/scenes/menu/background/background.png" type="Texture" id=1]
[ext_resource path="res://src/scenes/game/sprites/background_houses.png" type="Texture" id=2]
[ext_resource path="res://src/scenes/game/spell_holder.gd" type="Script" id=3]
[ext_resource path="res://res/fonts/silkscreen/Silkscreen-Regular.ttf" type="DynamicFontData" id=4]
[ext_resource path="res://src/models/player/Player.tscn" type="PackedScene" id=5]
<<<<<<< HEAD
[ext_resource path="res://src/scenes/game/sprites/ui_background.png" type="Texture" id=6]
=======
>>>>>>> parent of f3dd6ee (Change Player Hitbox)
[ext_resource path="res://src/scenes/game/sprites/health/3.png" type="Texture" id=6]
[ext_resource path="res://src/scenes/game/sprites/health/1.png" type="Texture" id=7]
[ext_resource path="res://src/scenes/game/sprites/health/2.png" type="Texture" id=8]
[ext_resource path="res://src/scenes/game/sprites/health/0.png" type="Texture" id=9]
[ext_resource path="res://icon.png" type="Texture" id=10]
[ext_resource path="res://src/scenes/game/game.gd" type="Script" id=11]
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 10, 60 )
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 140, 10.25 )
extents = Vector2( 140, 10.125 )
[sub_resource type="DynamicFont" id=1]
size = 8
font_data = ExtResource( 4 )
[sub_resource type="SpriteFrames" id=4]
animations = [ {
"frames": [ ExtResource( 9 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 6 ) ],
"loop": true,
"name": "default",
"speed": 5.0
} ]
[node name="Game" type="Node"]
script = ExtResource( 11 )
[node name="View" type="Node2D" parent="."]
@ -55,7 +62,7 @@ position = Vector2( 160, 10.25 )
shape = SubResource( 3 )
[node name="CollisionShape2D4" type="CollisionShape2D" parent="View/Background/Houses"]
position = Vector2( 160, 110 )
position = Vector2( 160, 109.875 )
shape = SubResource( 3 )
[node name="Player" parent="View" instance=ExtResource( 5 )]
@ -65,13 +72,6 @@ position = Vector2( 46, 42 )
margin_right = 40.0
margin_bottom = 40.0
[node name="UIBackground" type="TextureRect" parent="UI"]
margin_top = 120.0
margin_right = 320.0
margin_bottom = 180.0
texture = ExtResource( 6 )
expand = true
[node name="SpellHolder" type="Control" parent="UI"]
margin_left = 120.0
margin_top = 145.0
@ -86,3 +86,19 @@ margin_right = 79.0
margin_bottom = 7.0
custom_fonts/font = SubResource( 1 )
text = "spell modifiers"
[node name="Health" type="Control" parent="UI"]
margin_right = 40.0
margin_bottom = 40.0
[node name="HealthSprite" type="AnimatedSprite" parent="UI/Health"]
position = Vector2( 70, 145 )
frames = SubResource( 4 )
frame = 2
centered = false
[node name="PlayerIcon" type="Sprite" parent="UI"]
position = Vector2( 20, 134 )
scale = Vector2( 0.5, 0.5 )
texture = ExtResource( 10 )
centered = false

4
src/scenes/game/game.gd Normal file
View File

@ -0,0 +1,4 @@
extends Node
func _ready():
Global.add_health(1)

View File

@ -1,7 +1,7 @@
extends Node
func game_start():
get_tree().change_scene_to(Global.game_scene)
get_tree().change_scene_to(Global.GAME_SCENE)
func game_exit():
get_tree().quit(0)