mirror of
https://github.com/HarmonyHoney/ROTA.git
synced 2026-07-17 16:46:17 +00:00
tiny cleanup on Player hit(:
This commit is contained in:
parent
58b8bd5feb
commit
2e6fd3ded9
2 changed files with 7 additions and 17 deletions
|
|
@ -34,7 +34,6 @@ export var sprite_weight := 3.0
|
|||
var target_angle := 0.0
|
||||
|
||||
var blink_clock := 0.0
|
||||
var is_punch := false
|
||||
|
||||
func _ready():
|
||||
if Engine.editor_hint: return
|
||||
|
|
@ -159,15 +158,12 @@ func _physics_process(delta):
|
|||
for i in hit_area.get_overlapping_areas():
|
||||
var o = i.owner
|
||||
if o is Box:
|
||||
if joy.y != 0:
|
||||
o.set_dir(dir + (0 if joy.y == 1 else 2))
|
||||
else:
|
||||
o.set_dir(dir + (3 if dir_x == 1 else 1))
|
||||
var d = 0 if joy.y == 1 else 2 if joy.y == -1 else 3 if dir_x == 1 else 1
|
||||
o.set_dir(dir + d)
|
||||
o.move_clock = 0
|
||||
#audio_punch.play()
|
||||
print(o.name, " hit, dir: ", o.dir)
|
||||
break
|
||||
|
||||
print(i.owner.name, "hit")
|
||||
|
||||
# apply movement
|
||||
move_velocity = move_and_slide(rot(velocity))
|
||||
|
|
@ -212,11 +208,9 @@ func _on_BodyArea_area_entered(area):
|
|||
print("hit spike")
|
||||
get_tree().reload_current_scene()
|
||||
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
if anim_name == "punch":
|
||||
if is_floor:
|
||||
anim.play("idle")
|
||||
else:
|
||||
anim.play("jump")
|
||||
#is_punch = false
|
||||
|
|
|
|||
|
|
@ -831,11 +831,10 @@ texture = ExtResource( 6 )
|
|||
[node name="Sprites" type="Node2D" parent="."]
|
||||
|
||||
[node name="Node2D" type="Node2D" parent="Sprites"]
|
||||
position = Vector2( 0, 0.955555 )
|
||||
scale = Vector2( 0.25, 0.25 )
|
||||
|
||||
[node name="hand2" type="Sprite" parent="Sprites/Node2D"]
|
||||
position = Vector2( 131.385, 30 )
|
||||
position = Vector2( 125, 30 )
|
||||
texture = ExtResource( 9 )
|
||||
|
||||
[node name="body" type="Sprite" parent="Sprites/Node2D"]
|
||||
|
|
@ -852,21 +851,18 @@ texture = ExtResource( 8 )
|
|||
|
||||
[node name="mouth" type="Sprite" parent="Sprites/Node2D/body"]
|
||||
position = Vector2( 31, 44 )
|
||||
scale = Vector2( 1.11685, 1.11685 )
|
||||
texture = ExtResource( 1 )
|
||||
|
||||
[node name="leg" type="Sprite" parent="Sprites/Node2D"]
|
||||
position = Vector2( -92.395, 90.9563 )
|
||||
rotation = 0.14858
|
||||
position = Vector2( -87.5, 95 )
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="leg2" type="Sprite" parent="Sprites/Node2D"]
|
||||
position = Vector2( 92.395, 90.9563 )
|
||||
rotation = -0.14858
|
||||
position = Vector2( 87.5, 95 )
|
||||
texture = ExtResource( 5 )
|
||||
|
||||
[node name="hand" type="Sprite" parent="Sprites/Node2D"]
|
||||
position = Vector2( -113.236, 30 )
|
||||
position = Vector2( -106, 30 )
|
||||
texture = ExtResource( 9 )
|
||||
|
||||
[connection signal="area_entered" from="BodyArea" to="." method="_on_BodyArea_area_entered"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue