Movement Implemented + Map
This commit is contained in:
parent
bf0b325a81
commit
d31d027b80
12 changed files with 227 additions and 0 deletions
4
scripts/menu.gd
Normal file
4
scripts/menu.gd
Normal file
|
@ -0,0 +1,4 @@
|
|||
extends Node
|
||||
|
||||
func _on_pressed():
|
||||
get_tree().change_scene_to_file("res://scenes/test/map.tscn")
|
11
scripts/player.gd
Normal file
11
scripts/player.gd
Normal file
|
@ -0,0 +1,11 @@
|
|||
extends CharacterBody2D
|
||||
|
||||
@export var speed = 200
|
||||
|
||||
func get_input():
|
||||
var input_direction = Input.get_vector("left", "right", "up", "down")
|
||||
velocity = input_direction * speed
|
||||
|
||||
func _physics_process(delta):
|
||||
get_input()
|
||||
move_and_slide()
|
Loading…
Add table
Add a link
Reference in a new issue