While doing this post I’m learning how to write effectively on WordPress. Let’s try by adding an image below:
Ok now let’s try to add some code block
func play_animation():
if state == PlayerState.IDLE:
anim.play("idle")
elif state == PlayerState.RUNNING:
anim.play("running")
elif state == PlayerState.WALKING:
anim.play("walking")
elif state == PlayerState.JUMP_START:
anim.play("jump_start")
elif state == PlayerState.JUMP_END:
anim.play("jump_end")
elif state == PlayerState.JUMPING:
anim.play("jump_mid")
func _input(event: InputEvent) -> void:
if event.is_action_pressed("action") && GameManager.can_reverse:
anim.flip_h = !anim.flip_h
is_reversed = !is_reversed
if is_reversed:
up_direction = Vector2.DOWN
if !is_reversed:
up_direction = Vector2.UP
Debug.is_reversed = "Reversed: " + str(is_reversed)
left = !left
right = !right
gravity *= -1
JUMP_VELOCITY *= -1
position.y *= -1
rotation_degrees += 180