Compare commits

...

2 Commits

Author SHA1 Message Date
64e0b3a510 small updates to prep 2026-03-30 17:50:14 -04:00
3b23e7b50d week 5 prep, multi-levels, coins, enemies, stats 2026-03-30 17:35:07 -04:00
16 changed files with 995 additions and 61 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c00c0x1qv83o1"
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/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

View File

@ -0,0 +1,40 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://chiso4pse86ou"
path="res://.godot/imported/coin.png-f0b33289d8d72c34d5a0c76da4c0f19c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/pickups/coin.png"
dest_files=["res://.godot/imported/coin.png-f0b33289d8d72c34d5a0c76da4c0f19c.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/uastc_level=0
compress/rdo_quality_loss=0.0
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/channel_remap/red=0
process/channel_remap/green=1
process/channel_remap/blue=2
process/channel_remap/alpha=3
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

View File

@ -15,6 +15,10 @@ run/main_scene="uid://cqk2rgy3m1chs"
config/features=PackedStringArray("4.6", "Forward Plus") config/features=PackedStringArray("4.6", "Forward Plus")
config/icon="res://icon.svg" config/icon="res://icon.svg"
[autoload]
Gamecontroller="*uid://dxubdt7nh5s1j"
[display] [display]
window/size/viewport_width=480 window/size/viewport_width=480

View File

@ -21,4 +21,5 @@ scale = Vector2(0.10053524, 0.115774006)
texture = ExtResource("2_y25gk") texture = ExtResource("2_y25gk")
offset = Vector2(37.789795, 25.590113) offset = Vector2(37.789795, 25.590113)
[connection signal="area_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_entered" from="." to="." method="_on_body_entered"] [connection signal="body_entered" from="." to="." method="_on_body_entered"]

112
scenes/coin.tscn Normal file
View File

@ -0,0 +1,112 @@
[gd_scene format=3 uid="uid://dowh0cdyuldlp"]
[ext_resource type="Script" uid="uid://b3dvuwq5c8l4h" path="res://scripts/coin.gd" id="1_i64fm"]
[ext_resource type="Texture2D" uid="uid://chiso4pse86ou" path="res://assets/graphics/pickups/coin.png" id="1_rwqht"]
[sub_resource type="CircleShape2D" id="CircleShape2D_i64fm"]
radius = 6.0
[sub_resource type="AtlasTexture" id="AtlasTexture_11l1o"]
atlas = ExtResource("1_rwqht")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_d14el"]
atlas = ExtResource("1_rwqht")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_1ikuy"]
atlas = ExtResource("1_rwqht")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wnlwo"]
atlas = ExtResource("1_rwqht")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jig8b"]
atlas = ExtResource("1_rwqht")
region = Rect2(64, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_xmuha"]
atlas = ExtResource("1_rwqht")
region = Rect2(80, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_kfxoj"]
atlas = ExtResource("1_rwqht")
region = Rect2(96, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jsmju"]
atlas = ExtResource("1_rwqht")
region = Rect2(112, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_s0mny"]
atlas = ExtResource("1_rwqht")
region = Rect2(128, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_7cc30"]
atlas = ExtResource("1_rwqht")
region = Rect2(144, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_rojmm"]
atlas = ExtResource("1_rwqht")
region = Rect2(160, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_ls27i"]
atlas = ExtResource("1_rwqht")
region = Rect2(176, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_ssuvv"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_11l1o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d14el")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1ikuy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wnlwo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jig8b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xmuha")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kfxoj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jsmju")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s0mny")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7cc30")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rojmm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ls27i")
}],
"loop": true,
"name": &"default",
"speed": 12.0
}]
[node name="Coin" type="Area2D" unique_id=1684921412]
script = ExtResource("1_i64fm")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=708565392]
shape = SubResource("CircleShape2D_i64fm")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=21383429]
texture_filter = 1
sprite_frames = SubResource("SpriteFrames_ssuvv")
autoplay = "default"
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -1,6 +1,5 @@
[gd_scene format=4 uid="uid://cqk2rgy3m1chs"] [gd_scene format=4 uid="uid://cqk2rgy3m1chs"]
[ext_resource type="Script" uid="uid://dxubdt7nh5s1j" path="res://scripts/gameController.gd" id="1_lnu2h"]
[ext_resource type="Script" uid="uid://ch2id76i14srx" path="res://scripts/scene_manager.gd" id="2_iywne"] [ext_resource type="Script" uid="uid://ch2id76i14srx" path="res://scripts/scene_manager.gd" id="2_iywne"]
[ext_resource type="PackedScene" uid="uid://b6lw2go5mwk3h" path="res://scenes/crate.tscn" id="2_lnu2h"] [ext_resource type="PackedScene" uid="uid://b6lw2go5mwk3h" path="res://scenes/crate.tscn" id="2_lnu2h"]
[ext_resource type="Texture2D" uid="uid://c7e3bo3gav3ou" path="res://assets/graphics/environment/terrain/bg/background B layer1.png" id="3_dinhu"] [ext_resource type="Texture2D" uid="uid://c7e3bo3gav3ou" path="res://assets/graphics/environment/terrain/bg/background B layer1.png" id="3_dinhu"]
@ -13,6 +12,8 @@
[ext_resource type="Texture2D" uid="uid://6jv2l35y03f" path="res://assets/graphics/environment/terrain/veg_32x32.png" id="6_dinhu"] [ext_resource type="Texture2D" uid="uid://6jv2l35y03f" path="res://assets/graphics/environment/terrain/veg_32x32.png" id="6_dinhu"]
[ext_resource type="PackedScene" uid="uid://bgi18lbutp5ui" path="res://scenes/npc_character.tscn" id="6_u5sy4"] [ext_resource type="PackedScene" uid="uid://bgi18lbutp5ui" path="res://scenes/npc_character.tscn" id="6_u5sy4"]
[ext_resource type="Texture2D" uid="uid://cufqer3a7texm" path="res://assets/graphics/environment/terrain/bg/background B layer4.png" id="13_kvuet"] [ext_resource type="Texture2D" uid="uid://cufqer3a7texm" path="res://assets/graphics/environment/terrain/bg/background B layer4.png" id="13_kvuet"]
[ext_resource type="PackedScene" uid="uid://dowh0cdyuldlp" path="res://scenes/coin.tscn" id="13_trtic"]
[ext_resource type="PackedScene" uid="uid://dkht2dvm4ob7d" path="res://scenes/slime.tscn" id="14_trtic"]
[sub_resource type="TileMapPattern" id="TileMapPattern_u5sy4"] [sub_resource type="TileMapPattern" id="TileMapPattern_u5sy4"]
tile_data = PackedInt32Array(0, 1, 0, 65536, 1, 1, 131072, 1, 1, 196608, 1, 2, 1, 65537, 0, 65537, 65537, 1, 131073, 131073, 1, 196609, 65537, 2, 2, 65537, 0, 65538, 131073, 1, 131074, 65537, 1, 196610, 65537, 2, 3, 131073, 0, 65539, 262145, 1, 131075, 131073, 1, 196611, 131073, 2) tile_data = PackedInt32Array(0, 1, 0, 65536, 1, 1, 131072, 1, 1, 196608, 1, 2, 1, 65537, 0, 65537, 65537, 1, 131073, 131073, 1, 196609, 65537, 2, 2, 65537, 0, 65538, 131073, 1, 131074, 65537, 1, 196610, 65537, 2, 3, 131073, 0, 65539, 262145, 1, 131075, 131073, 1, 196611, 131073, 2)
@ -410,54 +411,52 @@ pattern_1 = SubResource("TileMapPattern_gee14")
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_lbhrr"] [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_lbhrr"]
[node name="Game" type="Node2D" unique_id=239599901] [node name="Game" type="Node2D" unique_id=239599901]
script = ExtResource("1_lnu2h")
[node name="ParallaxBG" type="Node2D" parent="." unique_id=87624809]
[node name="sky" type="Parallax2D" parent="ParallaxBG" unique_id=1954892357]
repeat_size = Vector2(1440, 270)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/sky" unique_id=1505289323]
texture = ExtResource("3_dinhu")
offset = Vector2(720, 240)
[node name="midground" type="Parallax2D" parent="ParallaxBG" unique_id=493444824]
scroll_scale = Vector2(1.05, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/midground" unique_id=1705346727]
texture_filter = 1
texture = ExtResource("4_kvuet")
offset = Vector2(720, 240)
[node name="foreground" type="Parallax2D" parent="ParallaxBG" unique_id=1286814424]
scroll_scale = Vector2(1.1, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/foreground" unique_id=1649009743]
texture_filter = 1
texture = ExtResource("5_dinhu")
offset = Vector2(720, 240)
[node name="front" type="Parallax2D" parent="ParallaxBG" unique_id=1280848753]
scroll_scale = Vector2(1.2, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/front" unique_id=1850475926]
texture_filter = 1
texture = ExtResource("13_kvuet")
offset = Vector2(720, 240)
[node name="SceneManager" type="Node2D" parent="." unique_id=195147007] [node name="SceneManager" type="Node2D" parent="." unique_id=195147007]
unique_name_in_owner = true unique_name_in_owner = true
script = ExtResource("2_iywne") script = ExtResource("2_iywne")
[node name="sky" type="Parallax2D" parent="." unique_id=1954892357]
repeat_size = Vector2(1440, 270)
[node name="Sprite2D" type="Sprite2D" parent="sky" unique_id=1505289323]
texture = ExtResource("3_dinhu")
offset = Vector2(720, 240)
[node name="midground" type="Parallax2D" parent="." unique_id=493444824]
scroll_scale = Vector2(1.05, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="midground" unique_id=1705346727]
texture_filter = 1
texture = ExtResource("4_kvuet")
offset = Vector2(720, 240)
[node name="foreground" type="Parallax2D" parent="." unique_id=1286814424]
scroll_scale = Vector2(1.1, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="foreground" unique_id=1649009743]
texture_filter = 1
texture = ExtResource("5_dinhu")
offset = Vector2(720, 240)
[node name="front" type="Parallax2D" parent="." unique_id=1280848753]
scroll_scale = Vector2(1.2, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="front" unique_id=1850475926]
texture_filter = 1
texture = ExtResource("13_kvuet")
offset = Vector2(720, 240)
[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=55809753] [node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=55809753]
texture_filter = 1 texture_filter = 1
tile_map_data = PackedByteArray("AAAVAAwAAQAAAAQAAAAWAAwAAQABAAQAAAAXAAwAAQACAAQAAAAIAA0AAQAEAAEAAAAIAAwAAQAGAAMAAAAIAAsAAQAAAAAAAAAJAAsAAQABAAAAAAAJAAwAAQABAAIAAAAKAAwAAQAHAAAAAAAKAAsAAQABAAAAAAALAAsAAQACAAAAAAALAAwAAQACAAEAAAALAA0AAQACAAIAAAAKAA0AAQAAAAIAAAAOAAoAAQAAAAQAAAAPAAoAAQABAAQAAAAQAAoAAQACAAQAAAAVAAsAAwAAAAAAAAAXAAsAAgAAAAEAAAAXAAoAAgAAAAAAAAAWAAsAAgAAAAEAAAAWAAoAAgAAAAAAAAAIAA4AAQAEAAEAAAApAA4AAQAAAAAAAAAqAA4AAQABAAAAAAArAA4AAQABAAAAAAAsAA4AAQABAAAAAAAsAA8AAQABAAIAAAAtAA8AAQABAAIAAAAtAA4AAQABAAAAAAAuAA4AAQACAAAAAAACAA8AAQAAAAQAAAADAA8AAQABAAQAAAAEAA8AAQABAAQAAAAFAA8AAQABAAQAAAAGAA8AAQABAAQAAAAHAA8AAQABAAQAAAAIAA8AAQAMAAAAAAAJAA8AAQABAAAAAAAKAA8AAQABAAAAAAALAA8AAQABAAAAAAAMAA8AAQABAAAAAAANAA8AAQABAAAAAAAOAA8AAQABAAAAAAAPAA8AAQABAAAAAAAQAA8AAQABAAAAAAARAA8AAQABAAAAAAASAA8AAQABAAAAAAATAA8AAQABAAAAAAAUAA8AAQABAAAAAAAVAA8AAQABAAAAAAAWAA8AAQABAAAAAAAXAA8AAQABAAAAAAAYAA8AAQABAAAAAAAZAA8AAQABAAAAAAAaAA8AAQABAAAAAAAbAA8AAQABAAAAAAAcAA8AAQABAAAAAAAdAA8AAQABAAAAAAAeAA8AAQABAAAAAAAfAA8AAQABAAAAAAAgAA8AAQABAAAAAAAhAA8AAQABAAAAAAAiAA8AAQAJAAMAAAAjAA8AAQABAAQAAAAkAA8AAQABAAQAAAAlAA8AAQABAAQAAAAmAA8AAQABAAQAAAAnAA8AAQABAAQAAAAoAA8AAQABAAQAAAApAA8AAQAKAAQAAAAqAA8AAQABAAIAAAArAA8AAQABAAIAAAAuAA8AAQAJAAQAAAAvAA8AAQABAAQAAAAwAA8AAQABAAQAAAAxAA8AAQABAAQAAAAyAA8AAQABAAQAAAAzAA8AAQABAAQAAAA0AA8AAQABAAQAAAA1AA8AAQABAAQAAAA2AA8AAQABAAQAAAA3AA8AAQABAAQAAAA4AA8AAQABAAQAAAA5AA8AAQABAAQAAAA6AA8AAQABAAQAAAA7AA8AAQABAAQAAAA8AA8AAQABAAQAAAA9AA8AAQABAAQAAAA+AA8AAQABAAQAAAA/AA8AAQABAAQAAABAAA8AAQABAAQAAABBAA8AAQABAAQAAABCAA8AAQABAAQAAABDAA8AAQABAAQAAABEAA8AAQABAAQAAABFAA8AAQABAAQAAABGAA8AAQABAAQAAABHAA8AAQACAAQAAAAZAAoAAQAAAAQAAAAaAAoAAQABAAQAAAAbAAoAAQAQAAQAAAAbAAkAAQAPAAMAAAAcAAkAAQACAAQAAAAdAAcAAQAAAAQAAAAeAAcAAQABAAQAAAAfAAcAAQABAAQAAAAgAAcAAQACAAQAAAAaAAUAAQACAAQAAAAZAAUAAQAPAAQAAAAZAAQAAQAQAAMAAAAYAAQAAQABAAQAAAAXAAQAAQAAAAQAAAAiABMAAQACAAIAAAAiABIAAQACAAEAAAAiABEAAQACAAEAAAAiABAAAQACAAEAAAAhABMAAQABAAIAAAAhABIAAQABAAEAAAAhABEAAQABAAEAAAAhABAAAQABAAEAAAAgABMAAQABAAIAAAAgABIAAQABAAEAAAAgABEAAQABAAEAAAAgABAAAQABAAEAAAAfABMAAQABAAIAAAAfABIAAQABAAEAAAAfABEAAQABAAEAAAAfABAAAQABAAEAAAAeABMAAQABAAIAAAAeABIAAQABAAEAAAAeABEAAQABAAEAAAAeABAAAQABAAEAAAAdABMAAQABAAIAAAAdABIAAQABAAEAAAAdABEAAQABAAEAAAAdABAAAQABAAEAAAAcABMAAQABAAIAAAAcABIAAQABAAEAAAAcABEAAQABAAEAAAAcABAAAQABAAEAAAAbABMAAQABAAIAAAAbABIAAQABAAEAAAAbABEAAQABAAEAAAAbABAAAQABAAEAAAAaABMAAQABAAIAAAAaABIAAQABAAEAAAAaABEAAQABAAEAAAAaABAAAQABAAEAAAAZABMAAQABAAIAAAAZABIAAQABAAEAAAAZABEAAQABAAEAAAAZABAAAQABAAEAAAAYABMAAQABAAIAAAAYABIAAQABAAEAAAAYABEAAQABAAEAAAAYABAAAQABAAEAAAAXABMAAQABAAIAAAAXABIAAQABAAEAAAAXABEAAQABAAEAAAAXABAAAQABAAEAAAAWABMAAQABAAIAAAAWABIAAQABAAEAAAAWABEAAQABAAEAAAAWABAAAQABAAEAAAAVABMAAQABAAIAAAAVABIAAQABAAEAAAAVABEAAQABAAEAAAAVABAAAQABAAEAAAAUABMAAQABAAIAAAAUABIAAQABAAEAAAAUABEAAQABAAEAAAAUABAAAQABAAEAAAATABMAAQABAAIAAAATABIAAQABAAEAAAATABEAAQABAAEAAAATABAAAQABAAEAAAASABMAAQABAAIAAAASABIAAQABAAEAAAASABEAAQABAAEAAAASABAAAQABAAEAAAARABMAAQABAAIAAAARABIAAQABAAEAAAARABEAAQABAAEAAAARABAAAQABAAEAAAAQABMAAQABAAIAAAAQABIAAQABAAEAAAAQABEAAQABAAEAAAAQABAAAQABAAEAAAAPABMAAQABAAIAAAAPABIAAQABAAEAAAAPABEAAQABAAEAAAAPABAAAQABAAEAAAAOABMAAQABAAIAAAAOABIAAQABAAEAAAAOABEAAQABAAEAAAAOABAAAQABAAEAAAANABMAAQABAAIAAAANABIAAQABAAEAAAANABEAAQABAAEAAAANABAAAQABAAEAAAAMABMAAQABAAIAAAAMABIAAQABAAEAAAAMABEAAQABAAEAAAAMABAAAQABAAEAAAALABMAAQABAAIAAAALABIAAQABAAEAAAALABEAAQABAAEAAAALABAAAQABAAEAAAAKABMAAQABAAIAAAAKABIAAQABAAEAAAAKABEAAQABAAEAAAAKABAAAQABAAEAAAAJABMAAQABAAIAAAAJABIAAQABAAEAAAAJABEAAQABAAEAAAAJABAAAQABAAEAAAAIABMAAQAAAAIAAAAIABIAAQAAAAEAAAAIABEAAQAAAAEAAAAIABAAAQAAAAEAAAA=") tile_map_data = PackedByteArray("AAAVAAwAAQAAAAQAAAAWAAwAAQABAAQAAAAXAAwAAQACAAQAAAAIAA0AAQAEAAEAAAAIAAwAAQAGAAMAAAAIAAsAAQAAAAAAAAAJAAsAAQABAAAAAAAJAAwAAQABAAIAAAAKAAwAAQAHAAAAAAAKAAsAAQABAAAAAAALAAsAAQACAAAAAAALAAwAAQACAAEAAAALAA0AAQACAAIAAAAKAA0AAQAAAAIAAAAOAAoAAQAAAAQAAAAPAAoAAQABAAQAAAAQAAoAAQACAAQAAAAVAAsAAwAAAAAAAAAXAAsAAgAAAAEAAAAXAAoAAgAAAAAAAAAWAAsAAgAAAAEAAAAWAAoAAgAAAAAAAAAIAA4AAQAEAAEAAAApAA4AAQAAAAAAAAAqAA4AAQABAAAAAAArAA4AAQABAAAAAAAsAA4AAQABAAAAAAAsAA8AAQABAAIAAAAtAA8AAQABAAIAAAAtAA4AAQABAAAAAAAuAA4AAQACAAAAAAACAA8AAQAAAAQAAAADAA8AAQABAAQAAAAEAA8AAQABAAQAAAAFAA8AAQABAAQAAAAGAA8AAQABAAQAAAAHAA8AAQABAAQAAAAIAA8AAQAMAAAAAAAJAA8AAQABAAAAAAAKAA8AAQABAAAAAAALAA8AAQABAAAAAAAMAA8AAQABAAAAAAANAA8AAQABAAAAAAAOAA8AAQABAAAAAAAPAA8AAQABAAAAAAAQAA8AAQABAAAAAAARAA8AAQABAAAAAAASAA8AAQABAAAAAAATAA8AAQABAAAAAAAUAA8AAQABAAAAAAAVAA8AAQABAAAAAAAWAA8AAQABAAAAAAAXAA8AAQABAAAAAAAYAA8AAQABAAAAAAAZAA8AAQABAAAAAAAaAA8AAQABAAAAAAAbAA8AAQABAAAAAAAcAA8AAQABAAAAAAAdAA8AAQABAAAAAAAeAA8AAQABAAAAAAAfAA8AAQABAAAAAAAgAA8AAQABAAAAAAAhAA8AAQABAAAAAAAiAA8AAQAJAAMAAAAjAA8AAQABAAQAAAAkAA8AAQABAAQAAAAlAA8AAQABAAQAAAAmAA8AAQABAAQAAAAnAA8AAQABAAQAAAAoAA8AAQABAAQAAAApAA8AAQAKAAQAAAAqAA8AAQABAAIAAAArAA8AAQABAAIAAAAuAA8AAQAJAAQAAAAvAA8AAQABAAQAAAAwAA8AAQABAAQAAAAxAA8AAQABAAQAAAAyAA8AAQABAAQAAAAzAA8AAQABAAQAAAA0AA8AAQABAAQAAAA1AA8AAQABAAQAAAA2AA8AAQABAAQAAAA3AA8AAQABAAQAAAA4AA8AAQABAAQAAAA5AA8AAQABAAQAAAA6AA8AAQABAAQAAAA7AA8AAQABAAQAAAA8AA8AAQABAAQAAAA9AA8AAQABAAQAAAA+AA8AAQABAAQAAAA/AA8AAQABAAQAAABAAA8AAQABAAQAAABBAA8AAQABAAQAAABCAA8AAQABAAQAAABDAA8AAQABAAQAAABEAA8AAQABAAQAAABFAA8AAQABAAQAAABGAA8AAQABAAQAAABHAA8AAQACAAQAAAAZAAoAAQAAAAQAAAAaAAoAAQABAAQAAAAbAAoAAQAQAAQAAAAbAAkAAQAPAAMAAAAcAAkAAQACAAQAAAAdAAcAAQAAAAQAAAAeAAcAAQABAAQAAAAfAAcAAQABAAQAAAAgAAcAAQACAAQAAAAaAAUAAQACAAQAAAAZAAUAAQAPAAQAAAAZAAQAAQAQAAMAAAAYAAQAAQABAAQAAAAXAAQAAQAAAAQAAAAiABMAAQACAAIAAAAiABIAAQACAAEAAAAiABEAAQACAAEAAAAiABAAAQACAAEAAAAhABMAAQABAAIAAAAhABIAAQABAAEAAAAhABEAAQABAAEAAAAhABAAAQABAAEAAAAgABMAAQABAAIAAAAgABIAAQABAAEAAAAgABEAAQABAAEAAAAgABAAAQABAAEAAAAfABMAAQABAAIAAAAfABIAAQABAAEAAAAfABEAAQABAAEAAAAfABAAAQABAAEAAAAeABMAAQABAAIAAAAeABIAAQABAAEAAAAeABEAAQABAAEAAAAeABAAAQABAAEAAAAdABMAAQABAAIAAAAdABIAAQABAAEAAAAdABEAAQABAAEAAAAdABAAAQABAAEAAAAcABMAAQABAAIAAAAcABIAAQABAAEAAAAcABEAAQABAAEAAAAcABAAAQABAAEAAAAbABMAAQABAAIAAAAbABIAAQABAAEAAAAbABEAAQABAAEAAAAbABAAAQABAAEAAAAaABMAAQABAAIAAAAaABIAAQABAAEAAAAaABEAAQABAAEAAAAaABAAAQABAAEAAAAZABMAAQABAAIAAAAZABIAAQABAAEAAAAZABEAAQABAAEAAAAZABAAAQABAAEAAAAYABMAAQABAAIAAAAYABIAAQABAAEAAAAYABEAAQABAAEAAAAYABAAAQABAAEAAAAXABMAAQABAAIAAAAXABIAAQABAAEAAAAXABEAAQABAAEAAAAXABAAAQABAAEAAAAWABMAAQABAAIAAAAWABIAAQABAAEAAAAWABEAAQABAAEAAAAWABAAAQABAAEAAAAVABMAAQABAAIAAAAVABIAAQABAAEAAAAVABEAAQABAAEAAAAVABAAAQABAAEAAAAUABMAAQABAAIAAAAUABIAAQABAAEAAAAUABEAAQABAAEAAAAUABAAAQABAAEAAAATABMAAQABAAIAAAATABIAAQABAAEAAAATABEAAQABAAEAAAATABAAAQABAAEAAAASABMAAQABAAIAAAASABIAAQABAAEAAAASABEAAQABAAEAAAASABAAAQABAAEAAAARABMAAQABAAIAAAARABIAAQABAAEAAAARABEAAQABAAEAAAARABAAAQABAAEAAAAQABMAAQABAAIAAAAQABIAAQABAAEAAAAQABEAAQABAAEAAAAQABAAAQABAAEAAAAPABMAAQABAAIAAAAPABIAAQABAAEAAAAPABEAAQABAAEAAAAPABAAAQABAAEAAAAOABMAAQABAAIAAAAOABIAAQABAAEAAAAOABEAAQABAAEAAAAOABAAAQABAAEAAAANABMAAQABAAIAAAANABIAAQABAAEAAAANABEAAQABAAEAAAANABAAAQABAAEAAAAMABMAAQABAAIAAAAMABIAAQABAAEAAAAMABEAAQABAAEAAAAMABAAAQABAAEAAAALABMAAQABAAIAAAALABIAAQABAAEAAAALABEAAQABAAEAAAALABAAAQABAAEAAAAKABMAAQABAAIAAAAKABIAAQABAAEAAAAKABEAAQABAAEAAAAKABAAAQABAAEAAAAJABMAAQABAAIAAAAJABIAAQABAAEAAAAJABEAAQABAAEAAAAJABAAAQABAAEAAAAIABMAAQAAAAIAAAAIABIAAQAAAAEAAAAIABEAAQAAAAEAAAAIABAAAQAAAAEAAAA=")
tile_set = SubResource("TileSet_0tnpc") tile_set = SubResource("TileSet_0tnpc")
[node name="Player" parent="." unique_id=161143934 instance=ExtResource("3_iywne")]
position = Vector2(534, 405)
[node name="Triggers" type="Node2D" parent="." unique_id=1411399015] [node name="Triggers" type="Node2D" parent="." unique_id=1411399015]
[node name="Trigger" parent="Triggers" unique_id=1908774248 instance=ExtResource("4_lbhrr")] [node name="Trigger" parent="Triggers" unique_id=1908774248 instance=ExtResource("4_lbhrr")]
@ -495,5 +494,24 @@ metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Level/StaticBody2D2" unique_id=895098891] [node name="CollisionShape2D" type="CollisionShape2D" parent="Level/StaticBody2D2" unique_id=895098891]
shape = SubResource("WorldBoundaryShape2D_lbhrr") shape = SubResource("WorldBoundaryShape2D_lbhrr")
[node name="Player" parent="." unique_id=161143934 instance=ExtResource("3_iywne")]
position = Vector2(503, 290)
[node name="NPCCharacter" parent="." unique_id=597270257 instance=ExtResource("6_u5sy4")] [node name="NPCCharacter" parent="." unique_id=597270257 instance=ExtResource("6_u5sy4")]
position = Vector2(103, 417) position = Vector2(-74, 277)
[node name="Coins" type="Node2D" parent="." unique_id=935250051]
[node name="Coin" parent="Coins" unique_id=1684921412 instance=ExtResource("13_trtic")]
position = Vector2(362, 342)
[node name="Coin2" parent="Coins" unique_id=1619880767 instance=ExtResource("13_trtic")]
position = Vector2(457, 467)
[node name="Enemies" type="Node2D" parent="." unique_id=566614095]
[node name="Slime" parent="Enemies" unique_id=1858169899 instance=ExtResource("14_trtic")]
position = Vector2(468, 311)
[node name="Slime2" parent="Enemies" unique_id=107350283 instance=ExtResource("14_trtic")]
position = Vector2(536, 310)

499
scenes/level2.tscn Normal file
View File

@ -0,0 +1,499 @@
[gd_scene format=4 uid="uid://b55m034wxs2j0"]
[ext_resource type="Script" uid="uid://ch2id76i14srx" path="res://scripts/scene_manager.gd" id="1_8g4ke"]
[ext_resource type="Texture2D" uid="uid://c7e3bo3gav3ou" path="res://assets/graphics/environment/terrain/bg/background B layer1.png" id="2_56gwk"]
[ext_resource type="Texture2D" uid="uid://c1j311070sb45" path="res://assets/graphics/environment/terrain/bg/background B layer2.png" id="3_ve5ok"]
[ext_resource type="Texture2D" uid="uid://ct213btxq11pv" path="res://assets/graphics/environment/terrain/bg/background B layer3.png" id="4_cleqw"]
[ext_resource type="Texture2D" uid="uid://cufqer3a7texm" path="res://assets/graphics/environment/terrain/bg/background B layer4.png" id="5_wvb8j"]
[ext_resource type="Texture2D" uid="uid://c54wxruqqye2h" path="res://assets/graphics/environment/terrain/Terrain (32x32).png" id="6_g8vcy"]
[ext_resource type="Texture2D" uid="uid://ssc8drrfnu72" path="res://assets/graphics/environment/terrain/mushroom_32x64.png" id="7_cqal4"]
[ext_resource type="Texture2D" uid="uid://6jv2l35y03f" path="res://assets/graphics/environment/terrain/veg_32x32.png" id="8_o3sye"]
[ext_resource type="PackedScene" uid="uid://s0utas3jmhjk" path="res://scenes/player.tscn" id="9_24ks5"]
[ext_resource type="PackedScene" uid="uid://bf50mxdma8wq4" path="res://scenes/trigger.tscn" id="10_s4es8"]
[ext_resource type="PackedScene" uid="uid://b6lw2go5mwk3h" path="res://scenes/crate.tscn" id="11_63e4f"]
[ext_resource type="PackedScene" uid="uid://bgi18lbutp5ui" path="res://scenes/npc_character.tscn" id="12_y6lc1"]
[sub_resource type="TileMapPattern" id="TileMapPattern_u5sy4"]
tile_data = PackedInt32Array(0, 1, 0, 65536, 1, 1, 131072, 1, 1, 196608, 1, 2, 1, 65537, 0, 65537, 65537, 1, 131073, 131073, 1, 196609, 65537, 2, 2, 65537, 0, 65538, 131073, 1, 131074, 65537, 1, 196610, 65537, 2, 3, 131073, 0, 65539, 262145, 1, 131075, 131073, 1, 196611, 131073, 2)
[sub_resource type="TileMapPattern" id="TileMapPattern_gee14"]
tile_data = PackedInt32Array(65536, 1, 0, 131072, 1, 1, 196608, 1, 2, 65537, 65537, 0, 131073, 65537, 1, 196609, 65537, 2, 2, 1, 0, 65538, 65537, 1, 131074, 65537, 1, 196610, 65537, 1, 262146, 1, 1, 327682, 1, 2, 3, 65537, 0, 65539, 65537, 1, 131075, 65537, 1, 196611, 131073, 1, 262147, 131073, 1, 327683, 131073, 2, 4, 131073, 0, 65540, 131073, 1, 131076, 131073, 2)
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_gee14"]
texture = ExtResource("6_g8vcy")
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, 15.294277)
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, 15.294277)
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, 15.294277)
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/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
15:0/0/terrains_peering_bit/top_right_corner = 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, -0.31863022, -16, 0, 16, -16, 15.294277)
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(1.5931549, -16, 16, -16, 16, 16, 2.2304153, 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/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/left_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/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, -16, 15.294277)
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, -1.9117851, 16, -1.2745228, 16, 16, -16, 15.294277)
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, 15.294277)
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, -2.8676777, -16, -1.9117851, 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.2745209, -16, 16, -16, 16, 16, 0.63726044, 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, 0.95589066, -16, 0.63726044)
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, 0.95589066, -16, 0.63726044)
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, 16, -16, 16, 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, 16, -16, 16)
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, 7.6471367, 10.196182, 16, -7.3285084, 16, -16, 6.691246)
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, -2.8676777, -16, -1.9117851, 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.2745209, -16, 16, -16, 16, 16, 0.63726044, 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, 16, 0, 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, 16, 0, 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, -16, 16, -16, 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(-16, -16, 16, -16, 16, 16, -16, 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="TileSetAtlasSource" id="TileSetAtlasSource_kvuet"]
texture = ExtResource("7_cqal4")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrains_peering_bit/bottom_side = 1
0:1/0 = 0
0:1/0/terrain_set = 0
0:1/0/terrain = 1
0:1/0/terrains_peering_bit/top_side = 1
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_trtic"]
texture = ExtResource("8_o3sye")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 1
[sub_resource type="TileSet" id="TileSet_0tnpc"]
tile_size = Vector2i(32, 32)
physics_layer_0/collision_layer = 1
terrain_set_0/mode = 0
terrain_set_0/terrain_0/name = "LeafyDirt"
terrain_set_0/terrain_0/color = Color(0.5, 0.34375, 0.25, 1)
terrain_set_0/terrain_1/name = "Veg 1"
terrain_set_0/terrain_1/color = Color(0.5, 0.4375, 0.25, 1)
sources/1 = SubResource("TileSetAtlasSource_gee14")
sources/2 = SubResource("TileSetAtlasSource_kvuet")
sources/3 = SubResource("TileSetAtlasSource_trtic")
pattern_0 = SubResource("TileMapPattern_u5sy4")
pattern_1 = SubResource("TileMapPattern_gee14")
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_lbhrr"]
[node name="Game" type="Node2D" unique_id=239599901]
[node name="ParallaxBG" type="Node2D" parent="." unique_id=87624809]
[node name="sky" type="Parallax2D" parent="ParallaxBG" unique_id=1954892357]
repeat_size = Vector2(1440, 270)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/sky" unique_id=1505289323]
texture = ExtResource("2_56gwk")
offset = Vector2(720, 240)
[node name="midground" type="Parallax2D" parent="ParallaxBG" unique_id=493444824]
scroll_scale = Vector2(1.05, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/midground" unique_id=1705346727]
texture_filter = 1
texture = ExtResource("3_ve5ok")
offset = Vector2(720, 240)
[node name="foreground" type="Parallax2D" parent="ParallaxBG" unique_id=1286814424]
scroll_scale = Vector2(1.1, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/foreground" unique_id=1649009743]
texture_filter = 1
texture = ExtResource("4_cleqw")
offset = Vector2(720, 240)
[node name="front" type="Parallax2D" parent="ParallaxBG" unique_id=1280848753]
scroll_scale = Vector2(1.2, 1)
repeat_size = Vector2(1440, 0)
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBG/front" unique_id=1850475926]
texture_filter = 1
texture = ExtResource("5_wvb8j")
offset = Vector2(720, 240)
[node name="SceneManager" type="Node2D" parent="." unique_id=195147007]
unique_name_in_owner = true
script = ExtResource("1_8g4ke")
[node name="TileMapLayer" type="TileMapLayer" parent="." unique_id=55809753]
texture_filter = 1
tile_map_data = PackedByteArray("AAAXAAwAAQAEAAQAAAAIAA0AAQAEAAEAAAAIAAwAAQAGAAMAAAAIAAsAAQAAAAAAAAAJAAsAAQABAAAAAAAJAAwAAQABAAIAAAAKAAwAAQAHAAAAAAAKAAsAAQABAAAAAAALAAsAAQABAAAAAAALAAwAAQAGAAAAAAALAA0AAQABAAIAAAAKAA0AAQAAAAIAAAAVAAsAAwAAAAAAAAAIAA4AAQAEAAEAAAApAA4AAQAAAAAAAAAqAA4AAQABAAAAAAArAA4AAQABAAAAAAAsAA4AAQABAAAAAAAsAA8AAQABAAIAAAAtAA8AAQABAAIAAAAtAA4AAQABAAAAAAAuAA4AAQACAAAAAAACAA8AAQAAAAQAAAADAA8AAQABAAQAAAAEAA8AAQABAAQAAAAFAA8AAQABAAQAAAAGAA8AAQABAAQAAAAHAA8AAQABAAQAAAAIAA8AAQAMAAAAAAAJAA8AAQABAAAAAAAKAA8AAQABAAAAAAALAA8AAQABAAAAAAAMAA8AAQABAAAAAAANAA8AAQABAAAAAAAOAA8AAQABAAAAAAAPAA8AAQAHAAEAAAAQAA8AAQAGAAAAAAARAA8AAQAGAAAAAAASAA8AAQAGAAAAAAATAA8AAQAGAAAAAAAUAA8AAQAGAAAAAAAVAA8AAQAGAAAAAAAWAA8AAQAGAAEAAAAXAA8AAQABAAAAAAAYAA8AAQABAAAAAAAZAA8AAQABAAAAAAAaAA8AAQABAAAAAAAbAA8AAQABAAAAAAAcAA8AAQABAAAAAAAdAA8AAQABAAAAAAAeAA8AAQABAAAAAAAfAA8AAQABAAAAAAAgAA8AAQABAAAAAAAhAA8AAQABAAAAAAAiAA8AAQAJAAMAAAAjAA8AAQABAAQAAAAkAA8AAQABAAQAAAAlAA8AAQABAAQAAAAmAA8AAQABAAQAAAAnAA8AAQABAAQAAAAoAA8AAQABAAQAAAApAA8AAQAKAAQAAAAqAA8AAQABAAIAAAArAA8AAQABAAIAAAAuAA8AAQAJAAQAAAAvAA8AAQABAAQAAAAwAA8AAQABAAQAAAAxAA8AAQABAAQAAAAyAA8AAQABAAQAAAAzAA8AAQABAAQAAAA0AA8AAQABAAQAAAA1AA8AAQABAAQAAAA2AA8AAQABAAQAAAA3AA8AAQABAAQAAAA4AA8AAQABAAQAAAA5AA8AAQABAAQAAAA6AA8AAQABAAQAAAA7AA8AAQABAAQAAAA8AA8AAQABAAQAAAA9AA8AAQABAAQAAAA+AA8AAQABAAQAAAA/AA8AAQABAAQAAABAAA8AAQABAAQAAABBAA8AAQABAAQAAABCAA8AAQABAAQAAABDAA8AAQABAAQAAABEAA8AAQABAAQAAABFAA8AAQABAAQAAABGAA8AAQABAAQAAABHAA8AAQACAAQAAAAZAAoAAQAAAAQAAAAaAAoAAQABAAQAAAAbAAoAAQAQAAQAAAAbAAkAAQAPAAMAAAAcAAkAAQACAAQAAAAdAAcAAQAAAAQAAAAeAAcAAQABAAQAAAAfAAcAAQABAAQAAAAgAAcAAQACAAQAAAAaAAUAAQACAAQAAAAZAAUAAQAPAAQAAAAZAAQAAQAQAAMAAAAYAAQAAQABAAQAAAAXAAQAAQAAAAQAAAAiABMAAQACAAIAAAAiABIAAQACAAEAAAAiABEAAQACAAEAAAAiABAAAQACAAEAAAAhABMAAQABAAIAAAAhABIAAQABAAEAAAAhABEAAQABAAEAAAAhABAAAQABAAEAAAAgABMAAQABAAIAAAAgABIAAQABAAEAAAAgABEAAQABAAEAAAAgABAAAQABAAEAAAAfABMAAQABAAIAAAAfABIAAQABAAEAAAAfABEAAQABAAEAAAAfABAAAQABAAEAAAAeABMAAQABAAIAAAAeABIAAQABAAEAAAAeABEAAQABAAEAAAAeABAAAQABAAEAAAAdABMAAQABAAIAAAAdABIAAQABAAEAAAAdABEAAQABAAEAAAAdABAAAQABAAEAAAAcABMAAQABAAIAAAAcABIAAQABAAEAAAAcABEAAQABAAEAAAAcABAAAQABAAEAAAAbABMAAQABAAIAAAAbABIAAQABAAEAAAAbABEAAQABAAEAAAAbABAAAQABAAEAAAAaABMAAQABAAIAAAAaABIAAQABAAEAAAAaABEAAQABAAEAAAAaABAAAQABAAEAAAAZABMAAQABAAIAAAAZABIAAQABAAEAAAAZABEAAQABAAEAAAAZABAAAQABAAEAAAAYABMAAQABAAIAAAAYABIAAQABAAEAAAAYABEAAQABAAEAAAAYABAAAQABAAEAAAAXABMAAQABAAIAAAAXABIAAQABAAEAAAAXABEAAQABAAEAAAAXABAAAQABAAEAAAAWABMAAQABAAIAAAAWABIAAQABAAEAAAAWABEAAQABAAEAAAAWABAAAQABAAEAAAAVABMAAQABAAIAAAAVABIAAQABAAEAAAAVABEAAQABAAEAAAAVABAAAQABAAEAAAAUABMAAQABAAIAAAAUABIAAQABAAEAAAAUABEAAQABAAEAAAAUABAAAQABAAEAAAATABMAAQABAAIAAAATABIAAQABAAEAAAATABEAAQABAAEAAAATABAAAQABAAEAAAASABMAAQABAAIAAAASABIAAQABAAEAAAASABEAAQABAAEAAAASABAAAQABAAEAAAARABMAAQABAAIAAAARABIAAQABAAEAAAARABEAAQABAAEAAAARABAAAQABAAEAAAAQABMAAQABAAIAAAAQABIAAQABAAEAAAAQABEAAQABAAEAAAAQABAAAQABAAEAAAAPABMAAQABAAIAAAAPABIAAQABAAEAAAAPABEAAQABAAEAAAAPABAAAQABAAEAAAAOABMAAQABAAIAAAAOABIAAQABAAEAAAAOABEAAQABAAEAAAAOABAAAQABAAEAAAANABMAAQABAAIAAAANABIAAQABAAEAAAANABEAAQABAAEAAAANABAAAQABAAEAAAAMABMAAQABAAIAAAAMABIAAQABAAEAAAAMABEAAQABAAEAAAAMABAAAQABAAEAAAALABMAAQABAAIAAAALABIAAQABAAEAAAALABEAAQABAAEAAAALABAAAQABAAEAAAAKABMAAQABAAIAAAAKABIAAQABAAEAAAAKABEAAQABAAEAAAAKABAAAQABAAEAAAAJABMAAQABAAIAAAAJABIAAQABAAEAAAAJABEAAQABAAEAAAAJABAAAQABAAEAAAAIABMAAQAAAAIAAAAIABIAAQAAAAEAAAAIABEAAQAAAAEAAAAIABAAAQAAAAEAAAAPAA4AAQAAAAAAAAAQAA4AAQABAAAAAAARAA4AAQABAAAAAAASAA4AAQABAAAAAAATAA4AAQABAAAAAAAUAA4AAQABAAAAAAAVAA4AAQABAAAAAAAWAA4AAQACAAAAAAAMAA0AAQACAAIAAAAMAAwAAQACAAEAAAAMAAsAAQACAAAAAAARAAkAAQAAAAQAAAASAAkAAQABAAQAAAATAAkAAQABAAQAAAAUAAkAAQACAAQAAAA=")
tile_set = SubResource("TileSet_0tnpc")
[node name="Player" parent="." unique_id=161143934 instance=ExtResource("9_24ks5")]
position = Vector2(534, 405)
[node name="Triggers" type="Node2D" parent="." unique_id=1411399015]
[node name="Trigger" parent="Triggers" unique_id=1908774248 instance=ExtResource("10_s4es8")]
position = Vector2(-139, 444)
effect = "destroy"
[node name="Trigger2" parent="Triggers" unique_id=1627494044 instance=ExtResource("10_s4es8")]
position = Vector2(-152, 261)
effect = "teleport"
[node name="Trigger3" parent="Triggers" unique_id=1618797258 instance=ExtResource("10_s4es8")]
position = Vector2(-96, 142)
effect = "powerup"
[node name="Crates" type="Node2D" parent="." unique_id=1983554973]
[node name="Crate" parent="Crates" unique_id=1307809047 instance=ExtResource("11_63e4f")]
position = Vector2(690, 346)
[node name="Crate2" parent="Crates" unique_id=1988562966 instance=ExtResource("11_63e4f")]
position = Vector2(580, 400)
[node name="Crate3" parent="Crates" unique_id=1771442258 instance=ExtResource("11_63e4f")]
position = Vector2(575, 255)
[node name="Crate4" parent="Crates" unique_id=34543093 instance=ExtResource("11_63e4f")]
position = Vector2(609, 394)
[node name="Level" type="Node2D" parent="." unique_id=1225714734]
[node name="StaticBody2D2" type="StaticBody2D" parent="Level" unique_id=426786591]
position = Vector2(597, 636)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="Level/StaticBody2D2" unique_id=895098891]
shape = SubResource("WorldBoundaryShape2D_lbhrr")
[node name="NPCCharacter" parent="." unique_id=597270257 instance=ExtResource("12_y6lc1")]
position = Vector2(103, 417)

71
scenes/slime.tscn Normal file
View File

@ -0,0 +1,71 @@
[gd_scene format=3 uid="uid://dkht2dvm4ob7d"]
[ext_resource type="Texture2D" uid="uid://c00c0x1qv83o1" path="res://assets/graphics/enemies/slime_green.png" id="1_371uh"]
[ext_resource type="Script" uid="uid://c8o8u4tesokv5" path="res://scripts/slime.gd" id="1_p2gj0"]
[sub_resource type="CircleShape2D" id="CircleShape2D_p2gj0"]
[sub_resource type="AtlasTexture" id="AtlasTexture_n6pvg"]
atlas = ExtResource("1_371uh")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_pjw23"]
atlas = ExtResource("1_371uh")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_2npkn"]
atlas = ExtResource("1_371uh")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_fd6lc"]
atlas = ExtResource("1_371uh")
region = Rect2(72, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_gstla"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_n6pvg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pjw23")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2npkn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fd6lc")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="Slime" type="Area2D" unique_id=1858169899]
script = ExtResource("1_p2gj0")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1326300520]
shape = SubResource("CircleShape2D_p2gj0")
debug_color = Color(0.32381785, 0.6223806, 0.15175426, 0.41960785)
[node name="SlimeGraphic" type="AnimatedSprite2D" parent="." unique_id=1596575911]
texture_filter = 1
position = Vector2(0, -2)
sprite_frames = SubResource("SpriteFrames_gstla")
autoplay = "default"
[node name="RightCast" type="RayCast2D" parent="." unique_id=1564439268]
target_position = Vector2(16, 0)
[node name="LeftCast" type="RayCast2D" parent="." unique_id=1316242758]
target_position = Vector2(-16, 0)
[node name="LeftDownCast" type="RayCast2D" parent="." unique_id=1465075999]
position = Vector2(-9, 0)
target_position = Vector2(0, 12)
[node name="RightDownCast" type="RayCast2D" parent="." unique_id=1510899118]
position = Vector2(10, 0)
target_position = Vector2(0, 12)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

9
scripts/coin.gd Normal file
View File

@ -0,0 +1,9 @@
class_name Coin extends Area2D
signal coinCollectedSignal(body, coin)
func _on_body_entered(body: Node2D) -> void:
if body is Player:
print("Player hit coin")
coinCollectedSignal.emit(body, self)

1
scripts/coin.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://b3dvuwq5c8l4h

View File

@ -4,10 +4,20 @@ var crateTotal = 0
signal destroySignal(body) signal destroySignal(body)
signal teleportSignal(body) signal teleportSignal(body)
signal levelChangeSignal(level) signal levelChangeSignal(level)
var currentScene:String = "res://scenes/game.tscn"
var coinsCollected = 0
var timer := Timer.new() var timer := Timer.new()
var timeAvailable := 10
#Level Handling
var levels=["res://scenes/game.tscn","res://scenes/level2.tscn"]
var timers=[16,10]
var currentLevel = 0
var timeAvailable = timers[currentLevel]
var enemiesDict={}
var playerStartingHealth = 50
var playerHealth = 50
# 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:
@ -18,17 +28,36 @@ func _ready() -> void:
timer.connect("timeout", secondCounter) timer.connect("timeout", secondCounter)
timer.start() timer.start()
#Scene Handling
# called by the scenemanager upon scene load
func reset()->void:
# reset the time
timeAvailable = timers[currentLevel]
enemiesDict.clear()
playerHealth = playerStartingHealth
#Time Handling
func secondCounter()->void: func secondCounter()->void:
timeAvailable -=1 timeAvailable -=1
if timeAvailable <=0: if timeAvailable <=0:
print("YOU LOSE BABY!!") print("YOU LOSE BABY!!")
levelChangeSignal.emit(currentScene) levelChangeSignal.emit(levels[currentLevel])
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
#Coin Handling
func _on_coin_collected(body:Player, coin:Coin)-> void:
coinsCollected +=1
destroySignal.emit(coin)
#Any time coins are destroyed, game controller is informed how many left
func totalCoins(value)-> void:
if value <=0:
print("You WON!!!")
currentLevel +=1
if currentLevel >= levels.size():
currentLevel = 0
levelChangeSignal.emit(levels[currentLevel])
#Triggers are area traps
func _on_trigger(body: Variant, effect, trigger) -> void: func _on_trigger(body: Variant, effect, trigger) -> void:
print("GC knows trigger...."+effect) print("GC knows trigger...."+effect)
if body is Crate: if body is Crate:
@ -45,16 +74,48 @@ func _on_trigger(body: Variant, effect, trigger) -> void:
print("GC knows about powerup") print("GC knows about powerup")
timeAvailable +=5 timeAvailable +=5
destroySignal.emit(trigger) destroySignal.emit(trigger)
#Enemy Handling
func _on_slime_damage(body, slime)->void:
# print("Slime attacked player for "+str(enemiesDict[slime]["damage"]))
playerHealth -= enemiesDict[slime]["damage"]
if playerHealth<=0:
print("PLAYER KILLED!")
#reload current level
levelChangeSignal.emit(levels[currentLevel])
func totalEnemies(value)->void:
print("Number of Enemies: "+str(value))
func addEnemyToLevel(slime:Slime)->void:
#random number up to 10
var randDamage:int = randi()%10
var enemyStat = {
"health":50,
"damage":randDamage
}
#store in the enemy Dictionary
enemiesDict[slime]=enemyStat
func removeEnemyFromLevel(slime)->void:
enemiesDict.erase(slime)
func crateUpdate(cratesAmount)->void: func crateUpdate(cratesAmount)->void:
crateTotal = cratesAmount crateTotal = cratesAmount
print("GC updated crates: "+str(crateTotal)) print("GC updated crates: "+str(crateTotal))
if crateTotal <=0: if crateTotal <=0:
print("You WON!!!") print("You WON!!!")
levelChangeSignal.emit(currentScene) currentLevel +=1
if currentLevel >= levels.size():
currentLevel = 0
levelChangeSignal.emit(levels[currentLevel])
func bulletDamage(body:Node2D, bullet:Bullet)->void: func bulletDamage(body:Node2D, bullet:Bullet)->void:
if body is Crate: if body is Crate:
#destroy crate #destroy crate
destroySignal.emit(body) destroySignal.emit(body)
destroySignal.emit(bullet) destroySignal.emit(bullet)
#Update to damage Slime Enemies
if body is Slime:
#damage the slime
enemiesDict[body]["health"] -= 10
if enemiesDict[body]["health"] <=0:
removeEnemyFromLevel(body)
destroySignal.emit(body)
destroySignal.emit(bullet)

