can punch self

This commit is contained in:
Bel LaPointe
2025-03-02 18:07:14 -07:00
parent ed5e6d4487
commit f7f46ba96e
10 changed files with 220 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
extends BreeLPlayer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_speed_increased() -> void:
print("SPEED INCREASED")
pass # Replace with function body.

16
src/godot/gd/button.gd Normal file
View File

@@ -0,0 +1,16 @@
extends Button
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_button_up() -> void:
print("button up")
get_parent().get_parent().tackled()

10
src/godot/gd/name.gd Normal file
View File

@@ -0,0 +1,10 @@
extends RichTextLabel
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
self.text = get_parent().mon_name()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View File

@@ -1,9 +1,58 @@
[gd_scene load_steps=2 format=3 uid="uid://dg85xsdqg6wj0"]
[gd_scene load_steps=5 format=3 uid="uid://dg85xsdqg6wj0"]
[ext_resource type="Texture2D" uid="uid://cneqjngiworik" path="res://icon.svg" id="1_swwii"]
[ext_resource type="Script" path="res://gd/texture_progress_bar.gd" id="2_2jm7r"]
[ext_resource type="Script" path="res://gd/name.gd" id="3_u8x5l"]
[ext_resource type="Script" path="res://gd/button.gd" id="4_iyywh"]
[node name="Node2D" type="Node2D"]
[node name="BreeLPlayer" type="BreeLPlayer" parent="."]
position = Vector2(556, 302)
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(2, 0)
[node name="Sprite2D" type="Sprite2D" parent="."]
z_index = -10
position = Vector2(-9.53674e-06, 4.29153e-06)
scale = Vector2(9, 5.0625)
texture = ExtResource("1_swwii")
[node name="attacker" type="Mon" parent="."]
position = Vector2(-408.5, 157.5)
scale = Vector2(2.41406, 2.41406)
[node name="TextureProgressBar" type="TextureProgressBar" parent="attacker"]
z_index = 10
offset_right = 40.0
offset_bottom = 40.0
texture_progress = ExtResource("1_swwii")
script = ExtResource("2_2jm7r")
[node name="name" type="RichTextLabel" parent="attacker"]
z_index = 10
offset_right = 348.0
offset_bottom = 40.0
text = "asdf"
script = ExtResource("3_u8x5l")
[node name="sprite" type="Sprite2D" parent="attacker"]
texture = ExtResource("1_swwii")
[node name="actions" type="Node2D" parent="attacker"]
position = Vector2(169.217, -65.2427)
scale = Vector2(0.414239, 0.414239)
[node name="button" type="Button" parent="attacker/actions"]
offset_left = 435.0
offset_top = 180.0
offset_right = 435.0
offset_bottom = 180.0
icon = ExtResource("1_swwii")
script = ExtResource("4_iyywh")
[node name="opponent" type="Sprite2D" parent="."]
position = Vector2(420, -166)
scale = Vector2(2.41406, 2.41406)
texture = ExtResource("1_swwii")
[connection signal="hp_changed" from="attacker" to="attacker/TextureProgressBar" method="_on_mon_hp_changed"]
[connection signal="button_up" from="attacker/actions/button" to="attacker/actions/button" method="_on_button_up"]

View File

@@ -0,0 +1,15 @@
extends TextureProgressBar
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_mon_hp_changed() -> void:
self.value = 100 * get_parent().hp()

View File

@@ -0,0 +1,14 @@
extends TouchScreenButton
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_pressed() -> void:
print("pressed")