initial commit
This commit is contained in:
19
actors/Player.tscn
Normal file
19
actors/Player.tscn
Normal file
@@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://dbhvgmsk2yrdf"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c7smc4lka66qr" path="res://actors/player.gd" id="1_jx5ha"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_dk4ny"]
|
||||
size = Vector2(16, 16)
|
||||
|
||||
[sub_resource type="PlaceholderTexture2D" id="PlaceholderTexture2D_dk4ny"]
|
||||
|
||||
[node name="Player" type="CharacterBody2D"]
|
||||
script = ExtResource("1_jx5ha")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2(0.45451355, -0.27270508)
|
||||
shape = SubResource("RectangleShape2D_dk4ny")
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
scale = Vector2(16, 16)
|
||||
texture = SubResource("PlaceholderTexture2D_dk4ny")
|
||||
11
actors/player.gd
Normal file
11
actors/player.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends CharacterBody2D
|
||||
|
||||
@export var speed = 100
|
||||
|
||||
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()
|
||||
1
actors/player.gd.uid
Normal file
1
actors/player.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c7smc4lka66qr
|
||||
Reference in New Issue
Block a user