Compare commits
2 Commits
f4e4de59f5
...
b0c7c3d3ff
| Author | SHA1 | Date |
|---|---|---|
|
|
b0c7c3d3ff | |
|
|
ffbbfd455e |
|
|
@ -35,6 +35,7 @@ window/stretch/scale_mode="integer"
|
||||||
|
|
||||||
2d_physics/layer_1="Map"
|
2d_physics/layer_1="Map"
|
||||||
2d_physics/layer_2="Player"
|
2d_physics/layer_2="Player"
|
||||||
|
2d_physics/layer_3="NPCs"
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,131 @@
|
||||||
|
[gd_scene load_steps=20 format=3 uid="uid://bjlob58yvst7u"]
|
||||||
|
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d3e5mg0gk8u7r" path="res://scenes/game/maps/entities/mob.tscn" id="1_nvsti"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://byx166hd5b3as" path="res://gfx/game/maps/entities/player/Idle/Untitled-0_0.png" id="2_vclwd"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://gm5dhmls0klm" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_0.png" id="3_muq5y"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cio1xyswbao5j" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_0.png" id="4_mqjq0"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://svg30tifp74r" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_0.png" id="5_sh7wu"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://puqpn3m0ejv1" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_0.png" id="6_7u5it"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bel7ltrdmhvx3" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_1.png" id="7_ii2o2"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bvallk0cswtnq" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_2.png" id="8_cndau"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b4ptv7ts0nlhu" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_3.png" id="9_l7rxc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ddw1m0c2pby4c" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_1.png" id="10_nr0px"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://brsuvqye8vfji" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_2.png" id="11_kyfvt"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cnnbbvgvnprqv" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_3.png" id="12_isd5t"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://by38ifhhoq0iv" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_1.png" id="13_it0yr"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cooxpasywe0a6" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_2.png" id="14_mw6f8"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://byqc5gd0r2ija" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_3.png" id="15_55gq8"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://vu0jihe8b75u" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_1.png" id="16_c8g65"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cpw3bdg07t8s7" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_2.png" id="17_8tifw"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b2068kd1mmpsh" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_3.png" id="18_jpsqg"]
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_vu83q"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("2_vclwd")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Down",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3_muq5y")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Left",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4_mqjq0")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("5_sh7wu")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Up",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("6_7u5it")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("7_ii2o2")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("8_cndau")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("9_l7rxc")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Down",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3_muq5y")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("10_nr0px")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("11_kyfvt")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("12_isd5t")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Left",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4_mqjq0")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("13_it0yr")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("14_mw6f8")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("15_55gq8")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("5_sh7wu")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("16_c8g65")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("17_8tifw")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("18_jpsqg")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Up",
|
||||||
|
"speed": 5.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[node name="Guard" instance=ExtResource("1_nvsti")]
|
||||||
|
health = 120
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" parent="." index="0"]
|
||||||
|
modulate = Color(0.591513, 0.809975, 1, 1)
|
||||||
|
sprite_frames = SubResource("SpriteFrames_vu83q")
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=21 format=3 uid="uid://d3e5mg0gk8u7r"]
|
[gd_scene load_steps=23 format=3 uid="uid://d3e5mg0gk8u7r"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://byx166hd5b3as" path="res://gfx/game/maps/entities/player/Idle/Untitled-0_0.png" id="1_li2a0"]
|
[ext_resource type="Texture2D" uid="uid://byx166hd5b3as" path="res://gfx/game/maps/entities/player/Idle/Untitled-0_0.png" id="1_li2a0"]
|
||||||
[ext_resource type="Script" uid="uid://bo0had2vq4r7h" path="res://scripts/game/maps/entities/mob.gd" id="1_mu6cs"]
|
[ext_resource type="Script" uid="uid://bo0had2vq4r7h" path="res://scripts/game/maps/entities/mob.gd" id="1_mu6cs"]
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
[ext_resource type="Texture2D" uid="uid://b2068kd1mmpsh" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_3.png" id="17_7e337"]
|
[ext_resource type="Texture2D" uid="uid://b2068kd1mmpsh" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_3.png" id="17_7e337"]
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="SpriteFrames_5m0ve"]
|
[sub_resource type="SpriteFrames" id="SpriteFrames_5m0ve"]
|
||||||
|
resource_local_to_scene = true
|
||||||
animations = [{
|
animations = [{
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
|
|
@ -125,29 +126,53 @@ animations = [{
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mu6cs"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mu6cs"]
|
||||||
size = Vector2(4, 4)
|
size = Vector2(4, 4)
|
||||||
|
|
||||||
[node name="Mob" type="Node2D" node_paths=PackedStringArray("animator", "collisionRay_1", "collisionRay_2")]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tvinw"]
|
||||||
|
size = Vector2(16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_mu6cs"]
|
||||||
|
radius = 8.0
|
||||||
|
|
||||||
|
[node name="Mob" type="Node2D" node_paths=PackedStringArray("animator", "collisionRay_1", "collisionRay_2", "speechCollider")]
|
||||||
script = ExtResource("1_mu6cs")
|
script = ExtResource("1_mu6cs")
|
||||||
animator = NodePath("AnimatedSprite2D")
|
animator = NodePath("AnimatedSprite2D")
|
||||||
collisionRay_1 = NodePath("CollisionRayCast_1")
|
collisionRay_1 = NodePath("CollisionRayCast_1")
|
||||||
collisionRay_2 = NodePath("CollisionRayCast_2")
|
collisionRay_2 = NodePath("CollisionRayCast_2")
|
||||||
|
speechCollider = NodePath("SpeachRadius")
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
position = Vector2(8, 8)
|
position = Vector2(8, 8)
|
||||||
sprite_frames = SubResource("SpriteFrames_5m0ve")
|
sprite_frames = SubResource("SpriteFrames_5m0ve")
|
||||||
animation = &"Walk Up"
|
animation = &"Idle Down"
|
||||||
frame = 3
|
|
||||||
frame_progress = 0.497982
|
|
||||||
|
|
||||||
[node name="CollisionRayCast_1" type="RayCast2D" parent="."]
|
[node name="CollisionRayCast_1" type="RayCast2D" parent="."]
|
||||||
position = Vector2(8, 8)
|
position = Vector2(8, 8)
|
||||||
target_position = Vector2(0, 16)
|
target_position = Vector2(0, 16)
|
||||||
|
collision_mask = 5
|
||||||
|
|
||||||
[node name="CollisionRayCast_2" type="RayCast2D" parent="."]
|
[node name="CollisionRayCast_2" type="RayCast2D" parent="."]
|
||||||
position = Vector2(8, 8)
|
position = Vector2(8, 8)
|
||||||
target_position = Vector2(0, 16)
|
target_position = Vector2(0, 16)
|
||||||
|
collision_mask = 5
|
||||||
|
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
[node name="MapTriggerCollider" type="Area2D" parent="."]
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="MapTriggerCollider"]
|
||||||
position = Vector2(8, 8)
|
position = Vector2(8, 8)
|
||||||
shape = SubResource("RectangleShape2D_mu6cs")
|
shape = SubResource("RectangleShape2D_mu6cs")
|
||||||
|
|
||||||
|
[node name="Collider" type="RigidBody2D" parent="."]
|
||||||
|
collision_layer = 6
|
||||||
|
collision_mask = 6
|
||||||
|
freeze = true
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Collider"]
|
||||||
|
position = Vector2(8, 8)
|
||||||
|
shape = SubResource("RectangleShape2D_tvinw")
|
||||||
|
|
||||||
|
[node name="SpeachRadius" type="Area2D" parent="."]
|
||||||
|
collision_layer = 4
|
||||||
|
collision_mask = 2
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="SpeachRadius"]
|
||||||
|
position = Vector2(8, 8)
|
||||||
|
shape = SubResource("CircleShape2D_mu6cs")
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,142 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://bpsrg5d3gncnd"]
|
[gd_scene load_steps=21 format=3 uid="uid://bpsrg5d3gncnd"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://d3e5mg0gk8u7r" path="res://scenes/game/maps/entities/mob.tscn" id="1_7y2qh"]
|
[ext_resource type="PackedScene" uid="uid://d3e5mg0gk8u7r" path="res://scenes/game/maps/entities/mob.tscn" id="1_7y2qh"]
|
||||||
[ext_resource type="Script" uid="uid://dsguwthn2datq" path="res://scripts/game/maps/entities/Player.gd" id="2_us7jc"]
|
[ext_resource type="Script" uid="uid://dsguwthn2datq" path="res://scripts/game/maps/entities/Player.gd" id="2_us7jc"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://byx166hd5b3as" path="res://gfx/game/maps/entities/player/Idle/Untitled-0_0.png" id="3_eoasd"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://gm5dhmls0klm" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_0.png" id="4_k00a3"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cio1xyswbao5j" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_0.png" id="5_gge1o"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://svg30tifp74r" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_0.png" id="6_v7ihw"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://puqpn3m0ejv1" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_0.png" id="7_is0ql"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bel7ltrdmhvx3" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_1.png" id="8_dohvn"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bvallk0cswtnq" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_2.png" id="9_eaely"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b4ptv7ts0nlhu" path="res://gfx/game/maps/entities/player/WalkDown/Untitled-2_3.png" id="10_m3m4g"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ddw1m0c2pby4c" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_1.png" id="11_uyvca"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://brsuvqye8vfji" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_2.png" id="12_abfb4"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cnnbbvgvnprqv" path="res://gfx/game/maps/entities/player/WalkLeft/Untitled-3_3.png" id="13_n3xhi"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://by38ifhhoq0iv" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_1.png" id="14_7vmje"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cooxpasywe0a6" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_2.png" id="15_ukkhw"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://byqc5gd0r2ija" path="res://gfx/game/maps/entities/player/WalkRight/Untitled-3_3.png" id="16_2rl3s"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://vu0jihe8b75u" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_1.png" id="17_5okdn"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cpw3bdg07t8s7" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_2.png" id="18_pledg"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b2068kd1mmpsh" path="res://gfx/game/maps/entities/player/WalkUp/Untitled-2_3.png" id="19_y2pg7"]
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_wyylp"]
|
||||||
|
resource_local_to_scene = true
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3_eoasd")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Down",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4_k00a3")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Left",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("5_gge1o")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("6_v7ihw")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Idle Up",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("7_is0ql")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("8_dohvn")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("9_eaely")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("10_m3m4g")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Down",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4_k00a3")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("11_uyvca")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("12_abfb4")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("13_n3xhi")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Left",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("5_gge1o")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("14_7vmje")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("15_ukkhw")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("16_2rl3s")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("6_v7ihw")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("17_5okdn")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("18_pledg")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("19_y2pg7")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"Walk Up",
|
||||||
|
"speed": 5.0
|
||||||
|
}]
|
||||||
|
|
||||||
[node name="Player" node_paths=PackedStringArray("camera") instance=ExtResource("1_7y2qh")]
|
[node name="Player" node_paths=PackedStringArray("camera") instance=ExtResource("1_7y2qh")]
|
||||||
script = ExtResource("2_us7jc")
|
script = ExtResource("2_us7jc")
|
||||||
camera = NodePath("Camera2D")
|
camera = NodePath("Camera2D")
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" parent="." index="0"]
|
||||||
|
sprite_frames = SubResource("SpriteFrames_wyylp")
|
||||||
|
|
||||||
[node name="Camera2D" type="Camera2D" parent="." index="3"]
|
[node name="Camera2D" type="Camera2D" parent="." index="3"]
|
||||||
zoom = Vector2(2, 2)
|
zoom = Vector2(2, 2)
|
||||||
|
|
||||||
|
[node name="MapTriggerCollider" parent="." index="4"]
|
||||||
|
collision_layer = 3
|
||||||
|
|
||||||
|
[node name="SpeachRadius" parent="." index="6"]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 4
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
[gd_scene load_steps=3 format=3 uid="uid://864h4oam7qfk"]
|
[gd_scene load_steps=2 format=3 uid="uid://864h4oam7qfk"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://c50fmagffbdas" path="res://scripts/game/maps/entities/ToggleRoofTrigger.gd" id="1_58sfy"]
|
[ext_resource type="Script" uid="uid://c50fmagffbdas" path="res://scripts/game/maps/entities/ToggleRoofTrigger.gd" id="1_58sfy"]
|
||||||
|
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_58sfy"]
|
|
||||||
size = Vector2(48, 16)
|
|
||||||
|
|
||||||
[node name="ToggleRoofTrigger" type="Area2D"]
|
[node name="ToggleRoofTrigger" type="Area2D"]
|
||||||
script = ExtResource("1_58sfy")
|
script = ExtResource("1_58sfy")
|
||||||
metadata/_custom_type_script = "uid://c50fmagffbdas"
|
metadata/_custom_type_script = "uid://c50fmagffbdas"
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
[node name="CollisionShape2D" type="CollisionPolygon2D" parent="."]
|
||||||
position = Vector2(8, 8)
|
|
||||||
shape = SubResource("RectangleShape2D_58sfy")
|
|
||||||
|
|
||||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,8 +1,9 @@
|
||||||
[gd_scene load_steps=4 format=3 uid="uid://cspwqlbaoldqe"]
|
[gd_scene load_steps=5 format=3 uid="uid://cspwqlbaoldqe"]
|
||||||
|
|
||||||
[ext_resource type="TileSet" uid="uid://c21smbsro4gdq" path="res://tilesets/default.tres" id="1_wjcuv"]
|
[ext_resource type="TileSet" uid="uid://c21smbsro4gdq" path="res://tilesets/default.tres" id="1_wjcuv"]
|
||||||
[ext_resource type="Script" uid="uid://bbrwrbwsxt32g" path="res://scripts/game/maps/WorldMap.gd" id="2_yhw3p"]
|
[ext_resource type="Script" uid="uid://bbrwrbwsxt32g" path="res://scripts/game/maps/WorldMap.gd" id="2_yhw3p"]
|
||||||
[ext_resource type="PackedScene" uid="uid://jdrco447avx6" path="res://scenes/game/maps/entities/change_map_trigger.tscn" id="3_1qy6k"]
|
[ext_resource type="PackedScene" uid="uid://jdrco447avx6" path="res://scenes/game/maps/entities/change_map_trigger.tscn" id="3_1qy6k"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d3e5mg0gk8u7r" path="res://scenes/game/maps/entities/mob.tscn" id="4_suym0"]
|
||||||
|
|
||||||
[node name="World Map" type="TileMap"]
|
[node name="World Map" type="TileMap"]
|
||||||
tile_set = ExtResource("1_wjcuv")
|
tile_set = ExtResource("1_wjcuv")
|
||||||
|
|
@ -18,3 +19,6 @@ stepIncrement = 0.5
|
||||||
position = Vector2(592, 240)
|
position = Vector2(592, 240)
|
||||||
map = "uid://dq38dmxq6tmtb"
|
map = "uid://dq38dmxq6tmtb"
|
||||||
spawnpoint = Vector2i(0, 15)
|
spawnpoint = Vector2i(0, 15)
|
||||||
|
|
||||||
|
[node name="Mob" parent="Entities" instance=ExtResource("4_suym0")]
|
||||||
|
position = Vector2(576, 208)
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,11 @@ layout_mode = 2
|
||||||
theme_override_fonts/font = ExtResource("6_2yu03")
|
theme_override_fonts/font = ExtResource("6_2yu03")
|
||||||
text = "Pass"
|
text = "Pass"
|
||||||
|
|
||||||
|
[node name="Speak Buton" type="Button" parent="UI/Left Display/Contents/Command Menu"]
|
||||||
|
layout_mode = 2
|
||||||
|
theme_override_fonts/font = ExtResource("6_2yu03")
|
||||||
|
text = "Speak"
|
||||||
|
|
||||||
[node name="Message Console" type="MarginContainer" parent="UI" node_paths=PackedStringArray("scrollContainer", "messages")]
|
[node name="Message Console" type="MarginContainer" parent="UI" node_paths=PackedStringArray("scrollContainer", "messages")]
|
||||||
layout_mode = 0
|
layout_mode = 0
|
||||||
offset_left = 13.0
|
offset_left = 13.0
|
||||||
|
|
@ -136,3 +141,4 @@ position = Vector2(26, 0)
|
||||||
[connection signal="BROADCAST_COMMAND" from="Command Processor" to="UI/Message Console" method="_on_command"]
|
[connection signal="BROADCAST_COMMAND" from="Command Processor" to="UI/Message Console" method="_on_command"]
|
||||||
[connection signal="timeout" from="Command Processor" to="Command Processor" method="_on_timeout"]
|
[connection signal="timeout" from="Command Processor" to="Command Processor" method="_on_timeout"]
|
||||||
[connection signal="pressed" from="UI/Left Display/Contents/Command Menu/Pass Button" to="UI" method="_on_pass_button_pressed"]
|
[connection signal="pressed" from="UI/Left Display/Contents/Command Menu/Pass Button" to="UI" method="_on_pass_button_pressed"]
|
||||||
|
[connection signal="pressed" from="UI/Left Display/Contents/Command Menu/Speak Buton" to="UI" method="_on_speak_button_pressed"]
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ signal PAUSE_PROCESSOR
|
||||||
|
|
||||||
# Game Signals
|
# Game Signals
|
||||||
signal PLAYER_MOVE(direction)
|
signal PLAYER_MOVE(direction)
|
||||||
|
signal PLAYER_SPEAK
|
||||||
|
|
||||||
# Message Console Signals
|
# Message Console Signals
|
||||||
signal DISPLAY_MESSAGE(message)
|
signal DISPLAY_MESSAGE(message)
|
||||||
|
|
@ -16,4 +17,4 @@ signal DISPLAY_CLEAR
|
||||||
signal LOAD_MAP(currentMap, newMapPath, spawnpoint, facing)
|
signal LOAD_MAP(currentMap, newMapPath, spawnpoint, facing)
|
||||||
signal LOAD_COMPLETE
|
signal LOAD_COMPLETE
|
||||||
|
|
||||||
signal TOGGLE_TILEMAP_LAYER(layerName)
|
signal TOGGLE_TILEMAP_LAYER(layerName, visible)
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,4 @@ func _init():
|
||||||
|
|
||||||
|
|
||||||
func execute():
|
func execute():
|
||||||
print("Player passed.")
|
|
||||||
COMMAND_PROCESSED.emit(commandLabel)
|
COMMAND_PROCESSED.emit(commandLabel)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
extends Command
|
||||||
|
|
||||||
|
class_name SpeakCommand
|
||||||
|
|
||||||
|
func _init():
|
||||||
|
commandLabel = "Speak"
|
||||||
|
|
||||||
|
|
||||||
|
func execute():
|
||||||
|
CommandDispatcher.PLAYER_SPEAK.emit()
|
||||||
|
COMMAND_PROCESSED.emit(commandLabel)
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://cnpwcq7khum55
|
||||||
|
|
@ -12,6 +12,7 @@ var player
|
||||||
func _ready():
|
func _ready():
|
||||||
CommandDispatcher.PLAYER_MOVE.connect(onPlayerMove)
|
CommandDispatcher.PLAYER_MOVE.connect(onPlayerMove)
|
||||||
CommandDispatcher.TOGGLE_TILEMAP_LAYER.connect(onToggleRequest)
|
CommandDispatcher.TOGGLE_TILEMAP_LAYER.connect(onToggleRequest)
|
||||||
|
CommandDispatcher.PLAYER_SPEAK.connect(onSpeak)
|
||||||
|
|
||||||
|
|
||||||
@warning_ignore("unused_parameter")
|
@warning_ignore("unused_parameter")
|
||||||
|
|
@ -50,10 +51,20 @@ func playerCanMoveTo(newPosition) -> bool:
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
||||||
func onToggleRequest(layerName):
|
func onToggleRequest(layerName, visible):
|
||||||
for layer in range(get_layers_count()):
|
for layer in range(get_layers_count()):
|
||||||
if(get_layer_name(layer) == layerName):
|
if(get_layer_name(layer) == layerName):
|
||||||
if(is_layer_enabled(layer)):
|
set_layer_enabled(layer, visible)
|
||||||
set_layer_enabled(layer, false)
|
|
||||||
|
|
||||||
|
func onSpeak():
|
||||||
|
var interactables:Array = player.speechCollider.get_overlapping_areas()
|
||||||
|
|
||||||
|
if (interactables.size() > 0):
|
||||||
|
for interactable in interactables:
|
||||||
|
interactable.get_parent().interact()
|
||||||
else:
|
else:
|
||||||
set_layer_enabled(layer, true)
|
CommandDispatcher.DISPLAY_MESSAGE.emit("There is no one to speak to.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,20 @@ extends Map2d
|
||||||
|
|
||||||
class_name WorldMap
|
class_name WorldMap
|
||||||
|
|
||||||
func playerCanMoveTo(position:Vector2) -> bool:
|
func playerCanMoveTo(newPosition:Vector2) -> bool:
|
||||||
var tilesize = tile_set.tile_size.x
|
|
||||||
var cast_cell_1
|
var cast_cell_1
|
||||||
var cast_cell_2
|
var cast_cell_2
|
||||||
|
|
||||||
player.updateRaycasts(position)
|
player.updateRaycasts(newPosition)
|
||||||
|
|
||||||
cast_cell_1 = local_to_map(position + player.collisionRay_1.position)
|
cast_cell_1 = local_to_map(newPosition + player.collisionRay_1.position)
|
||||||
cast_cell_2 = local_to_map(position + player.collisionRay_2.position)
|
cast_cell_2 = local_to_map(newPosition + player.collisionRay_2.position)
|
||||||
|
|
||||||
if (getTerrainDataForTile(0, TerrainDataTypes.TerrainType, cast_cell_1.x, cast_cell_1.y) != "Water" and
|
if (getTerrainDataForTile(0, TerrainDataTypes.TerrainType, cast_cell_1.x, cast_cell_1.y) != "Water" and
|
||||||
getTerrainDataForTile(0, TerrainDataTypes.TerrainType, cast_cell_2.x, cast_cell_2.y) != "Water"):
|
getTerrainDataForTile(0, TerrainDataTypes.TerrainType, cast_cell_2.x, cast_cell_2.y) != "Water"):
|
||||||
|
|
||||||
|
if (player.wouldCollideAt(newPosition)):
|
||||||
|
return false
|
||||||
return true
|
return true
|
||||||
else:
|
else:
|
||||||
CommandDispatcher.DISPLAY_MESSAGE.emit("Your path is blocked.")
|
CommandDispatcher.DISPLAY_MESSAGE.emit("Your path is blocked.")
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,11 @@ extends Mob
|
||||||
class_name Player
|
class_name Player
|
||||||
|
|
||||||
@export var camera:Camera2D
|
@export var camera:Camera2D
|
||||||
|
|
||||||
|
|
||||||
|
func wouldCollideAt(destination):
|
||||||
|
if (super.wouldCollideAt(destination)):
|
||||||
|
#CommandDispatcher.DISPLAY_MESSAGE.emit("Your path is blocked.")
|
||||||
|
return true
|
||||||
|
else:
|
||||||
|
return false
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,14 @@ class_name ToggleRoofTrigger
|
||||||
@export var layerName:String
|
@export var layerName:String
|
||||||
|
|
||||||
func execute(target):
|
func execute(target):
|
||||||
CommandDispatcher.TOGGLE_TILEMAP_LAYER.emit(layerName)
|
pass
|
||||||
|
|
||||||
|
|
||||||
func _on_area_entered(area: Area2D) -> void:
|
func _on_area_entered(area: Area2D) -> void:
|
||||||
execute(area.get_parent())
|
CommandDispatcher.TOGGLE_TILEMAP_LAYER.emit(layerName, false)
|
||||||
|
print("entered")
|
||||||
|
|
||||||
|
|
||||||
|
func _on_area_exited(area: Area2D) -> void:
|
||||||
|
CommandDispatcher.TOGGLE_TILEMAP_LAYER.emit(layerName, true)
|
||||||
|
print("exited")
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,15 @@ extends Node2D
|
||||||
|
|
||||||
class_name Mob
|
class_name Mob
|
||||||
|
|
||||||
|
@export var health:int = 100
|
||||||
|
|
||||||
@export var animator:AnimatedSprite2D
|
@export var animator:AnimatedSprite2D
|
||||||
|
|
||||||
@export var collisionRay_1:RayCast2D
|
@export var collisionRay_1:RayCast2D
|
||||||
@export var collisionRay_2:RayCast2D
|
@export var collisionRay_2:RayCast2D
|
||||||
|
|
||||||
|
@export var speechCollider:Area2D
|
||||||
|
|
||||||
func updateRaycasts(destination):
|
func updateRaycasts(destination):
|
||||||
var direction = destination - position
|
var direction = destination - position
|
||||||
|
|
||||||
|
|
@ -77,6 +81,8 @@ func wouldCollideAt(destination):
|
||||||
updateRaycasts(destination)
|
updateRaycasts(destination)
|
||||||
|
|
||||||
if collisionRay_1.is_colliding() || collisionRay_2.is_colliding():
|
if collisionRay_1.is_colliding() || collisionRay_2.is_colliding():
|
||||||
CommandDispatcher.DISPLAY_MESSAGE.emit("Your path is blocked.")
|
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
func interact():
|
||||||
|
print("Player interacted with %s" % name)
|
||||||
|
|
|
||||||
|
|
@ -4,3 +4,7 @@ class_name UI
|
||||||
|
|
||||||
func _on_pass_button_pressed():
|
func _on_pass_button_pressed():
|
||||||
CommandDispatcher.PROCESS_COMMAND.emit(PassCommand.new())
|
CommandDispatcher.PROCESS_COMMAND.emit(PassCommand.new())
|
||||||
|
|
||||||
|
|
||||||
|
func _on_speak_button_pressed() -> void:
|
||||||
|
CommandDispatcher.PROCESS_COMMAND.emit(SpeakCommand.new())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue