Testwizardhalfcodes
Testwizardhalfcodes
if not is_on_floor():
# Handle jump.
velocity.y = JUMP_VELOCITY
# As good practice, you should replace UI actions with custom gameplay actions.
var run_multiplier = 1
if Input.is_action_pressed("run"):
run_multiplier = 2
else:
run_multiplier = 1
if direction:
else:
if velocity.x < 0:
$AnimatedSprite2D.flip_h = true
if velocity.x > 0:
$AnimatedSprite2D.flip_h = false
if velocity.x != 0:
$AnimatedSprite2D.play("walk")
else:
$AnimatedSprite2D.play("idle")
move_and_slide()
extends Node
var coins = 0
var score = 0
extends AnimatedSprite2D
# Called when the node enters the scene tree for the first time.
# Called every frame. 'delta' is the elapsed time since the previous frame.
pass
if body.is_in_group('Player'):
GameManager.coins += 1
GameManager.score += 100