tileset early implementation

This commit is contained in:
2024-08-23 09:20:55 +02:00
parent 47148e5213
commit c274d50a64
9 changed files with 5714 additions and 69 deletions

View File

@@ -0,0 +1,29 @@
extends CharacterBody2D
const SPEED = 600.0
const JUMP_VELOCITY = -400.0
func _physics_process(delta: float) -> void:
## Add the gravity.
#if not is_on_floor():
#velocity += get_gravity() * delta
#
## Handle jump.
#if Input.is_action_just_pressed("ui_accept") and is_on_floor():
#velocity.y = JUMP_VELOCITY
#
## Get the input direction and handle the movement/deceleration.
## As good practice, you should replace UI actions with custom gameplay actions.
#var direction := Input.get_axis("ui_left", "ui_right")
#if direction:
#velocity.x = direction * SPEED
#else:
#velocity.x = move_toward(velocity.x, 0, SPEED)
var input = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
velocity = input * SPEED
move_and_slide()

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3 uid="uid://y4bjooqhwliw"]
[ext_resource type="Script" path="res://objects/character/character.gd" id="1_vjo1u"]
[ext_resource type="Texture2D" uid="uid://bbplwgt4cpbyx" path="res://icon.svg" id="2_hpr8a"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0np4o"]
size = Vector2(116, 115)
[node name="Character" type="CharacterBody2D"]
position = Vector2(23, 327)
script = ExtResource("1_vjo1u")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_hpr8a")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -6)
shape = SubResource("RectangleShape2D_0np4o")
[node name="Camera2D" type="Camera2D" parent="."]