fixed remote animation
This commit is contained in:
parent
d725e1a0cf
commit
5fb45792c4
5 changed files with 36 additions and 7 deletions
19
games/platformer/animation_props.gd
Normal file
19
games/platformer/animation_props.gd
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
|
||||||
|
# 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_the_bit_where_you_trip_area_entered(area: Area2D) -> void:
|
||||||
|
if(area.get_parent().name == "Player"):
|
||||||
|
show()
|
||||||
1
games/platformer/animation_props.gd.uid
Normal file
1
games/platformer/animation_props.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
uid://iqb36fx2bj38
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=47 format=4 uid="uid://ckbyiwy0dxbsd"]
|
[gd_scene load_steps=48 format=4 uid="uid://ckbyiwy0dxbsd"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://dqyddqx8xm0gw" path="res://games/platformer/player.gd" id="1_1wj3w"]
|
[ext_resource type="Script" uid="uid://dqyddqx8xm0gw" path="res://games/platformer/player.gd" id="1_1wj3w"]
|
||||||
[ext_resource type="Script" uid="uid://bs4keltwfbrrn" path="res://games/platformer/platformer.gd" id="1_mauky"]
|
[ext_resource type="Script" uid="uid://bs4keltwfbrrn" path="res://games/platformer/platformer.gd" id="1_mauky"]
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
[ext_resource type="Texture2D" uid="uid://b2girwlk6ijy5" path="res://sprites/bigRemote.png" id="10_cpnel"]
|
[ext_resource type="Texture2D" uid="uid://b2girwlk6ijy5" path="res://sprites/bigRemote.png" id="10_cpnel"]
|
||||||
[ext_resource type="Script" uid="uid://bs0xmxrplimpf" path="res://games/platformer/trip_animation.gd" id="10_vuxiy"]
|
[ext_resource type="Script" uid="uid://bs0xmxrplimpf" path="res://games/platformer/trip_animation.gd" id="10_vuxiy"]
|
||||||
[ext_resource type="Texture2D" uid="uid://r71wb0u4bsxw" path="res://sprites/broken_tv_remote.png" id="11_vuxiy"]
|
[ext_resource type="Texture2D" uid="uid://r71wb0u4bsxw" path="res://sprites/broken_tv_remote.png" id="11_vuxiy"]
|
||||||
|
[ext_resource type="Script" uid="uid://iqb36fx2bj38" path="res://games/platformer/animation_props.gd" id="12_4fc0x"]
|
||||||
[ext_resource type="Script" uid="uid://bl7sx7fl7ye4a" path="res://games/platformer/tv_remote.gd" id="13_7gl5q"]
|
[ext_resource type="Script" uid="uid://bl7sx7fl7ye4a" path="res://games/platformer/tv_remote.gd" id="13_7gl5q"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dv4ex5tshavff" path="res://games/platformer/door.tscn" id="14_yphhh"]
|
[ext_resource type="PackedScene" uid="uid://dv4ex5tshavff" path="res://games/platformer/door.tscn" id="14_yphhh"]
|
||||||
[ext_resource type="Script" uid="uid://bnprbj4be8n7j" path="res://games/platformer/existWhenGaming.gd" id="16_g0mja"]
|
[ext_resource type="Script" uid="uid://bnprbj4be8n7j" path="res://games/platformer/existWhenGaming.gd" id="16_g0mja"]
|
||||||
|
|
@ -71,7 +72,7 @@ animations = [{
|
||||||
}],
|
}],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": &"idle",
|
"name": &"idle",
|
||||||
"speed": 5.0
|
"speed": 2.0
|
||||||
}, {
|
}, {
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
|
|
@ -295,7 +296,7 @@ player_sprite = NodePath("Sprite2D")
|
||||||
[node name="Sprite2D" type="AnimatedSprite2D" parent="Player"]
|
[node name="Sprite2D" type="AnimatedSprite2D" parent="Player"]
|
||||||
scale = Vector2(2, 2)
|
scale = Vector2(2, 2)
|
||||||
sprite_frames = SubResource("SpriteFrames_i6xil")
|
sprite_frames = SubResource("SpriteFrames_i6xil")
|
||||||
animation = &"jump"
|
animation = &"idle"
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
||||||
shape = SubResource("RectangleShape2D_oyf6i")
|
shape = SubResource("RectangleShape2D_oyf6i")
|
||||||
|
|
@ -371,13 +372,16 @@ position = Vector2(256, 280)
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="BrokenRemote"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="BrokenRemote"]
|
||||||
shape = SubResource("RectangleShape2D_cpnel")
|
shape = SubResource("RectangleShape2D_cpnel")
|
||||||
|
|
||||||
[node name="TripAnimation" type="AnimationPlayer" parent="."]
|
[node name="TripAnimation" type="AnimationPlayer" parent="." node_paths=PackedStringArray("tv_remote")]
|
||||||
libraries = {
|
libraries = {
|
||||||
&"": SubResource("AnimationLibrary_mauky")
|
&"": SubResource("AnimationLibrary_mauky")
|
||||||
}
|
}
|
||||||
script = ExtResource("10_vuxiy")
|
script = ExtResource("10_vuxiy")
|
||||||
|
tv_remote = NodePath("../AnimationProps/TVRemote")
|
||||||
|
|
||||||
[node name="AnimationProps" type="Node2D" parent="."]
|
[node name="AnimationProps" type="Node2D" parent="."]
|
||||||
|
visible = false
|
||||||
|
script = ExtResource("12_4fc0x")
|
||||||
|
|
||||||
[node name="TVRemote" type="AnimatedSprite2D" parent="AnimationProps"]
|
[node name="TVRemote" type="AnimatedSprite2D" parent="AnimationProps"]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
@ -532,5 +536,6 @@ script = ExtResource("18_x1jr7")
|
||||||
|
|
||||||
[connection signal="area_entered" from="Player/hitbox" to="Player" method="_on_hitbox_area_entered"]
|
[connection signal="area_entered" from="Player/hitbox" to="Player" method="_on_hitbox_area_entered"]
|
||||||
[connection signal="area_entered" from="TheBitWhereYouTrip" to="TripAnimation" method="_on_the_bit_where_you_trip_area_entered"]
|
[connection signal="area_entered" from="TheBitWhereYouTrip" to="TripAnimation" method="_on_the_bit_where_you_trip_area_entered"]
|
||||||
|
[connection signal="area_entered" from="TheBitWhereYouTrip" to="AnimationProps" method="_on_the_bit_where_you_trip_area_entered"]
|
||||||
[connection signal="area_entered" from="BrokenRemote" to="AnimationProps/TVRemote" method="_on_broken_remote_area_entered"]
|
[connection signal="area_entered" from="BrokenRemote" to="AnimationProps/TVRemote" method="_on_broken_remote_area_entered"]
|
||||||
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
extends AnimationPlayer
|
extends AnimationPlayer
|
||||||
|
|
||||||
|
@export var tv_remote :Node2D
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
pass # Replace with function body.
|
stop()
|
||||||
|
#tv_remote.hide()
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
|
@ -12,4 +14,5 @@ func _process(delta: float) -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_the_bit_where_you_trip_area_entered(area: Area2D) -> void:
|
func _on_the_bit_where_you_trip_area_entered(area: Area2D) -> void:
|
||||||
|
#tv_remote.show()
|
||||||
play("trip")
|
play("trip")
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ extends AnimatedSprite2D
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
pass # Replace with function body.
|
hide()
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
|
@ -15,4 +15,5 @@ func _process(delta: float) -> void:
|
||||||
|
|
||||||
|
|
||||||
func _on_broken_remote_area_entered(area: Area2D) -> void:
|
func _on_broken_remote_area_entered(area: Area2D) -> void:
|
||||||
|
if(area.get_parent().name == "Player"): # i knew this would happen
|
||||||
queue_free()
|
queue_free()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue