rounded jumping spider sprite global position
This commit is contained in:
parent
e79f0fff40
commit
6ec28bfae1
3 changed files with 34 additions and 20 deletions
File diff suppressed because one or more lines are too long
|
@ -24,6 +24,8 @@ func _physics_process(delta):
|
||||||
if position.x <= startpos.x + (-left_boundary * 8):
|
if position.x <= startpos.x + (-left_boundary * 8):
|
||||||
direction = 1
|
direction = 1
|
||||||
if flip_sprite == true: sprite.scale.x = 1
|
if flip_sprite == true: sprite.scale.x = 1
|
||||||
|
#Round sprite position
|
||||||
|
sprite.global_position.x = round(sprite.global_position.x)
|
||||||
|
|
||||||
|
|
||||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||||
|
|
|
@ -99,6 +99,7 @@ region_enabled = true
|
||||||
region_rect = Rect2( 0, 0, 13, 12 )
|
region_rect = Rect2( 0, 0, 13, 12 )
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
playback_process_mode = 0
|
||||||
anims/idle = SubResource( 1 )
|
anims/idle = SubResource( 1 )
|
||||||
anims/jump = SubResource( 2 )
|
anims/jump = SubResource( 2 )
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue