add player controller

This commit is contained in:
Gabriel Kaszewski
2024-12-22 00:17:17 +01:00
parent 1fddceec60
commit 4aacaa34bc
5 changed files with 130 additions and 20 deletions

31
objects/brick_player.tscn Normal file
View File

@@ -0,0 +1,31 @@
[gd_scene load_steps=6 format=3 uid="uid://bqi5s710xb1ju"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_8j4h4"]
[ext_resource type="Texture2D" uid="uid://b7gp0gqvkv8j4" path="res://sprites/MrBrick_base.png" id="2_bc55y"]
[ext_resource type="Texture2D" uid="uid://jl1gwqchhpdc" path="res://sprites/left_eye.png" id="3_2srrh"]
[ext_resource type="Texture2D" uid="uid://iiawtnwmeny3" path="res://sprites/right_eye.png" id="4_ccn81"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hdsg1"]
size = Vector2(16, 31)
[node name="Brick Player" type="CharacterBody2D"]
script = ExtResource("1_8j4h4")
[node name="Root" type="Node2D" parent="."]
[node name="Base" type="Sprite2D" parent="Root"]
texture = ExtResource("2_bc55y")
[node name="Left Eye" type="Sprite2D" parent="Root"]
position = Vector2(-7, -6)
texture = ExtResource("3_2srrh")
hframes = 2
[node name="Right Eye" type="Sprite2D" parent="Root"]
position = Vector2(6, -5)
texture = ExtResource("4_ccn81")
hframes = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 0.5)
shape = SubResource("RectangleShape2D_hdsg1")