View File

@ -2,7 +2,8 @@ class_name SceneManager extends Node2D
@onready var triggers: Node2D = $"../Triggers" @onready var triggers: Node2D = $"../Triggers"
@onready var crates: Node2D = $"../Crates" @onready var crates: Node2D = $"../Crates"
@onready var level: Node2D = $"../Level" @onready var level: Node2D = $"../Level"
@onready var game: GameController = $".." @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[Bullet] = [] var bulletArray:Array[Bullet] = []
@ -10,6 +11,9 @@ var totalAllowedBullets:int = 7
# 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:
# Reset all the stuff in the level
Gamecontroller.reset()
buildLevel() buildLevel()
@ -19,20 +23,50 @@ func _process(delta: float) -> void:
func buildLevel()->void: func buildLevel()->void:
print("building level") print("building level")
updateCoins()
updateCrates() updateCrates()
updateTriggers() updateTriggers()
updateEnemies()
#wire up signals from GameController #wire up signals from GameController
game.destroySignal.connect(destroy) Gamecontroller.destroySignal.connect(destroy)
game.teleportSignal.connect(teleport) Gamecontroller.teleportSignal.connect(teleport)
game.levelChangeSignal.connect(loadLevel) Gamecontroller.levelChangeSignal.connect(loadLevel)
func updateEnemies()->void:
if enemies:
var totalEnemies = 0
for obj in enemies.get_children():
if obj is Slime:
totalEnemies +=1
if not obj.slimeDamageSignal.is_connected(Gamecontroller._on_slime_damage):
print("Hooking up slime")
obj.slimeDamageSignal.connect(Gamecontroller._on_slime_damage)
Gamecontroller.addEnemyToLevel(obj)
if not obj.tree_exited.is_connected(updateEnemies):
obj.tree_exited.connect(updateEnemies)
Gamecontroller.totalEnemies(totalEnemies)
func updateCoins()->void:
if coins:
var totalCoins = 0
for obj in coins.get_children():
if obj is Coin:
totalCoins +=1
print("coin found")
if not obj.coinCollectedSignal.is_connected(Gamecontroller._on_coin_collected):
obj.coinCollectedSignal.connect(Gamecontroller._on_coin_collected)
#Any time a coin is destroyed, let game controller know how many remain
if not obj.tree_exited.is_connected(updateCoins):
obj.tree_exited.connect(updateCoins)
Gamecontroller.totalCoins(totalCoins)
func updateTriggers()->void: func updateTriggers()->void:
if triggers: if triggers:
for obj in triggers.get_children(): for obj in triggers.get_children():
if obj is Trigger: if obj is Trigger:
if not obj.AreaTrigger.is_connected(game._on_trigger): if not obj.AreaTrigger.is_connected(Gamecontroller._on_trigger):
obj.AreaTrigger.connect(game._on_trigger) obj.AreaTrigger.connect(Gamecontroller._on_trigger)
func updateCrates()->void: func updateCrates()->void:
#check that there is a crates node #check that there is a crates node
@ -43,7 +77,7 @@ func updateCrates()->void:
if not obj.tree_exited.is_connected(updateCrates): if not obj.tree_exited.is_connected(updateCrates):
obj.tree_exited.connect(updateCrates) obj.tree_exited.connect(updateCrates)
totalCrates +=1 totalCrates +=1
game.crateUpdate(totalCrates) Gamecontroller.crateUpdate(totalCrates)
func destroy(body)->void: func destroy(body)->void:
if body is Bullet: if body is Bullet:
@ -71,9 +105,11 @@ func bulletFactory()->Bullet :
#how many bullets have been made? #how many bullets have been made?
if bulletArray.size() <= totalAllowedBullets: if bulletArray.size() <= totalAllowedBullets:
myBullet = bullet.instantiate() myBullet = bullet.instantiate()
if not myBullet.bulletDamageSignal.is_connected(game.bulletDamage): if not myBullet.bulletDamageSignal.is_connected(Gamecontroller.bulletDamage):
myBullet.bulletDamageSignal.connect(game.bulletDamage) myBullet.bulletDamageSignal.connect(Gamecontroller.bulletDamage)
game.add_child(myBullet) #Gamecontroller.add_child(myBullet)
#Gamecontroller is pure code now, so switch to add_sibling
add_sibling(myBullet)
else: else:
myBullet = bulletArray.pop_back() myBullet = bulletArray.pop_back()

41
scripts/slime.gd Normal file
View File

@ -0,0 +1,41 @@
class_name Slime extends Area2D
@onready var right_cast: RayCast2D = $RightCast
@onready var left_cast: RayCast2D = $LeftCast
@onready var left_down_cast: RayCast2D = $LeftDownCast
@onready var right_down_cast: RayCast2D = $RightDownCast
@onready var slime_graphic: AnimatedSprite2D = $SlimeGraphic
var speed:int = 100
var direction = 1
signal slimeDamageSignal(body, slime)
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
#raycast detection
if not right_down_cast.is_colliding():
direction = -1
slime_graphic.flip_h = true
if not left_down_cast.is_colliding():
direction = 1
slime_graphic.flip_h = false
if right_cast.is_colliding() && not right_cast.get_collider() is Player:
direction = -1
slime_graphic.flip_h = true
if left_cast.is_colliding() && not left_cast.get_collider() is Player:
direction = 1
slime_graphic.flip_h = false
position.x += direction * speed * delta
func _on_body_entered(body):
if body is Player:
slimeDamageSignal.emit(body, self)

1
scripts/slime.gd.uid Normal file
View File

@ -0,0 +1 @@
uid://c8o8u4tesokv5