develop #34
@ -17,7 +17,7 @@ region = Rect2( 18, 0, 18, 18 )
|
||||
animations = [ {
|
||||
"frames": [ SubResource( 2 ), SubResource( 3 ) ],
|
||||
"loop": true,
|
||||
"name": "default",
|
||||
"name": "spin",
|
||||
"speed": 5.0
|
||||
} ]
|
||||
|
||||
@ -30,6 +30,6 @@ shape = SubResource( 1 )
|
||||
|
||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
||||
frames = SubResource( 4 )
|
||||
frame = 1
|
||||
animation = "spin"
|
||||
playing = true
|
||||
centered = false
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "player/states/CoinNotCollected.h"
|
||||
#include "Coin/CoinNotCollected.h"
|
||||
|
||||
using namespace godot;
|
||||
|
||||
@ -25,15 +25,17 @@ void CoinNotCollected::_init()
|
||||
void CoinNotCollected::_state_enter()
|
||||
{
|
||||
animated_sprite = get_parent()->get_node<AnimatedSprite>("AnimatedSprite");
|
||||
animated_sprite->stop();
|
||||
animated_sprite->set_animation("idle");
|
||||
animated_sprite->set_animation("spin");
|
||||
animated_sprite->play();
|
||||
}
|
||||
|
||||
void CoinNotCollected::_state_exit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CoinNotCollected::_physics_process(float delta)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifndef JUEGO_COIN_COINNOTCOLLECTED
|
||||
#define JJUEGO_COIN_COINNOTCOLLECTED
|
||||
#define JUEGO_COIN_COINNOTCOLLECTED
|
||||
|
||||
#include "state_machine/State.h"
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "player/states/PlayerMove.h"
|
||||
#include "player/states/PlayerJump.h"
|
||||
#include "player/states/PlayerFall.h"
|
||||
#include "Coin/CoinNotCollected.h"
|
||||
|
||||
using namespace godot;
|
||||
|
||||
@ -49,4 +50,5 @@ extern "C" void GDN_EXPORT godot_nativescript_init(void *handle)
|
||||
register_class<player::PlayerMove>();
|
||||
register_class<player::PlayerJump>();
|
||||
register_class<player::PlayerFall>();
|
||||
register_class<coin::CoinNotCollected>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user