Trying new stuff with the camera and grid. I want to be able to move a unit but there is a problem with the grid at the moment. I am now trying to implement a new way of handling the camera, maybe then I can move on to moving units...

This commit is contained in:
gdz
2025-12-15 02:20:03 +01:00
parent 4f9d5fc8bd
commit 67b6198412
17 changed files with 588 additions and 51 deletions

View File

@@ -0,0 +1,87 @@
[gd_scene load_steps=11 format=3 uid="uid://b1d6lktijxy3s"]
[ext_resource type="Script" uid="uid://c8ocnhejcdc77" path="res://unit.gd" id="1_astap"]
[ext_resource type="Texture2D" uid="uid://cgvyfsuri6vmx" path="res://Graphics/TileMaps/kenney_rpgUrbanKit/Tilemap/tilemap.png" id="2_fhoaw"]
[ext_resource type="Texture2D" uid="uid://dlaevn54qcvej" path="res://Graphics/TileMaps/kenney_rpgUrbanKit/Tiles/tile_0267.png" id="3_fhoaw"]
[sub_resource type="AtlasTexture" id="AtlasTexture_4o1a4"]
atlas = ExtResource("2_fhoaw")
region = Rect2(408, 51, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_hn0wa"]
atlas = ExtResource("2_fhoaw")
region = Rect2(408, 68, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jt11o"]
atlas = ExtResource("2_fhoaw")
region = Rect2(408, 85, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_e33ge"]
atlas = ExtResource("2_fhoaw")
region = Rect2(408, 68, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_px3ay"]
atlas = ExtResource("2_fhoaw")
region = Rect2(408, 85, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_6ceyn"]
atlas = ExtResource("2_fhoaw")
region = Rect2(34, 255, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_lgeeq"]
animations = [{
"frames": [],
"loop": true,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_4o1a4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hn0wa")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jt11o")
}],
"loop": true,
"name": &"down",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_e33ge")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_px3ay")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6ceyn")
}, {
"duration": 1.0,
"texture": null
}],
"loop": true,
"name": &"selected",
"speed": 5.0
}]
[node name="Unit" type="Path2D"]
script = ExtResource("1_astap")
[node name="PathFollow2D" type="PathFollow2D" parent="."]
rotates = false
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="PathFollow2D"]
visible = false
sprite_frames = SubResource("SpriteFrames_lgeeq")
animation = &"down"
[node name="Sprite2D" type="Sprite2D" parent="PathFollow2D"]
texture = ExtResource("3_fhoaw")