File tree 2 files changed +6
-7
lines changed
examples/dodge-the-creeps/rust/src
2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,11 @@ enum MobType {
10
10
}
11
11
12
12
impl MobType {
13
- fn to_str ( self ) -> String {
13
+ fn to_str ( self ) -> GodotString {
14
14
match self {
15
- MobType :: Walk => "walk" . to_string ( ) ,
16
- MobType :: Swim => "swim" . to_string ( ) ,
17
- MobType :: Fly => "fly" . to_string ( ) ,
15
+ MobType :: Walk => "walk" . into ( ) ,
16
+ MobType :: Swim => "swim" . into ( ) ,
17
+ MobType :: Fly => "fly" . into ( ) ,
18
18
}
19
19
}
20
20
}
@@ -63,7 +63,6 @@ impl GodotExt for Mob {
63
63
let mut sprite = self
64
64
. base
65
65
. get_node_as :: < AnimatedSprite2D > ( "AnimatedSprite2D" ) ;
66
- sprite. set_animation ( animation_name. as_str ( ) . into ( ) ) ;
67
- sprite. set_playing ( true ) ;
66
+ sprite. set_animation ( StringName :: from ( & animation_name) ) ;
68
67
}
69
68
}
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ impl GodotExt for Player {
95
95
animated_sprite. set_flip_v ( velocity. y > 0.0 )
96
96
}
97
97
98
- animated_sprite. play ( animation. into ( ) , false ) ;
98
+ animated_sprite. play ( animation. into ( ) , 1.0 , false ) ;
99
99
} else {
100
100
animated_sprite. stop ( ) ;
101
101
}
You can’t perform that action at this time.
0 commit comments