designed map

This commit is contained in:
2024-02-10 16:06:37 -06:00
parent 67e25c6392
commit 8aaedae7c3
8 changed files with 83 additions and 18 deletions

1
scripts/chest.gd Normal file
View File

@@ -0,0 +1 @@
extends StaticBody2D

17
scripts/player.gd Normal file
View File

@@ -0,0 +1,17 @@
extends CharacterBody2D
class_name Player
@export var speed = 100
func _physics_process(delta: float) -> void:
velocity = Vector2.ZERO
if Input.is_action_pressed("ui_down"):
velocity += Vector2.DOWN
if Input.is_action_pressed("ui_up"):
velocity += Vector2.UP
if Input.is_action_pressed("ui_left"):
velocity += Vector2.LEFT
if Input.is_action_pressed("ui_right"):
velocity += Vector2.RIGHT
velocity = velocity.normalized() * speed
move_and_slide()