badguys, autoloads, custom resources, collectibles
This commit is contained in:
parent
b3575f2f06
commit
8bb10b79a8
BIN
januaryproject/assets/graphics/collectibles/coin.png
Normal file
BIN
januaryproject/assets/graphics/collectibles/coin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 500 B |
34
januaryproject/assets/graphics/collectibles/coin.png.import
Normal file
34
januaryproject/assets/graphics/collectibles/coin.png.import
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://v8pdxg1bj3nd"
|
||||||
|
path="res://.godot/imported/coin.png-20c0ec177f21de2ef8f2f0e70fa6fe8a.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/graphics/collectibles/coin.png"
|
||||||
|
dest_files=["res://.godot/imported/coin.png-20c0ec177f21de2ef8f2f0e70fa6fe8a.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
BIN
januaryproject/assets/graphics/enemies/slime_green.png
Normal file
BIN
januaryproject/assets/graphics/enemies/slime_green.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 908 B |
@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://qfv8gwt1icm3"
|
||||||
|
path="res://.godot/imported/slime_green.png-5261ffd1254c816fe62b35227a9aa11d.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://assets/graphics/enemies/slime_green.png"
|
||||||
|
dest_files=["res://.godot/imported/slime_green.png-5261ffd1254c816fe62b35227a9aa11d.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
@ -15,6 +15,10 @@ run/main_scene="res://scenes/game.tscn"
|
|||||||
config/features=PackedStringArray("4.3", "Forward Plus")
|
config/features=PackedStringArray("4.3", "Forward Plus")
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[autoload]
|
||||||
|
|
||||||
|
Gamecontroller="*res://scripts/gamecontroller.gd"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/size/viewport_width=320
|
window/size/viewport_width=320
|
||||||
|
73
januaryproject/scenes/badguy.tscn
Normal file
73
januaryproject/scenes/badguy.tscn
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
[gd_scene load_steps=9 format=3 uid="uid://dc3up6wvi521j"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/badguy.gd" id="1_xo5ex"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://qfv8gwt1icm3" path="res://assets/graphics/enemies/slime_green.png" id="2_j724m"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_vwjem"]
|
||||||
|
atlas = ExtResource("2_j724m")
|
||||||
|
region = Rect2(0, 24, 24, 24)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_skbek"]
|
||||||
|
atlas = ExtResource("2_j724m")
|
||||||
|
region = Rect2(24, 24, 24, 24)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_imgh0"]
|
||||||
|
atlas = ExtResource("2_j724m")
|
||||||
|
region = Rect2(48, 24, 24, 24)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_0swbg"]
|
||||||
|
atlas = ExtResource("2_j724m")
|
||||||
|
region = Rect2(72, 24, 24, 24)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_i30hk"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_vwjem")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_skbek")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_imgh0")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_0swbg")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"idle",
|
||||||
|
"speed": 12.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r6k3p"]
|
||||||
|
size = Vector2(14, 14)
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" groups=["enemies"]]
|
||||||
|
script = ExtResource("1_xo5ex")
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
|
texture_filter = 1
|
||||||
|
sprite_frames = SubResource("SpriteFrames_i30hk")
|
||||||
|
animation = &"idle"
|
||||||
|
autoplay = "idle"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(0, 4)
|
||||||
|
shape = SubResource("RectangleShape2D_r6k3p")
|
||||||
|
|
||||||
|
[node name="RightRay" type="RayCast2D" parent="."]
|
||||||
|
target_position = Vector2(12, 0)
|
||||||
|
|
||||||
|
[node name="LeftRay" type="RayCast2D" parent="."]
|
||||||
|
target_position = Vector2(-12, 0)
|
||||||
|
|
||||||
|
[node name="RightFloorRay" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(8, 0)
|
||||||
|
target_position = Vector2(0, 14)
|
||||||
|
|
||||||
|
[node name="LeftFloorRay" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(-8, 0)
|
||||||
|
target_position = Vector2(0, 14)
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
115
januaryproject/scenes/coin.tscn
Normal file
115
januaryproject/scenes/coin.tscn
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
[gd_scene load_steps=17 format=3 uid="uid://djcmk4sjeejcg"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/coin.gd" id="1_l1h5o"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://v8pdxg1bj3nd" path="res://assets/graphics/collectibles/coin.png" id="2_ewh6e"]
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_7chkb"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(0, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_ecx1d"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(16, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_8fpbv"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(32, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_dnsxy"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(48, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_mtv3y"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(64, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_wam0b"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(80, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_hfonb"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(96, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_bbmno"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(112, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_joupt"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(128, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_fnp6f"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(144, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_y8ea0"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(160, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_8gn7x"]
|
||||||
|
atlas = ExtResource("2_ewh6e")
|
||||||
|
region = Rect2(176, 0, 16, 16)
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="SpriteFrames_t2yui"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_7chkb")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_ecx1d")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_8fpbv")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_dnsxy")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_mtv3y")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_wam0b")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_hfonb")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_bbmno")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_joupt")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_fnp6f")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_y8ea0")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_8gn7x")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"idle",
|
||||||
|
"speed": 12.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_43iwi"]
|
||||||
|
radius = 5.0
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" groups=["collectibles"]]
|
||||||
|
script = ExtResource("1_l1h5o")
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
|
texture_filter = 1
|
||||||
|
sprite_frames = SubResource("SpriteFrames_t2yui")
|
||||||
|
animation = &"idle"
|
||||||
|
autoplay = "idle"
|
||||||
|
frame_progress = 0.503098
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("CircleShape2D_43iwi")
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
@ -1,6 +1,5 @@
|
|||||||
[gd_scene load_steps=15 format=4 uid="uid://r8jj43l4t6is"]
|
[gd_scene load_steps=16 format=4 uid="uid://r8jj43l4t6is"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://scripts/gamecontroller.gd" id="1_8i1rq"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://di3tq4f0xmdqc" path="res://scenes/crate.tscn" id="1_tfj4n"]
|
[ext_resource type="PackedScene" uid="uid://di3tq4f0xmdqc" path="res://scenes/crate.tscn" id="1_tfj4n"]
|
||||||
[ext_resource type="Script" path="res://scripts/trigger.gd" id="3_hm0br"]
|
[ext_resource type="Script" path="res://scripts/trigger.gd" id="3_hm0br"]
|
||||||
[ext_resource type="Texture2D" uid="uid://ka2skiy8uj8c" path="res://assets/graphics/terrains/backgrounds/forestbackground (1).png" id="3_jlqfv"]
|
[ext_resource type="Texture2D" uid="uid://ka2skiy8uj8c" path="res://assets/graphics/terrains/backgrounds/forestbackground (1).png" id="3_jlqfv"]
|
||||||
@ -10,6 +9,8 @@
|
|||||||
[ext_resource type="Script" path="res://scripts/scene_manager.gd" id="6_1kka5"]
|
[ext_resource type="Script" path="res://scripts/scene_manager.gd" id="6_1kka5"]
|
||||||
[ext_resource type="Texture2D" uid="uid://de4acrj4jm3cw" path="res://assets/graphics/objects/planedown.png" id="6_i0yf3"]
|
[ext_resource type="Texture2D" uid="uid://de4acrj4jm3cw" path="res://assets/graphics/objects/planedown.png" id="6_i0yf3"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dcx8qbotrbgpp" path="res://assets/graphics/terrains/Terrain (32x32).png" id="7_sjwp0"]
|
[ext_resource type="Texture2D" uid="uid://dcx8qbotrbgpp" path="res://assets/graphics/terrains/Terrain (32x32).png" id="7_sjwp0"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://djcmk4sjeejcg" path="res://scenes/coin.tscn" id="10_tkwbv"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dc3up6wvi521j" path="res://scenes/badguy.tscn" id="11_rjlcs"]
|
||||||
|
|
||||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_pgbim"]
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_pgbim"]
|
||||||
texture = ExtResource("7_sjwp0")
|
texture = ExtResource("7_sjwp0")
|
||||||
@ -382,7 +383,6 @@ distance = -119.0
|
|||||||
radius = 29.0
|
radius = 29.0
|
||||||
|
|
||||||
[node name="Game" type="Node2D"]
|
[node name="Game" type="Node2D"]
|
||||||
script = ExtResource("1_8i1rq")
|
|
||||||
|
|
||||||
[node name="SceneManager" type="Node" parent="."]
|
[node name="SceneManager" type="Node" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
@ -418,7 +418,7 @@ texture = ExtResource("6_i0yf3")
|
|||||||
|
|
||||||
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||||
position = Vector2(-1, 0)
|
position = Vector2(-1, 0)
|
||||||
tile_map_data = PackedByteArray("AAAAAAUAAAAAAAQAAAABAAUAAAABAAQAAAACAAUAAAABAAQAAAADAAUAAAABAAQAAAAEAAUAAAABAAQAAAAFAAUAAAABAAQAAAAGAAUAAAABAAQAAAAHAAUAAAABAAQAAAAIAAUAAAABAAQAAAAJAAUAAAABAAQAAAAKAAUAAAABAAQAAAALAAUAAAABAAQAAAAMAAUAAAABAAQAAAANAAUAAAABAAQAAAAOAAUAAAABAAQAAAAPAAUAAAABAAQAAAAQAAUAAAABAAQAAAARAAUAAAABAAQAAAASAAUAAAABAAQAAAATAAUAAAABAAQAAAAUAAUAAAABAAQAAAAVAAUAAAAKAAQAAAAMAAIAAAAAAAQAAAANAAIAAAACAAQAAAAOAAEAAAAEAAQAAAARAAIAAAAAAAIAAAARAAEAAAAAAAEAAAARAAAAAAAAAAAAAAASAAAAAAABAAAAAAATAAAAAAACAAAAAAATAAEAAAACAAIAAAASAAEAAAAGAAAAAAASAAIAAAACAAIAAAADAAIAAAACAAQAAAACAAIAAAAPAAQAAAACAAEAAAAEAAEAAAACAAAAAAAEAAAAAAAEAAAAAAAAAAQAAAAFAAAAAAABAAQAAAAGAAAAAAACAAQAAAAJAAAAAAAAAAQAAAAKAAAAAAACAAQAAAAVAAQAAAAAAAAAAAAWAAQAAAABAAAAAAAXAAQAAAABAAAAAAAYAAQAAAAHAAEAAAAYAAMAAAAJAAEAAAAYAAIAAAAAAAAAAAAZAAIAAAABAAAAAAAaAAIAAAAHAAEAAAAaAAEAAAAAAAAAAAAbAAEAAAACAAAAAAAbAAIAAAACAAEAAAAbAAMAAAACAAEAAAAbAAQAAAAKAAAAAAAcAAQAAAACAAQAAAAbAAUAAAACAAIAAAAaAAUAAAABAAIAAAAZAAUAAAABAAIAAAAYAAUAAAABAAIAAAAXAAUAAAABAAIAAAAWAAUAAAABAAIAAAAZAAQAAAAGAAEAAAAaAAQAAAAHAAEAAAAaAAMAAAAHAAAAAAAZAAMAAAAGAAAAAAAZAP//AAACAAQAAAAYAP//AAABAAQAAAAXAP//AAAAAAQAAAAVAPz/AAABAAQAAAAUAPz/AAAAAAQAAAAWAPz/AAABAAQAAAAXAPz/AAAQAAQAAAAXAPv/AAAEAAAAAAAKAPz/AAAAAAQAAAALAPz/AAABAAQAAAAMAPz/AAABAAQAAAANAPz/AAACAAQAAAA=")
|
tile_map_data = PackedByteArray("AAAAAAUAAAAAAAQAAAABAAUAAAABAAQAAAACAAUAAAABAAQAAAADAAUAAAABAAQAAAAEAAUAAAABAAQAAAAFAAUAAAABAAQAAAAGAAUAAAABAAQAAAAHAAUAAAAKAAQAAAAIAAUAAAAJAAQAAAAJAAUAAAABAAQAAAAKAAUAAAABAAQAAAALAAUAAAABAAQAAAAMAAUAAAABAAQAAAANAAUAAAABAAQAAAAOAAUAAAABAAQAAAAPAAUAAAABAAQAAAAQAAUAAAABAAQAAAARAAUAAAABAAQAAAASAAUAAAABAAQAAAATAAUAAAABAAQAAAAUAAUAAAABAAQAAAAVAAUAAAAKAAQAAAAMAAIAAAAAAAQAAAANAAIAAAACAAQAAAAOAAEAAAAEAAQAAAARAAIAAAAAAAIAAAARAAEAAAAAAAEAAAARAAAAAAAAAAAAAAASAAAAAAABAAAAAAATAAAAAAACAAAAAAATAAEAAAACAAIAAAASAAEAAAAGAAAAAAASAAIAAAACAAIAAAADAAIAAAACAAQAAAACAAIAAAAPAAQAAAACAAEAAAAEAAEAAAACAAAAAAAEAAAAAAAEAAAAAAAAAAQAAAAFAAAAAAABAAQAAAAGAAAAAAACAAQAAAAJAAAAAAAAAAQAAAAKAAAAAAACAAQAAAAVAAQAAAAAAAAAAAAWAAQAAAABAAAAAAAXAAQAAAABAAAAAAAYAAQAAAAHAAEAAAAYAAMAAAAJAAEAAAAYAAIAAAAAAAAAAAAZAAIAAAABAAAAAAAaAAIAAAAHAAEAAAAaAAEAAAAAAAAAAAAbAAEAAAACAAAAAAAbAAIAAAACAAEAAAAbAAMAAAACAAEAAAAbAAQAAAAKAAAAAAAcAAQAAAACAAQAAAAbAAUAAAACAAIAAAAaAAUAAAABAAIAAAAZAAUAAAABAAIAAAAYAAUAAAABAAIAAAAXAAUAAAABAAIAAAAWAAUAAAABAAIAAAAZAAQAAAAGAAEAAAAaAAQAAAAHAAEAAAAaAAMAAAAHAAAAAAAZAAMAAAAGAAAAAAAZAP//AAACAAQAAAAYAP//AAABAAQAAAAXAP//AAAAAAQAAAAVAPz/AAABAAQAAAAUAPz/AAAAAAQAAAAWAPz/AAABAAQAAAAXAPz/AAAQAAQAAAAXAPv/AAAEAAAAAAAKAPz/AAAAAAQAAAALAPz/AAABAAQAAAAMAPz/AAABAAQAAAANAPz/AAACAAQAAAAHAAQAAAAAAAAAAAAIAAQAAAACAAAAAAA=")
|
||||||
tile_set = SubResource("TileSet_4ifc1")
|
tile_set = SubResource("TileSet_4ifc1")
|
||||||
|
|
||||||
[node name="floor" type="StaticBody2D" parent="."]
|
[node name="floor" type="StaticBody2D" parent="."]
|
||||||
@ -428,7 +428,7 @@ position = Vector2(4, 42)
|
|||||||
shape = SubResource("WorldBoundaryShape2D_acecj")
|
shape = SubResource("WorldBoundaryShape2D_acecj")
|
||||||
|
|
||||||
[node name="CharacterBody2D" parent="." instance=ExtResource("3_oy8j2")]
|
[node name="CharacterBody2D" parent="." instance=ExtResource("3_oy8j2")]
|
||||||
position = Vector2(253, 89)
|
position = Vector2(160, 108)
|
||||||
|
|
||||||
[node name="Area2D" type="Area2D" parent="."]
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
position = Vector2(612, -100)
|
position = Vector2(612, -100)
|
||||||
@ -446,15 +446,23 @@ position = Vector2(196, 115)
|
|||||||
rotation = 2.0228
|
rotation = 2.0228
|
||||||
|
|
||||||
[node name="RigidBody2D2" parent="crates" instance=ExtResource("1_tfj4n")]
|
[node name="RigidBody2D2" parent="crates" instance=ExtResource("1_tfj4n")]
|
||||||
position = Vector2(399, 1)
|
position = Vector2(317, 133)
|
||||||
|
|
||||||
[node name="RigidBody2D3" parent="crates" instance=ExtResource("1_tfj4n")]
|
[node name="RigidBody2D3" parent="crates" instance=ExtResource("1_tfj4n")]
|
||||||
position = Vector2(575, -29)
|
position = Vector2(389, 49)
|
||||||
rotation = -1.0315
|
|
||||||
|
|
||||||
[node name="RigidBody2D4" parent="crates" instance=ExtResource("1_tfj4n")]
|
[node name="coins" type="Node2D" parent="."]
|
||||||
position = Vector2(493, 114)
|
|
||||||
rotation = 0.0531393
|
[node name="Area2D" parent="coins" instance=ExtResource("10_tkwbv")]
|
||||||
|
position = Vector2(288, 149)
|
||||||
|
|
||||||
|
[node name="enemies" type="Node2D" parent="."]
|
||||||
|
|
||||||
|
[node name="Area2D" parent="enemies" instance=ExtResource("11_rjlcs")]
|
||||||
|
position = Vector2(239, 117)
|
||||||
|
|
||||||
|
[node name="Area2D2" parent="enemies" instance=ExtResource("11_rjlcs")]
|
||||||
|
position = Vector2(415, 53)
|
||||||
|
|
||||||
[connection signal="areaTrigger" from="Area2D" to="." method="_on_trigger"]
|
[connection signal="areaTrigger" from="Area2D" to="." method="_on_trigger"]
|
||||||
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
|
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
|
||||||
|
459
januaryproject/scenes/level2.tscn
Normal file
459
januaryproject/scenes/level2.tscn
Normal file
@ -0,0 +1,459 @@
|
|||||||
|
[gd_scene load_steps=15 format=4 uid="uid://ctbk75ohtgn52"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/scene_manager.gd" id="1_nno8q"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ka2skiy8uj8c" path="res://assets/graphics/terrains/backgrounds/forestbackground (1).png" id="2_2sxt8"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://5uu4qwac4co" path="res://assets/graphics/terrains/backgrounds/skystrip.png" id="3_q3nnd"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dvw2k2s2t1s7i" path="res://assets/graphics/terrains/backgrounds/midtrees.png" id="4_pn8y7"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://de4acrj4jm3cw" path="res://assets/graphics/objects/planedown.png" id="5_x7x8v"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dcx8qbotrbgpp" path="res://assets/graphics/terrains/Terrain (32x32).png" id="6_exrs3"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://dcbk086hhrn7y" path="res://scenes/player.tscn" id="7_6hxr3"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/trigger.gd" id="8_1l7lm"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://di3tq4f0xmdqc" path="res://scenes/crate.tscn" id="9_akhlr"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://djcmk4sjeejcg" path="res://scenes/coin.tscn" id="10_puv42"]
|
||||||
|
|
||||||
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_pgbim"]
|
||||||
|
texture = ExtResource("6_exrs3")
|
||||||
|
texture_region_size = Vector2i(32, 32)
|
||||||
|
0:0/0 = 0
|
||||||
|
0:0/0/terrain_set = 0
|
||||||
|
0:0/0/terrain = 0
|
||||||
|
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
0:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
0:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
0:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
1:0/0 = 0
|
||||||
|
1:0/0/terrain_set = 0
|
||||||
|
1:0/0/terrain = 0
|
||||||
|
1:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
1:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
1:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
1:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
1:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
1:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
2:0/0 = 0
|
||||||
|
2:0/0/terrain_set = 0
|
||||||
|
2:0/0/terrain = 0
|
||||||
|
2:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
2:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
2:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
2:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
4:0/0 = 0
|
||||||
|
4:0/0/terrain_set = 0
|
||||||
|
4:0/0/terrain = 0
|
||||||
|
4:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
4:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
6:0/0 = 0
|
||||||
|
6:0/0/terrain_set = 0
|
||||||
|
6:0/0/terrain = 0
|
||||||
|
6:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
6:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
6:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
6:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
6:0/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
6:0/0/terrains_peering_bit/top_side = 0
|
||||||
|
6:0/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
7:0/0 = 0
|
||||||
|
7:0/0/terrain_set = 0
|
||||||
|
7:0/0/terrain = 0
|
||||||
|
7:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
7:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
7:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
7:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
7:0/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
7:0/0/terrains_peering_bit/top_side = 0
|
||||||
|
7:0/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
9:0/0 = 0
|
||||||
|
9:0/0/terrain_set = 0
|
||||||
|
9:0/0/terrain = 0
|
||||||
|
9:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
9:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
9:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
9:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
9:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
9:0/0/terrains_peering_bit/top_side = 0
|
||||||
|
10:0/0 = 0
|
||||||
|
10:0/0/terrain_set = 0
|
||||||
|
10:0/0/terrain = 0
|
||||||
|
10:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
10:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
10:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
10:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
10:0/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
10:0/0/terrains_peering_bit/top_side = 0
|
||||||
|
12:0/0 = 0
|
||||||
|
12:0/0/terrain_set = 0
|
||||||
|
12:0/0/terrain = 0
|
||||||
|
12:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -4, -16, -5.5, 16, -16, 16)
|
||||||
|
12:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
12:0/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
12:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
12:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
12:0/0/terrains_peering_bit/top_side = 0
|
||||||
|
13:0/0 = 0
|
||||||
|
13:0/0/terrain_set = 0
|
||||||
|
13:0/0/terrain = 0
|
||||||
|
13:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
13:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
13:0/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
13:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
13:0/0/terrains_peering_bit/top_side = 0
|
||||||
|
15:0/0 = 0
|
||||||
|
15:0/0/terrain_set = 0
|
||||||
|
15:0/0/terrain = 0
|
||||||
|
15:0/0/terrains_peering_bit/right_side = 0
|
||||||
|
15:0/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
15:0/0/terrains_peering_bit/left_side = 0
|
||||||
|
15:0/0/terrains_peering_bit/top_side = 0
|
||||||
|
0:1/0 = 0
|
||||||
|
0:1/0/terrain_set = 0
|
||||||
|
0:1/0/terrain = 0
|
||||||
|
0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
0:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
0:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
0:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
0:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
0:1/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
1:1/0 = 0
|
||||||
|
2:1/0 = 0
|
||||||
|
2:1/0/terrain_set = 0
|
||||||
|
2:1/0/terrain = 0
|
||||||
|
2:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
2:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
2:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
2:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
2:1/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
2:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
4:1/0 = 0
|
||||||
|
4:1/0/terrain_set = 0
|
||||||
|
4:1/0/terrain = 0
|
||||||
|
4:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
4:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
4:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
6:1/0 = 0
|
||||||
|
6:1/0/terrain_set = 0
|
||||||
|
6:1/0/terrain = 0
|
||||||
|
6:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
6:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
6:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
6:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
6:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
6:1/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
6:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
7:1/0 = 0
|
||||||
|
7:1/0/terrain_set = 0
|
||||||
|
7:1/0/terrain = 0
|
||||||
|
7:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
7:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
7:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
7:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
7:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
7:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
7:1/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
9:1/0 = 0
|
||||||
|
9:1/0/terrain_set = 0
|
||||||
|
9:1/0/terrain = 0
|
||||||
|
9:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -4, -16, -5.5, 16, -16, 16)
|
||||||
|
9:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
9:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
9:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
9:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
9:1/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
10:1/0 = 0
|
||||||
|
10:1/0/terrain_set = 0
|
||||||
|
10:1/0/terrain = 0
|
||||||
|
10:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
10:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
10:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
10:1/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
10:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
10:1/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
12:1/0 = 0
|
||||||
|
12:1/0/terrain_set = 0
|
||||||
|
12:1/0/terrain = 0
|
||||||
|
12:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -4, -16, -5.5, 16, -16, 16)
|
||||||
|
12:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
12:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
12:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
12:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
12:1/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
13:1/0 = 0
|
||||||
|
13:1/0/terrain_set = 0
|
||||||
|
13:1/0/terrain = 0
|
||||||
|
13:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
13:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
13:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
13:1/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
13:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
15:1/0 = 0
|
||||||
|
15:1/0/terrain_set = 0
|
||||||
|
15:1/0/terrain = 0
|
||||||
|
15:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
15:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
15:1/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
15:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
15:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
15:1/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
16:1/0 = 0
|
||||||
|
16:1/0/terrain_set = 0
|
||||||
|
16:1/0/terrain = 0
|
||||||
|
16:1/0/terrains_peering_bit/right_side = 0
|
||||||
|
16:1/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
16:1/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
16:1/0/terrains_peering_bit/left_side = 0
|
||||||
|
16:1/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
16:1/0/terrains_peering_bit/top_side = 0
|
||||||
|
0:2/0 = 0
|
||||||
|
0:2/0/terrain_set = 0
|
||||||
|
0:2/0/terrain = 0
|
||||||
|
0:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -2.25, 16, -10.75, 12.75, -16, 5.5)
|
||||||
|
0:2/0/terrains_peering_bit/right_side = 0
|
||||||
|
0:2/0/terrains_peering_bit/top_side = 0
|
||||||
|
0:2/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
1:2/0 = 0
|
||||||
|
1:2/0/terrain_set = 0
|
||||||
|
1:2/0/terrain = 0
|
||||||
|
1:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
1:2/0/terrains_peering_bit/right_side = 0
|
||||||
|
1:2/0/terrains_peering_bit/left_side = 0
|
||||||
|
1:2/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
1:2/0/terrains_peering_bit/top_side = 0
|
||||||
|
1:2/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
2:2/0 = 0
|
||||||
|
2:2/0/terrain_set = 0
|
||||||
|
2:2/0/terrain = 0
|
||||||
|
2:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
2:2/0/terrains_peering_bit/left_side = 0
|
||||||
|
2:2/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
2:2/0/terrains_peering_bit/top_side = 0
|
||||||
|
4:2/0 = 0
|
||||||
|
4:2/0/terrain_set = 0
|
||||||
|
4:2/0/terrain = 0
|
||||||
|
4:2/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
4:2/0/terrains_peering_bit/top_side = 0
|
||||||
|
6:3/0 = 0
|
||||||
|
6:3/0/terrain_set = 0
|
||||||
|
6:3/0/terrain = 0
|
||||||
|
6:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 0.5, -16, -0.25, 16, -16, 16)
|
||||||
|
6:3/0/terrains_peering_bit/right_side = 0
|
||||||
|
6:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
6:3/0/terrains_peering_bit/top_side = 0
|
||||||
|
6:3/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
7:3/0 = 0
|
||||||
|
7:3/0/terrain_set = 0
|
||||||
|
7:3/0/terrain = 0
|
||||||
|
7:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(1.5, -16, 16, -16, 16, 16, 0.75, 16)
|
||||||
|
7:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
7:3/0/terrains_peering_bit/left_side = 0
|
||||||
|
7:3/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
7:3/0/terrains_peering_bit/top_side = 0
|
||||||
|
9:3/0 = 0
|
||||||
|
9:3/0/terrain_set = 0
|
||||||
|
9:3/0/terrain = 0
|
||||||
|
9:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -2, -16, -1.5)
|
||||||
|
9:3/0/terrains_peering_bit/right_side = 0
|
||||||
|
9:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
9:3/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
9:3/0/terrains_peering_bit/left_side = 0
|
||||||
|
10:3/0 = 0
|
||||||
|
10:3/0/terrain_set = 0
|
||||||
|
10:3/0/terrain = 0
|
||||||
|
10:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, -2, -16, -1.5)
|
||||||
|
10:3/0/terrains_peering_bit/right_side = 0
|
||||||
|
10:3/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
10:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
10:3/0/terrains_peering_bit/left_side = 0
|
||||||
|
12:3/0 = 0
|
||||||
|
12:3/0/terrain_set = 0
|
||||||
|
12:3/0/terrain = 0
|
||||||
|
12:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, -4.5, -16, -4.25, 16, -16, 16)
|
||||||
|
12:3/0/terrains_peering_bit/right_side = 0
|
||||||
|
12:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
12:3/0/terrains_peering_bit/top_side = 0
|
||||||
|
13:3/0 = 0
|
||||||
|
13:3/0/terrain_set = 0
|
||||||
|
13:3/0/terrain = 0
|
||||||
|
13:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 0, -16, 0)
|
||||||
|
13:3/0/terrains_peering_bit/right_side = 0
|
||||||
|
13:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
13:3/0/terrains_peering_bit/left_side = 0
|
||||||
|
15:3/0 = 0
|
||||||
|
15:3/0/terrain_set = 0
|
||||||
|
15:3/0/terrain = 0
|
||||||
|
15:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
15:3/0/terrains_peering_bit/right_side = 0
|
||||||
|
15:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
16:3/0 = 0
|
||||||
|
16:3/0/terrain_set = 0
|
||||||
|
16:3/0/terrain = 0
|
||||||
|
16:3/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
16:3/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
16:3/0/terrains_peering_bit/left_side = 0
|
||||||
|
0:4/0 = 0
|
||||||
|
0:4/0/terrain_set = 0
|
||||||
|
0:4/0/terrain = 0
|
||||||
|
0:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
0:4/0/terrains_peering_bit/right_side = 0
|
||||||
|
1:4/0 = 0
|
||||||
|
1:4/0/terrain_set = 0
|
||||||
|
1:4/0/terrain = 0
|
||||||
|
1:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
1:4/0/terrains_peering_bit/right_side = 0
|
||||||
|
1:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
2:4/0 = 0
|
||||||
|
2:4/0/terrain_set = 0
|
||||||
|
2:4/0/terrain = 0
|
||||||
|
2:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
2:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
4:4/0 = 0
|
||||||
|
4:4/0/terrain_set = 0
|
||||||
|
4:4/0/terrain = 0
|
||||||
|
4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
6:4/0 = 0
|
||||||
|
6:4/0/terrain_set = 0
|
||||||
|
6:4/0/terrain = 0
|
||||||
|
6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 0.5, -16, -0.25, 16, -16, 16)
|
||||||
|
6:4/0/terrains_peering_bit/right_side = 0
|
||||||
|
6:4/0/terrains_peering_bit/bottom_right_corner = 0
|
||||||
|
6:4/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
6:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
7:4/0 = 0
|
||||||
|
7:4/0/terrain_set = 0
|
||||||
|
7:4/0/terrain = 0
|
||||||
|
7:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(1.5, -16, 16, -16, 16, 16, 0.75, 16)
|
||||||
|
7:4/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
7:4/0/terrains_peering_bit/bottom_left_corner = 0
|
||||||
|
7:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
7:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
9:4/0 = 0
|
||||||
|
9:4/0/terrain_set = 0
|
||||||
|
9:4/0/terrain = 0
|
||||||
|
9:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 0.75, 16, 0.25, 16, 16, -16, 16)
|
||||||
|
9:4/0/terrains_peering_bit/right_side = 0
|
||||||
|
9:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
9:4/0/terrains_peering_bit/top_left_corner = 0
|
||||||
|
9:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
10:4/0 = 0
|
||||||
|
10:4/0/terrain_set = 0
|
||||||
|
10:4/0/terrain = 0
|
||||||
|
10:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 0.75, 16, 0.25, 16, 16, -16, 16)
|
||||||
|
10:4/0/terrains_peering_bit/right_side = 0
|
||||||
|
10:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
10:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
10:4/0/terrains_peering_bit/top_right_corner = 0
|
||||||
|
12:4/0 = 0
|
||||||
|
12:4/0/terrain_set = 0
|
||||||
|
12:4/0/terrain = 0
|
||||||
|
12:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 5.75, 16, 5.5, 16, 16, -16, 16)
|
||||||
|
12:4/0/terrains_peering_bit/right_side = 0
|
||||||
|
12:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
12:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
13:4/0 = 0
|
||||||
|
13:4/0/terrain_set = 0
|
||||||
|
13:4/0/terrain = 0
|
||||||
|
13:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(2.5, -16, 16, -16, 16, 16, 2.5, 16)
|
||||||
|
13:4/0/terrains_peering_bit/bottom_side = 0
|
||||||
|
13:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
13:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
15:4/0 = 0
|
||||||
|
15:4/0/terrain_set = 0
|
||||||
|
15:4/0/terrain = 0
|
||||||
|
15:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
15:4/0/terrains_peering_bit/right_side = 0
|
||||||
|
15:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
16:4/0 = 0
|
||||||
|
16:4/0/terrain_set = 0
|
||||||
|
16:4/0/terrain = 0
|
||||||
|
16:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
|
||||||
|
16:4/0/terrains_peering_bit/left_side = 0
|
||||||
|
16:4/0/terrains_peering_bit/top_side = 0
|
||||||
|
|
||||||
|
[sub_resource type="TileSet" id="TileSet_4ifc1"]
|
||||||
|
tile_size = Vector2i(32, 32)
|
||||||
|
physics_layer_0/collision_layer = 1
|
||||||
|
terrain_set_0/mode = 0
|
||||||
|
terrain_set_0/terrain_0/name = "leafy_ground"
|
||||||
|
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
|
||||||
|
sources/0 = SubResource("TileSetAtlasSource_pgbim")
|
||||||
|
|
||||||
|
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_acecj"]
|
||||||
|
distance = -119.0
|
||||||
|
|
||||||
|
[sub_resource type="CircleShape2D" id="CircleShape2D_8j7te"]
|
||||||
|
radius = 29.0
|
||||||
|
|
||||||
|
[node name="Game" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="SceneManager" type="Node" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
script = ExtResource("1_nno8q")
|
||||||
|
|
||||||
|
[node name="Background" type="Parallax2D" parent="."]
|
||||||
|
scroll_scale = Vector2(0.5, 1)
|
||||||
|
repeat_size = Vector2(320, 0)
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="Background"]
|
||||||
|
position = Vector2(160, 90)
|
||||||
|
texture = ExtResource("2_2sxt8")
|
||||||
|
|
||||||
|
[node name="Sprite2D2" type="Sprite2D" parent="Background"]
|
||||||
|
position = Vector2(160, -207.5)
|
||||||
|
scale = Vector2(1, 14.8333)
|
||||||
|
texture = ExtResource("3_q3nnd")
|
||||||
|
|
||||||
|
[node name="Parallax2D" type="Parallax2D" parent="."]
|
||||||
|
scroll_scale = Vector2(1, 0)
|
||||||
|
repeat_size = Vector2(320, 0)
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="Parallax2D"]
|
||||||
|
texture_filter = 1
|
||||||
|
position = Vector2(160, 90)
|
||||||
|
texture = ExtResource("4_pn8y7")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
texture_filter = 1
|
||||||
|
position = Vector2(618, 149)
|
||||||
|
scale = Vector2(0.474685, 0.559115)
|
||||||
|
texture = ExtResource("5_x7x8v")
|
||||||
|
|
||||||
|
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||||
|
position = Vector2(-1, 0)
|
||||||
|
tile_map_data = PackedByteArray("AAAAAAUAAAAAAAQAAAABAAUAAAABAAQAAAACAAUAAAABAAQAAAADAAUAAAABAAQAAAAEAAUAAAABAAQAAAAFAAUAAAABAAQAAAAGAAUAAAAMAAQAAAAHAAUAAAABAAQAAAAIAAUAAAABAAQAAAAJAAUAAAABAAQAAAAKAAUAAAABAAQAAAALAAUAAAABAAQAAAAMAAUAAAABAAQAAAANAAUAAAABAAQAAAAOAAUAAAABAAQAAAAPAAUAAAABAAQAAAAQAAUAAAABAAQAAAARAAUAAAABAAQAAAASAAUAAAABAAQAAAATAAUAAAABAAQAAAAUAAUAAAABAAQAAAAVAAUAAAAKAAQAAAARAAIAAAAAAAIAAAARAAEAAAAAAAEAAAARAAAAAAAAAAAAAAASAAAAAAABAAAAAAATAAAAAAACAAAAAAATAAEAAAACAAIAAAASAAEAAAAGAAAAAAASAAIAAAACAAIAAAADAAIAAAACAAQAAAACAAIAAAAPAAQAAAACAAEAAAAEAAEAAAACAAAAAAAEAAAAAAAVAAQAAAAAAAAAAAAWAAQAAAABAAAAAAAXAAQAAAABAAAAAAAYAAQAAAAHAAEAAAAYAAMAAAAJAAEAAAAYAAIAAAAAAAAAAAAZAAIAAAABAAAAAAAaAAIAAAAHAAEAAAAaAAEAAAAAAAAAAAAbAAEAAAACAAAAAAAbAAIAAAACAAEAAAAbAAMAAAACAAEAAAAbAAQAAAAKAAAAAAAcAAQAAAACAAQAAAAbAAUAAAACAAIAAAAaAAUAAAABAAIAAAAZAAUAAAABAAIAAAAYAAUAAAABAAIAAAAXAAUAAAABAAIAAAAWAAUAAAABAAIAAAAZAAQAAAAGAAEAAAAaAAQAAAAHAAEAAAAaAAMAAAAHAAAAAAAZAAMAAAAGAAAAAAAZAP//AAACAAQAAAAYAP//AAABAAQAAAAXAP//AAAAAAQAAAAVAPz/AAABAAQAAAAUAPz/AAAAAAQAAAAWAPz/AAABAAQAAAAXAPz/AAAQAAQAAAAXAPv/AAAEAAAAAAAKAPz/AAAAAAQAAAALAPz/AAABAAQAAAAMAPz/AAABAAQAAAANAPz/AAACAAQAAAAGAAQAAAAEAAEAAAAGAAMAAAAQAAMAAAAFAAMAAAAAAAQAAAALAAIAAAAAAAQAAAAMAAIAAAABAAQAAAANAAIAAAABAAQAAAAOAAIAAAAQAAQAAAAOAAEAAAAEAAEAAAAOAAAAAAAEAAAAAAA=")
|
||||||
|
tile_set = SubResource("TileSet_4ifc1")
|
||||||
|
|
||||||
|
[node name="floor" type="StaticBody2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="floor"]
|
||||||
|
position = Vector2(4, 42)
|
||||||
|
shape = SubResource("WorldBoundaryShape2D_acecj")
|
||||||
|
|
||||||
|
[node name="CharacterBody2D" parent="." instance=ExtResource("7_6hxr3")]
|
||||||
|
position = Vector2(253, 89)
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
position = Vector2(612, -100)
|
||||||
|
script = ExtResource("8_1l7lm")
|
||||||
|
metadata/_edit_group_ = true
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
|
shape = SubResource("CircleShape2D_8j7te")
|
||||||
|
debug_color = Color(0.827271, 0.252084, 0.761388, 0.42)
|
||||||
|
|
||||||
|
[node name="crates" type="Node2D" parent="."]
|
||||||
|
|
||||||
|
[node name="RigidBody2D" parent="crates" instance=ExtResource("9_akhlr")]
|
||||||
|
position = Vector2(468, 142)
|
||||||
|
rotation = 2.0228
|
||||||
|
|
||||||
|
[node name="RigidBody2D2" parent="crates" instance=ExtResource("9_akhlr")]
|
||||||
|
position = Vector2(317, 133)
|
||||||
|
|
||||||
|
[node name="RigidBody2D3" parent="crates" instance=ExtResource("9_akhlr")]
|
||||||
|
position = Vector2(406, 145)
|
||||||
|
|
||||||
|
[node name="coins" type="Node2D" parent="."]
|
||||||
|
|
||||||
|
[node name="Area2D" parent="coins" instance=ExtResource("10_puv42")]
|
||||||
|
position = Vector2(288, 149)
|
||||||
|
|
||||||
|
[connection signal="areaTrigger" from="Area2D" to="." method="_on_trigger"]
|
||||||
|
[connection signal="body_entered" from="Area2D" to="Area2D" method="_on_body_entered"]
|
27
januaryproject/scripts/badguy.gd
Normal file
27
januaryproject/scripts/badguy.gd
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
class_name BadGuy extends Area2D
|
||||||
|
@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||||
|
@onready var right_ray: RayCast2D = $RightRay
|
||||||
|
@onready var left_ray: RayCast2D = $LeftRay
|
||||||
|
@onready var right_floor_ray: RayCast2D = $RightFloorRay
|
||||||
|
@onready var left_floor_ray: RayCast2D = $LeftFloorRay
|
||||||
|
const speed = 60
|
||||||
|
var direction = 1
|
||||||
|
|
||||||
|
#signals
|
||||||
|
signal playerDamage
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
if not right_floor_ray.is_colliding():
|
||||||
|
#about to fall on the right....
|
||||||
|
direction = -1
|
||||||
|
sprite.flip_h = true
|
||||||
|
if not left_floor_ray.is_colliding():
|
||||||
|
direction = 1
|
||||||
|
sprite.flip_h = false
|
||||||
|
|
||||||
|
position.x += direction * speed * delta
|
||||||
|
|
||||||
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
|
if body.is_in_group("player"):
|
||||||
|
print("Bad Guy Collided")
|
||||||
|
playerDamage.emit()
|
8
januaryproject/scripts/coin.gd
Normal file
8
januaryproject/scripts/coin.gd
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
class_name Coin extends Area2D
|
||||||
|
|
||||||
|
signal coinCollected
|
||||||
|
|
||||||
|
func _on_body_entered(body: Node2D) -> void:
|
||||||
|
if body.is_in_group("player"):
|
||||||
|
coinCollected.emit()
|
||||||
|
queue_free()
|
@ -1,45 +1,74 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
var boxTotal = 4
|
var boxTotal := 4
|
||||||
var timer:= Timer.new()
|
var timer:= Timer.new()
|
||||||
var countdown = 10
|
var countdown := 10
|
||||||
var totalCrates = 0
|
var totalCrates := 0
|
||||||
|
var cratesDestroyed := 0
|
||||||
|
var totalCoins := 0
|
||||||
|
var totalCoinsCollected := 0
|
||||||
|
var totalBadGuys := 0
|
||||||
|
|
||||||
|
var player:Resource
|
||||||
|
|
||||||
|
#level information
|
||||||
|
var levels = ["res://scenes/game.tscn","res://scenes/level2.tscn"]
|
||||||
|
var timers = [10, 15]
|
||||||
|
var currentLevel = 0
|
||||||
|
|
||||||
|
#Signals from GC
|
||||||
signal destroyBox(body)
|
signal destroyBox(body)
|
||||||
|
signal levelComplete(levelToLoad)
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
player = load("res://scripts/res/playerstats.tres")
|
||||||
|
print("Player health "+str(player.health))
|
||||||
|
|
||||||
|
print("Number of levels: "+str(levels.size() ) )
|
||||||
|
reset()
|
||||||
add_child(timer)
|
add_child(timer)
|
||||||
timer.wait_time = 1
|
timer.wait_time = 1
|
||||||
timer.one_shot = false
|
timer.one_shot = false
|
||||||
timer.connect("timeout", secondCounter)
|
timer.connect("timeout", secondCounter)
|
||||||
# timer.start()
|
timer.start()
|
||||||
|
|
||||||
|
func reset():
|
||||||
|
countdown = timers[currentLevel]
|
||||||
|
|
||||||
func secondCounter():
|
func secondCounter():
|
||||||
|
|
||||||
countdown -=1
|
countdown -=1
|
||||||
if countdown <=0:
|
if countdown <=0:
|
||||||
print("YOU LOSE")
|
print("YOU LOSE")
|
||||||
get_tree().reload_current_scene()
|
levelComplete.emit(levels[currentLevel])
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
func coinCollected():
|
||||||
func _process(delta: float) -> void:
|
totalCoinsCollected += 1
|
||||||
pass
|
print("GC knows coin collected")
|
||||||
|
func playerDamaged():
|
||||||
|
print("GC knows player taking damage")
|
||||||
func _on_trigger(effect: Variant, body) -> void:
|
player.health -= 20
|
||||||
print("Game Controller sees an alert")
|
print("Health remaining: "+str(player.health))
|
||||||
if body is RigidBody2D:
|
|
||||||
print("I see a crate")
|
|
||||||
body.queue_free()
|
|
||||||
boxTotal -=1
|
|
||||||
if boxTotal <=0:
|
|
||||||
print("YOU WON!!")
|
|
||||||
get_tree().reload_current_scene()
|
|
||||||
|
|
||||||
func bulletHit(body):
|
func bulletHit(body):
|
||||||
print("Game controller knows bullet hit something")
|
print("Game controller knows bullet hit something")
|
||||||
if body.is_in_group("destructable"):
|
if body.is_in_group("destructable"):
|
||||||
destroyBox.emit(body)
|
destroyBox.emit(body)
|
||||||
|
totalCrates -=1
|
||||||
|
cratesDestroyed +=1
|
||||||
|
if totalCrates <=0:
|
||||||
|
print("YOU WON!!")
|
||||||
|
#refactor this - make it a signal
|
||||||
|
currentLevel +=1
|
||||||
|
if currentLevel >= levels.size():
|
||||||
|
currentLevel = 0
|
||||||
|
levelComplete.emit(levels[currentLevel])
|
||||||
|
else:
|
||||||
|
print("Crates Remaining "+str(totalCrates) )
|
||||||
|
# Coming from SceneManager
|
||||||
func countCrates(value):
|
func countCrates(value):
|
||||||
totalCrates = value
|
totalCrates = value
|
||||||
|
func countCoins(value):
|
||||||
|
totalCoins = value
|
||||||
|
func countBadGuys(value):
|
||||||
|
totalBadGuys = value
|
||||||
|
5
januaryproject/scripts/res/characterstats.gd
Normal file
5
januaryproject/scripts/res/characterstats.gd
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class_name CharacterStats extends Resource
|
||||||
|
|
||||||
|
@export var max_health:int = 100
|
||||||
|
@export var starting_health:int = 100
|
||||||
|
@export var health:int = 100
|
9
januaryproject/scripts/res/playerstats.tres
Normal file
9
januaryproject/scripts/res/playerstats.tres
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[gd_resource type="Resource" script_class="CharacterStats" load_steps=2 format=3 uid="uid://kty8mv3cl6dc"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/res/characterstats.gd" id="1_tqdla"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_tqdla")
|
||||||
|
max_health = 150
|
||||||
|
starting_health = 100
|
||||||
|
health = 100
|
9
januaryproject/scripts/res/slimestats.tres
Normal file
9
januaryproject/scripts/res/slimestats.tres
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[gd_resource type="Resource" script_class="CharacterStats" load_steps=2 format=3 uid="uid://buy7hpseunp3u"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/res/characterstats.gd" id="1_a2a1n"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
script = ExtResource("1_a2a1n")
|
||||||
|
max_health = 60
|
||||||
|
starting_health = 50
|
||||||
|
health = 50
|
@ -1,24 +1,46 @@
|
|||||||
extends Node
|
extends Node
|
||||||
@onready var game: Node2D = $".."
|
|
||||||
@onready var crates: Node2D = $"../crates"
|
@onready var crates: Node2D = $"../crates"
|
||||||
|
@onready var coins: Node2D = $"../coins"
|
||||||
|
@onready var enemies: Node2D = $"../enemies"
|
||||||
|
|
||||||
var bullet = preload("res://scenes/bullet.tscn")
|
var bullet = preload("res://scenes/bullet.tscn")
|
||||||
var bulletArray:Array = []
|
var bulletArray:Array = []
|
||||||
var bulletsMadeTotal :=0
|
var bulletsMadeTotal :=0
|
||||||
|
|
||||||
|
|
||||||
var totalCrates := 0
|
var totalCrates := 0
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
game.destroyBox.connect(boxDestroy)
|
#Give GC number of crates
|
||||||
|
Gamecontroller.destroyBox.connect(boxDestroy)
|
||||||
for obj in crates.get_children():
|
for obj in crates.get_children():
|
||||||
if obj.is_in_group("destructable"):
|
if obj.is_in_group("destructable"):
|
||||||
#increase the box counter
|
#increase the box counter
|
||||||
totalCrates +=1
|
totalCrates +=1
|
||||||
|
var totalCoins = 0
|
||||||
|
for obj in coins.get_children():
|
||||||
|
if obj.is_in_group("collectibles"):
|
||||||
|
totalCoins +=1
|
||||||
|
obj.coinCollected.connect(Gamecontroller.coinCollected)
|
||||||
|
var totalEnemies = 0
|
||||||
|
for obj in enemies.get_children():
|
||||||
|
if obj.is_in_group("enemies"):
|
||||||
|
totalEnemies +=1
|
||||||
|
obj.playerDamage.connect(Gamecontroller.playerDamaged)
|
||||||
|
Gamecontroller.countBadGuys(totalEnemies)
|
||||||
|
Gamecontroller.countCoins(totalCoins)
|
||||||
|
Gamecontroller.countCrates(totalCrates)
|
||||||
|
|
||||||
|
#Subscribe to vital events from GC
|
||||||
|
Gamecontroller.levelComplete.connect(changeLevel)
|
||||||
|
|
||||||
|
Gamecontroller.reset()
|
||||||
|
|
||||||
|
|
||||||
|
func changeLevel(level):
|
||||||
|
get_tree().change_scene_to_file(level)
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
func _process(delta: float) -> void:
|
func _process(delta: float) -> void:
|
||||||
@ -49,7 +71,7 @@ func onBulletHit(bullet, body):
|
|||||||
bullet.setSpeed(0)
|
bullet.setSpeed(0)
|
||||||
|
|
||||||
print("Scene manager knows bullet hit")
|
print("Scene manager knows bullet hit")
|
||||||
game.bulletHit(body)
|
Gamecontroller.bulletHit(body)
|
||||||
|
|
||||||
func boxDestroy(body):
|
func boxDestroy(body):
|
||||||
body.queue_free()
|
body.queue_free()
|
||||||
|
Loading…
Reference in New Issue
Block a user