Added player character and initial interaction functionality

This commit is contained in:
2024-02-24 08:36:43 -06:00
parent 78c4291b6a
commit 5467e044a7
12 changed files with 557 additions and 46 deletions

49
scene/player.tscn Normal file
View File

@@ -0,0 +1,49 @@
[gd_scene load_steps=7 format=3 uid="uid://dkvcye4mhvshd"]
[ext_resource type="Script" path="res://scripts/player.gd" id="1_j0htm"]
[ext_resource type="Texture2D" uid="uid://n806c03hgaq1" path="res://assets/scifi_tilesheet@2.png" id="1_vqdy1"]
[sub_resource type="AtlasTexture" id="AtlasTexture_8yvc7"]
atlas = ExtResource("1_vqdy1")
region = Rect2(640, 192, 64, 64)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_jav3v"]
size = Vector2(40, 45)
[sub_resource type="Animation" id="Animation_47lv4"]
resource_name = "walk"
length = 1.2
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.2, 0.4, 0.6, 0.8, 1, 1.2),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
"update": 0,
"values": [Vector2(0, 0), Vector2(0, -1), Vector2(0, -2), Vector2(0, -1), Vector2(0, 0), Vector2(0, 1), Vector2(0, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_ditnu"]
_data = {
"walk": SubResource("Animation_47lv4")
}
[node name="Player" type="CharacterBody2D"]
motion_mode = 1
script = ExtResource("1_j0htm")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = SubResource("AtlasTexture_8yvc7")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_jav3v")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_ditnu")
}
[node name="Camera2D" type="Camera2D" parent="."]

View File

@@ -1,9 +1,8 @@
[gd_scene load_steps=13 format=3 uid="uid://m0us5xqa3gnk"]
[gd_scene load_steps=12 format=3 uid="uid://m0us5xqa3gnk"]
[ext_resource type="Script" path="res://scripts/world.gd" id="1_yf6q1"]
[ext_resource type="Resource" uid="uid://dr00rd4f42jqe" path="res://data/game_resources/gem_resource.tres" id="2_rn4a2"]
[ext_resource type="TileSet" uid="uid://d1sh6dy2w10b0" path="res://data/scifi_tileset.tres" id="2_sa7dm"]
[ext_resource type="Script" path="res://scripts/window.gd" id="3_bfjot"]
[ext_resource type="Resource" uid="uid://bpjj0x7jr1k6u" path="res://data/game_resources/carbon_resource.tres" id="3_pq6ic"]
[ext_resource type="Script" path="res://scripts/building_manager.gd" id="4_61js3"]
[ext_resource type="Script" path="res://scripts/resource_manager.gd" id="5_k5643"]
@@ -39,12 +38,6 @@ layer_3/tile_data = PackedInt32Array()
layer_4/name = "buildings"
layer_4/tile_data = PackedInt32Array()
[node name="Camera2D" type="Camera2D" parent="."]
zoom = Vector2(0.3, 0.3)
drag_horizontal_enabled = true
drag_vertical_enabled = true
script = ExtResource("3_bfjot")
[node name="BuildingManager" type="Node2D" parent="."]
script = ExtResource("4_61js3")