develop #34

Merged
cromer merged 36 commits from develop into master 2022-08-28 01:13:46 -04:00
4 changed files with 11 additions and 7 deletions
Showing only changes of commit 5fe9e3340a - Show all commits

View File

@ -17,7 +17,7 @@ region = Rect2( 18, 0, 18, 18 )
animations = [ { animations = [ {
"frames": [ SubResource( 2 ), SubResource( 3 ) ], "frames": [ SubResource( 2 ), SubResource( 3 ) ],
"loop": true, "loop": true,
"name": "default", "name": "spin",
"speed": 5.0 "speed": 5.0
} ] } ]
@ -30,6 +30,6 @@ shape = SubResource( 1 )
[node name="AnimatedSprite" type="AnimatedSprite" parent="."] [node name="AnimatedSprite" type="AnimatedSprite" parent="."]
frames = SubResource( 4 ) frames = SubResource( 4 )
frame = 1 animation = "spin"
playing = true playing = true
centered = false centered = false

View File

@ -1,4 +1,4 @@
#include "player/states/CoinNotCollected.h" #include "Coin/CoinNotCollected.h"
using namespace godot; using namespace godot;
@ -25,15 +25,17 @@ void CoinNotCollected::_init()
void CoinNotCollected::_state_enter() void CoinNotCollected::_state_enter()
{ {
animated_sprite = get_parent()->get_node<AnimatedSprite>("AnimatedSprite"); animated_sprite = get_parent()->get_node<AnimatedSprite>("AnimatedSprite");
animated_sprite->stop(); animated_sprite->set_animation("spin");
animated_sprite->set_animation("idle"); animated_sprite->play();
} }
void CoinNotCollected::_state_exit() void CoinNotCollected::_state_exit()
{ {
} }
void CoinNotCollected::_physics_process(float delta) void CoinNotCollected::_physics_process(float delta)
{ {
} }

View File

@ -1,5 +1,5 @@
#ifndef JUEGO_COIN_COINNOTCOLLECTED #ifndef JUEGO_COIN_COINNOTCOLLECTED
#define JJUEGO_COIN_COINNOTCOLLECTED #define JUEGO_COIN_COINNOTCOLLECTED
#include "state_machine/State.h" #include "state_machine/State.h"

View File

@ -9,6 +9,7 @@
#include "player/states/PlayerMove.h" #include "player/states/PlayerMove.h"
#include "player/states/PlayerJump.h" #include "player/states/PlayerJump.h"
#include "player/states/PlayerFall.h" #include "player/states/PlayerFall.h"
#include "Coin/CoinNotCollected.h"
using namespace godot; using namespace godot;
@ -49,4 +50,5 @@ extern "C" void GDN_EXPORT godot_nativescript_init(void *handle)
register_class<player::PlayerMove>(); register_class<player::PlayerMove>();
register_class<player::PlayerJump>(); register_class<player::PlayerJump>();
register_class<player::PlayerFall>(); register_class<player::PlayerFall>();
register_class<coin::CoinNotCollected>();
} }