rounded jumping spider sprite global position

This commit is contained in:
pennyrigate 2023-01-25 21:13:34 -05:00
parent e79f0fff40
commit 6ec28bfae1
3 changed files with 34 additions and 20 deletions

View file

@ -24,6 +24,8 @@ func _physics_process(delta):
if position.x <= startpos.x + (-left_boundary * 8):
direction = 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):

View file

@ -99,6 +99,7 @@ region_enabled = true
region_rect = Rect2( 0, 0, 13, 12 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
playback_process_mode = 0
anims/idle = SubResource( 1 )
anims/jump = SubResource( 2 )