added timer, multilevel, slimes, custom resources

This commit is contained in:
christophe 2025-09-08 20:54:15 -04:00
parent 2014ed0b37
commit 2ebdf0cc0c
16 changed files with 1291 additions and 15 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 908 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://7yk25cd4l4i3"
path="res://.godot/imported/slime_green.png-39e6d20ec404e9a2ed3a0b1682ef53e9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://assets/graphics/ennemis/slime_green.png"
dest_files=["res://.godot/imported/slime_green.png-39e6d20ec404e9a2ed3a0b1682ef53e9.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

View File

@ -15,6 +15,10 @@ run/main_scene="uid://dk3bbsqf7yi08"
config/features=PackedStringArray("4.4", "Forward Plus") config/features=PackedStringArray("4.4", "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

View File

@ -1,6 +1,5 @@
[gd_scene load_steps=19 format=4 uid="uid://dk3bbsqf7yi08"] [gd_scene load_steps=19 format=4 uid="uid://dk3bbsqf7yi08"]
[ext_resource type="Script" uid="uid://c3o8iur48idhr" path="res://scripts/gamecontroller.gd" id="1_lnu2h"]
[ext_resource type="Script" uid="uid://vi7u52xttkpb" path="res://scripts/scene_manager.gd" id="2_iywne"] [ext_resource type="Script" uid="uid://vi7u52xttkpb" path="res://scripts/scene_manager.gd" id="2_iywne"]
[ext_resource type="PackedScene" uid="uid://by6fag0gnv0r4" path="res://scenes/crate.tscn" id="2_lbhrr"] [ext_resource type="PackedScene" uid="uid://by6fag0gnv0r4" path="res://scenes/crate.tscn" id="2_lbhrr"]
[ext_resource type="PackedScene" uid="uid://d4db6ttyltd56" path="res://scenes/player.tscn" id="2_lnu2h"] [ext_resource type="PackedScene" uid="uid://d4db6ttyltd56" path="res://scenes/player.tscn" id="2_lnu2h"]
@ -12,6 +11,7 @@
[ext_resource type="Texture2D" uid="uid://bfrdit16wfh65" path="res://assets/graphics/environment/terrain/mushroom_32x64.png" id="5_0tnpc"] [ext_resource type="Texture2D" uid="uid://bfrdit16wfh65" path="res://assets/graphics/environment/terrain/mushroom_32x64.png" id="5_0tnpc"]
[ext_resource type="Texture2D" uid="uid://bikjxvjmfsqyy" path="res://assets/graphics/environment/backgrounds/midground.png" id="5_kvpfn"] [ext_resource type="Texture2D" uid="uid://bikjxvjmfsqyy" path="res://assets/graphics/environment/backgrounds/midground.png" id="5_kvpfn"]
[ext_resource type="PackedScene" uid="uid://br6up8ears5fo" path="res://scenes/coin.tscn" id="11_dinhu"] [ext_resource type="PackedScene" uid="uid://br6up8ears5fo" path="res://scenes/coin.tscn" id="11_dinhu"]
[ext_resource type="PackedScene" uid="uid://dknxqutkmhkqw" path="res://scenes/slime.tscn" id="12_dinhu"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u5sy4"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u5sy4"]
texture = ExtResource("3_p57ef") texture = ExtResource("3_p57ef")
@ -411,7 +411,6 @@ size = Vector2(144, 20)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"] [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"]
[node name="game" type="Node2D"] [node name="game" type="Node2D"]
script = ExtResource("1_lnu2h")
[node name="SceneManager" type="Node2D" parent="."] [node name="SceneManager" type="Node2D" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
@ -497,4 +496,15 @@ position = Vector2(902, 211)
[node name="coin4" parent="coins" instance=ExtResource("11_dinhu")] [node name="coin4" parent="coins" instance=ExtResource("11_dinhu")]
position = Vector2(1040, 308) position = Vector2(1040, 308)
[node name="ennemies" type="Node2D" parent="."]
[node name="Slime" parent="ennemies" instance=ExtResource("12_dinhu")]
position = Vector2(357, 310)
[node name="Slime2" parent="ennemies" instance=ExtResource("12_dinhu")]
position = Vector2(396, 214)
[node name="Slime3" parent="ennemies" instance=ExtResource("12_dinhu")]
position = Vector2(874, 215)
[connection signal="areaTriggerSignal" from="triggers/playerHurt" to="." method="_on_trigger"] [connection signal="areaTriggerSignal" from="triggers/playerHurt" to="." method="_on_trigger"]

498
scenes/level2.tscn Normal file
View File

@ -0,0 +1,498 @@
[gd_scene load_steps=18 format=4 uid="uid://dm5xvvnrtlbxn"]
[ext_resource type="Script" uid="uid://vi7u52xttkpb" path="res://scripts/scene_manager.gd" id="1_76toy"]
[ext_resource type="Texture2D" uid="uid://26bbv4ejahja" path="res://assets/graphics/environment/backgrounds/sky.png" id="2_8g4ke"]
[ext_resource type="Texture2D" uid="uid://buxc3k748d7qn" path="res://assets/graphics/environment/backgrounds/forestbackground.png" id="3_56gwk"]
[ext_resource type="Texture2D" uid="uid://bikjxvjmfsqyy" path="res://assets/graphics/environment/backgrounds/midground.png" id="4_ve5ok"]
[ext_resource type="Texture2D" uid="uid://bior2r1hv1q0s" path="res://assets/graphics/environment/terrain/terrain_32x32.png" id="5_cleqw"]
[ext_resource type="Texture2D" uid="uid://bbtwjiqoh4hov" path="res://assets/graphics/environment/terrain/veg_32x32.png" id="6_wvb8j"]
[ext_resource type="Texture2D" uid="uid://bfrdit16wfh65" path="res://assets/graphics/environment/terrain/mushroom_32x64.png" id="7_g8vcy"]
[ext_resource type="PackedScene" uid="uid://by6fag0gnv0r4" path="res://scenes/crate.tscn" id="8_cqal4"]
[ext_resource type="PackedScene" uid="uid://d4db6ttyltd56" path="res://scenes/player.tscn" id="9_o3sye"]
[ext_resource type="PackedScene" uid="uid://e5y4obsl2kcv" path="res://scenes/trigger.tscn" id="10_24ks5"]
[ext_resource type="PackedScene" uid="uid://br6up8ears5fo" path="res://scenes/coin.tscn" id="11_s4es8"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u5sy4"]
texture = ExtResource("5_cleqw")
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, -14.7212, 16, -14.8227, 16, 0.710678, -0.55839, 0.913729, -0.862967, 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, -5.68543, -16, -5.1778)
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, 2.48738, 16, 2.28432, -1.31983, -16, -1.52288)
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/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/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/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, -0.0507622, -16, -0.355339, 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
1:1/0/terrain_set = 0
1:1/0/terrain = 0
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
1:1/0/terrains_peering_bit/right_side = 0
1:1/0/terrains_peering_bit/bottom_right_corner = 0
1:1/0/terrains_peering_bit/bottom_side = 0
1:1/0/terrains_peering_bit/bottom_left_corner = 0
1:1/0/terrains_peering_bit/left_side = 0
1:1/0/terrains_peering_bit/top_left_corner = 0
1:1/0/terrains_peering_bit/top_side = 0
1:1/0/terrains_peering_bit/top_right_corner = 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, 0.0507622, -16, 0.355339, 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/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/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, 8.42662, -10.8125, 16, 16, 16)
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, 0.203051, 16, -0.304577, 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, 8.42662, 10.8125, 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, 8.42662, -10.8125, 16, 7.66518, 16, 16, 8.52814)
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.0507622, -16, -0.355339, 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(16, -16, 0.0507622, -16, 0.355339, 16, 16, 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, -5.68543, -16, -5.1778)
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, -5.68543, -16, -5.1778)
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, -0.0507622, -16, -0.355339, 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, -5.68543, -16, -5.1778)
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, -14.7212, 16, -14.8227, 16, 0.710678, -0.55839, 0.913729, -0.862967, 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, 2.48738, 16, 2.28432, -1.31983, -16, -1.52288)
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, -6.9545, 16, -16, 7.30984)
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, 8.83272, 8.88348, 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, 10.051, 9.89874, 16, -8.47738, 16, -16, 6.09153)
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.0507622, -16, -0.355339, 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(16, -16, 0.0507622, -16, 0.355339, 16, 16, 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, 16, 16, 0.0507622, -16, 0.355339, -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, 16, 16, 0.0507622, -16, 0.355339, -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, 0.0507622, -16, 0.355339, -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, 0.0507622, -16, 0.355339, 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, 8.42662, -10.8125, 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, 8.42662, 10.8125, 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_vtaks"]
texture = ExtResource("6_wvb8j")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 1
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_kvpfn"]
texture = ExtResource("7_g8vcy")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 1
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="TileSet" id="TileSet_gee14"]
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 = "vegetation"
terrain_set_0/terrain_1/color = Color(0.5, 0.4375, 0.25, 1)
sources/0 = SubResource("TileSetAtlasSource_u5sy4")
sources/1 = SubResource("TileSetAtlasSource_vtaks")
sources/2 = SubResource("TileSetAtlasSource_kvpfn")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8cj0n"]
size = Vector2(144, 20)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"]
[node name="game" type="Node2D"]
[node name="SceneManager" type="Node2D" parent="."]
unique_name_in_owner = true
script = ExtResource("1_76toy")
[node name="skylayer" type="Parallax2D" parent="."]
repeat_size = Vector2(320, 180)
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="skylayer"]
position = Vector2(160, 90)
texture = ExtResource("2_8g4ke")
[node name="farlayer" type="Parallax2D" parent="."]
texture_filter = 1
scroll_scale = Vector2(1.2, 1)
repeat_size = Vector2(320, 0)
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="farlayer"]
position = Vector2(160, 100)
texture = ExtResource("3_56gwk")
[node name="midground" type="Parallax2D" parent="."]
scroll_scale = Vector2(1.4, 1)
repeat_size = Vector2(160, 0)
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="midground"]
position = Vector2(160, 160)
texture = ExtResource("4_ve5ok")
[node name="TileMapLayer" type="TileMapLayer" parent="."]
texture_filter = 1
position = Vector2(30, 31)
tile_map_data = PackedByteArray("AAAKAAkAAAABAAQAAAALAAkAAAABAAQAAAAMAAkAAAABAAQAAAANAAkAAAABAAQAAAAOAAkAAAABAAQAAAAPAAkAAAABAAQAAAAQAAkAAAABAAQAAAARAAkAAAABAAQAAAASAAkAAAABAAQAAAATAAkAAAABAAQAAAAUAAkAAAAQAAMAAAAUAAoAAAAPAAQAAAAVAAoAAAAQAAMAAAAVAAsAAAAEAAEAAAAVAAwAAAAPAAQAAAAWAAwAAAABAAQAAAAXAAwAAAABAAQAAAAYAAwAAAABAAQAAAAZAAwAAAABAAQAAAAaAAwAAAABAAQAAAAbAAwAAAABAAQAAAAcAAsAAAAPAAMAAAAdAAsAAAAQAAQAAAAdAAoAAAAPAAMAAAAeAAoAAAABAAQAAAAfAAoAAAAQAAQAAAAfAAkAAAAPAAMAAAAgAAkAAAAQAAQAAAAgAAgAAAAPAAMAAAAcAAwAAAAQAAQAAAAhAAgAAAABAAQAAAAiAAgAAAABAAQAAAAjAAgAAAABAAQAAAAkAAgAAAAQAAQAAAAeAAYAAAACAAQAAAAdAAYAAAABAAQAAAAcAAYAAAABAAQAAAAbAAYAAAABAAQAAAAaAAYAAAAAAAQAAAAZAAsAAQAAAAAAAAAdAAkAAQAAAAAAAAAcAAUAAQAAAAAAAAAhAAcAAQAAAAAAAAAOAAgAAQAAAAAAAAAPAAgAAQAAAAAAAAAQAAgAAQAAAAAAAAAVAAkAAQAAAAAAAAAXAAsAAgAAAAEAAAAXAAoAAgAAAAAAAAAaAAsAAQAAAAAAAAAYAAsAAgAAAAEAAAAYAAoAAgAAAAAAAAAdAAUAAgAAAAEAAAAdAAQAAgAAAAAAAAATAAgAAgAAAAEAAAATAAcAAgAAAAAAAAARAAgAAQAAAAAAAAANAAgAAgAAAAEAAAANAAcAAgAAAAAAAAAkAAcAAAAEAAEAAAAkAAYAAAAEAAEAAAAkAAUAAAAEAAEAAAAkAAQAAAAEAAEAAAAkAAMAAAAEAAEAAAAkAAIAAAAEAAEAAAAkAAEAAAAEAAEAAAAkAAAAAAAEAAAAAAAJAAkAAAABAAQAAAAIAAkAAAABAAQAAAAHAAkAAAABAAQAAAAGAAkAAAABAAQAAAAEAAkAAAABAAQAAAAFAAkAAAABAAQAAAADAAkAAAABAAQAAAACAAkAAAABAAQAAAABAAkAAAABAAQAAAAAAAkAAAABAAQAAAD//wkAAAAPAAQAAAD//wgAAAAEAAEAAAD//wcAAAAEAAEAAAD//wYAAAAEAAEAAAD//wUAAAAEAAEAAAD//wQAAAAEAAEAAAD//wMAAAAPAAMAAAAAAAMAAAAQAAQAAAAAAAIAAAAEAAEAAAAAAAEAAAAEAAEAAAAAAAAAAAAEAAAAAAADAAYAAAAAAAQAAAAEAAYAAAABAAQAAAAFAAYAAAACAAQAAAAIAAUAAAAAAAQAAAAJAAUAAAABAAQAAAAKAAUAAAACAAQAAAALAAYAAAAAAAQAAAAMAAYAAAABAAQAAAANAAYAAAABAAQAAAAOAAYAAAACAAQAAAA=")
tile_set = SubResource("TileSet_gee14")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
position = Vector2(593, 539)
scale = Vector2(1.07507, 1.58955)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource("RectangleShape2D_8cj0n")
[node name="crate" parent="." instance=ExtResource("8_cqal4")]
position = Vector2(530, 267)
[node name="crate2" parent="." instance=ExtResource("8_cqal4")]
position = Vector2(769, 273)
[node name="ground" type="StaticBody2D" parent="."]
position = Vector2(485, 460)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="ground"]
shape = SubResource("WorldBoundaryShape2D_8cj0n")
[node name="player" parent="." instance=ExtResource("9_o3sye")]
position = Vector2(476, 279)
[node name="triggers" type="Node2D" parent="."]
[node name="playerHurt" parent="triggers" instance=ExtResource("10_24ks5")]
position = Vector2(493, 422)
effect = "player_hurt"
[node name="coins" type="Node2D" parent="."]
[node name="coin" parent="coins" instance=ExtResource("11_s4es8")]
position = Vector2(426, 215)
[node name="coin5" parent="coins" instance=ExtResource("11_s4es8")]
position = Vector2(180, 211)
[node name="coin2" parent="coins" instance=ExtResource("11_s4es8")]
position = Vector2(577, 299)
[node name="coin3" parent="coins" instance=ExtResource("11_s4es8")]
position = Vector2(902, 211)
[node name="coin4" parent="coins" instance=ExtResource("11_s4es8")]
position = Vector2(1040, 308)
[connection signal="areaTriggerSignal" from="triggers/playerHurt" to="." method="_on_trigger"]

498
scenes/level3.tscn Normal file
View File

@ -0,0 +1,498 @@
[gd_scene load_steps=18 format=4 uid="uid://caqwwynfv73pr"]
[ext_resource type="Script" uid="uid://vi7u52xttkpb" path="res://scripts/scene_manager.gd" id="1_fh4ka"]
[ext_resource type="Texture2D" uid="uid://26bbv4ejahja" path="res://assets/graphics/environment/backgrounds/sky.png" id="2_qewby"]
[ext_resource type="Texture2D" uid="uid://buxc3k748d7qn" path="res://assets/graphics/environment/backgrounds/forestbackground.png" id="3_bradm"]
[ext_resource type="Texture2D" uid="uid://bikjxvjmfsqyy" path="res://assets/graphics/environment/backgrounds/midground.png" id="4_got4s"]
[ext_resource type="Texture2D" uid="uid://bior2r1hv1q0s" path="res://assets/graphics/environment/terrain/terrain_32x32.png" id="5_e40mx"]
[ext_resource type="Texture2D" uid="uid://bbtwjiqoh4hov" path="res://assets/graphics/environment/terrain/veg_32x32.png" id="6_a114e"]
[ext_resource type="Texture2D" uid="uid://bfrdit16wfh65" path="res://assets/graphics/environment/terrain/mushroom_32x64.png" id="7_y1e0c"]
[ext_resource type="PackedScene" uid="uid://by6fag0gnv0r4" path="res://scenes/crate.tscn" id="8_s4dsi"]
[ext_resource type="PackedScene" uid="uid://d4db6ttyltd56" path="res://scenes/player.tscn" id="9_07lh1"]
[ext_resource type="PackedScene" uid="uid://e5y4obsl2kcv" path="res://scenes/trigger.tscn" id="10_6uuvf"]
[ext_resource type="PackedScene" uid="uid://br6up8ears5fo" path="res://scenes/coin.tscn" id="11_x008a"]
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_u5sy4"]
texture = ExtResource("5_e40mx")
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, -14.7212, 16, -14.8227, 16, 0.710678, -0.55839, 0.913729, -0.862967, 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, -5.68543, -16, -5.1778)
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, 2.48738, 16, 2.28432, -1.31983, -16, -1.52288)
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/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/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/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, -0.0507622, -16, -0.355339, 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
1:1/0/terrain_set = 0
1:1/0/terrain = 0
1:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16)
1:1/0/terrains_peering_bit/right_side = 0
1:1/0/terrains_peering_bit/bottom_right_corner = 0
1:1/0/terrains_peering_bit/bottom_side = 0
1:1/0/terrains_peering_bit/bottom_left_corner = 0
1:1/0/terrains_peering_bit/left_side = 0
1:1/0/terrains_peering_bit/top_left_corner = 0
1:1/0/terrains_peering_bit/top_side = 0
1:1/0/terrains_peering_bit/top_right_corner = 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, 0.0507622, -16, 0.355339, 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/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/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, 8.42662, -10.8125, 16, 16, 16)
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, 0.203051, 16, -0.304577, 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, 8.42662, 10.8125, 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, 8.42662, -10.8125, 16, 7.66518, 16, 16, 8.52814)
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.0507622, -16, -0.355339, 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(16, -16, 0.0507622, -16, 0.355339, 16, 16, 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, -5.68543, -16, -5.1778)
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, -5.68543, -16, -5.1778)
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, -0.0507622, -16, -0.355339, 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, -5.68543, -16, -5.1778)
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, -14.7212, 16, -14.8227, 16, 0.710678, -0.55839, 0.913729, -0.862967, 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, 2.48738, 16, 2.28432, -1.31983, -16, -1.52288)
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, -6.9545, 16, -16, 7.30984)
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, 8.83272, 8.88348, 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, 10.051, 9.89874, 16, -8.47738, 16, -16, 6.09153)
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.0507622, -16, -0.355339, 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(16, -16, 0.0507622, -16, 0.355339, 16, 16, 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, 16, 16, 0.0507622, -16, 0.355339, -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, 16, 16, 0.0507622, -16, 0.355339, -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, 0.0507622, -16, 0.355339, -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, 0.0507622, -16, 0.355339, 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, 8.42662, -10.8125, 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, 8.42662, 10.8125, 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_vtaks"]
texture = ExtResource("6_a114e")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 1
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_kvpfn"]
texture = ExtResource("7_y1e0c")
texture_region_size = Vector2i(32, 32)
0:0/0 = 0
0:0/0/terrain_set = 0
0:0/0/terrain = 1
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="TileSet" id="TileSet_gee14"]
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 = "vegetation"
terrain_set_0/terrain_1/color = Color(0.5, 0.4375, 0.25, 1)
sources/0 = SubResource("TileSetAtlasSource_u5sy4")
sources/1 = SubResource("TileSetAtlasSource_vtaks")
sources/2 = SubResource("TileSetAtlasSource_kvpfn")
[sub_resource type="RectangleShape2D" id="RectangleShape2D_8cj0n"]
size = Vector2(144, 20)
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_8cj0n"]
[node name="game" type="Node2D"]
[node name="SceneManager" type="Node2D" parent="."]
unique_name_in_owner = true
script = ExtResource("1_fh4ka")
[node name="skylayer" type="Parallax2D" parent="."]
repeat_size = Vector2(320, 180)
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="skylayer"]
position = Vector2(160, 90)
texture = ExtResource("2_qewby")
[node name="farlayer" type="Parallax2D" parent="."]
texture_filter = 1
scroll_scale = Vector2(1.2, 1)
repeat_size = Vector2(320, 0)
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="farlayer"]
position = Vector2(160, 100)
texture = ExtResource("3_bradm")
[node name="midground" type="Parallax2D" parent="."]
scroll_scale = Vector2(1.4, 1)
repeat_size = Vector2(160, 0)
metadata/_edit_group_ = true
[node name="Sprite2D" type="Sprite2D" parent="midground"]
position = Vector2(160, 160)
texture = ExtResource("4_got4s")
[node name="TileMapLayer" type="TileMapLayer" parent="."]
texture_filter = 1
position = Vector2(30, 31)
tile_map_data = PackedByteArray("AAAKAAkAAAABAAQAAAALAAkAAAABAAQAAAAMAAkAAAABAAQAAAANAAkAAAABAAQAAAAOAAkAAAABAAQAAAAPAAkAAAABAAQAAAAQAAkAAAABAAQAAAARAAkAAAABAAQAAAASAAkAAAABAAQAAAATAAkAAAABAAQAAAAUAAkAAAAQAAMAAAAUAAoAAAAPAAQAAAAVAAoAAAAQAAMAAAAVAAsAAAAEAAEAAAAVAAwAAAAPAAQAAAAWAAwAAAABAAQAAAAXAAwAAAABAAQAAAAYAAwAAAABAAQAAAAZAAwAAAABAAQAAAAaAAwAAAABAAQAAAAbAAwAAAABAAQAAAAcAAsAAAAPAAMAAAAdAAsAAAAQAAQAAAAdAAoAAAAPAAMAAAAeAAoAAAABAAQAAAAfAAoAAAAQAAQAAAAfAAkAAAAPAAMAAAAgAAkAAAAQAAQAAAAgAAgAAAAPAAMAAAAcAAwAAAAQAAQAAAAhAAgAAAABAAQAAAAiAAgAAAABAAQAAAAjAAgAAAABAAQAAAAkAAgAAAAQAAQAAAAeAAYAAAACAAQAAAAdAAYAAAABAAQAAAAcAAYAAAABAAQAAAAbAAYAAAABAAQAAAAaAAYAAAAAAAQAAAAZAAsAAQAAAAAAAAAdAAkAAQAAAAAAAAAcAAUAAQAAAAAAAAAhAAcAAQAAAAAAAAAOAAgAAQAAAAAAAAAPAAgAAQAAAAAAAAAQAAgAAQAAAAAAAAAVAAkAAQAAAAAAAAAXAAsAAgAAAAEAAAAXAAoAAgAAAAAAAAAaAAsAAQAAAAAAAAAYAAsAAgAAAAEAAAAYAAoAAgAAAAAAAAAdAAUAAgAAAAEAAAAdAAQAAgAAAAAAAAATAAgAAgAAAAEAAAATAAcAAgAAAAAAAAARAAgAAQAAAAAAAAANAAgAAgAAAAEAAAANAAcAAgAAAAAAAAAkAAcAAAAEAAEAAAAkAAYAAAAEAAEAAAAkAAUAAAAEAAEAAAAkAAQAAAAEAAEAAAAkAAMAAAAEAAEAAAAkAAIAAAAEAAEAAAAkAAEAAAAEAAEAAAAkAAAAAAAEAAAAAAAJAAkAAAABAAQAAAAIAAkAAAABAAQAAAAHAAkAAAABAAQAAAAGAAkAAAABAAQAAAAEAAkAAAABAAQAAAAFAAkAAAABAAQAAAADAAkAAAABAAQAAAACAAkAAAABAAQAAAABAAkAAAABAAQAAAAAAAkAAAABAAQAAAD//wkAAAAPAAQAAAD//wgAAAAEAAEAAAD//wcAAAAEAAEAAAD//wYAAAAEAAEAAAD//wUAAAAEAAEAAAD//wQAAAAEAAEAAAD//wMAAAAPAAMAAAAAAAMAAAAQAAQAAAAAAAIAAAAEAAEAAAAAAAEAAAAEAAEAAAAAAAAAAAAEAAAAAAADAAYAAAAAAAQAAAAEAAYAAAABAAQAAAAFAAYAAAACAAQAAAAIAAUAAAAAAAQAAAAJAAUAAAABAAQAAAAKAAUAAAACAAQAAAALAAYAAAAAAAQAAAAMAAYAAAABAAQAAAANAAYAAAABAAQAAAAOAAYAAAACAAQAAAA=")
tile_set = SubResource("TileSet_gee14")
[node name="StaticBody2D" type="StaticBody2D" parent="."]
position = Vector2(593, 539)
scale = Vector2(1.07507, 1.58955)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
shape = SubResource("RectangleShape2D_8cj0n")
[node name="crate" parent="." instance=ExtResource("8_s4dsi")]
position = Vector2(530, 267)
[node name="crate2" parent="." instance=ExtResource("8_s4dsi")]
position = Vector2(769, 273)
[node name="ground" type="StaticBody2D" parent="."]
position = Vector2(485, 460)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="ground"]
shape = SubResource("WorldBoundaryShape2D_8cj0n")
[node name="player" parent="." instance=ExtResource("9_07lh1")]
position = Vector2(476, 279)
[node name="triggers" type="Node2D" parent="."]
[node name="playerHurt" parent="triggers" instance=ExtResource("10_6uuvf")]
position = Vector2(493, 422)
effect = "player_hurt"
[node name="coins" type="Node2D" parent="."]
[node name="coin" parent="coins" instance=ExtResource("11_x008a")]
position = Vector2(426, 215)
[node name="coin5" parent="coins" instance=ExtResource("11_x008a")]
position = Vector2(180, 211)
[node name="coin2" parent="coins" instance=ExtResource("11_x008a")]
position = Vector2(577, 299)
[node name="coin3" parent="coins" instance=ExtResource("11_x008a")]
position = Vector2(902, 211)
[node name="coin4" parent="coins" instance=ExtResource("11_x008a")]
position = Vector2(1040, 308)
[connection signal="areaTriggerSignal" from="triggers/playerHurt" to="." method="_on_trigger"]

73
scenes/slime.tscn Normal file
View File

@ -0,0 +1,73 @@
[gd_scene load_steps=9 format=3 uid="uid://dknxqutkmhkqw"]
[ext_resource type="Texture2D" uid="uid://7yk25cd4l4i3" path="res://assets/graphics/ennemis/slime_green.png" id="1_371uh"]
[ext_resource type="Script" uid="uid://dp44amovxcpc6" path="res://scripts/slime.gd" id="1_p2gj0"]
[sub_resource type="CircleShape2D" id="CircleShape2D_srws1"]
[sub_resource type="AtlasTexture" id="AtlasTexture_p2gj0"]
atlas = ExtResource("1_371uh")
region = Rect2(0, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_n6pvg"]
atlas = ExtResource("1_371uh")
region = Rect2(24, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_pjw23"]
atlas = ExtResource("1_371uh")
region = Rect2(48, 24, 24, 24)
[sub_resource type="AtlasTexture" id="AtlasTexture_2npkn"]
atlas = ExtResource("1_371uh")
region = Rect2(72, 24, 24, 24)
[sub_resource type="SpriteFrames" id="SpriteFrames_fd6lc"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_p2gj0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_n6pvg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pjw23")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2npkn")
}],
"loop": true,
"name": &"idle",
"speed": 12.0
}]
[node name="Slime" type="Area2D"]
script = ExtResource("1_p2gj0")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(0.751545, 0.754418)
shape = SubResource("CircleShape2D_srws1")
debug_color = Color(0.86174, 0.271483, 0.268668, 0.42)
[node name="SlimeGraphic" type="AnimatedSprite2D" parent="."]
texture_filter = 1
position = Vector2(0, -4)
sprite_frames = SubResource("SpriteFrames_fd6lc")
animation = &"idle"
autoplay = "idle"
[node name="RightCast" type="RayCast2D" parent="."]
target_position = Vector2(12, 0)
[node name="LeftCast" type="RayCast2D" parent="."]
target_position = Vector2(-12, 0)
[node name="LeftCastDown" type="RayCast2D" parent="."]
position = Vector2(-7, 0)
target_position = Vector2(0, 13)
[node name="RightCastDown" type="RayCast2D" parent="."]
position = Vector2(8, 0)
target_position = Vector2(0, 13)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

View File

@ -3,4 +3,5 @@ class_name Coin extends Area2D
signal coinCollectedSignal(body, coin) signal coinCollectedSignal(body, coin)
func _on_body_entered(body: Node2D) -> void: func _on_body_entered(body: Node2D) -> void:
coinCollectedSignal.emit(body, self) if body is Player:
coinCollectedSignal.emit(body, self)

View File

@ -3,21 +3,52 @@ extends Node2D
@onready var player: Player = $player @onready var player: Player = $player
signal playerDamage signal playerDamage
signal destroySignal(body)
signal levelChangeSignal(level)
var score := 0 var score := 0
var totalCoin := 0
var coinCollected := 0
var timer := Timer.new()
var timeAvailable: int = 5
var levels = ["res://scenes/game.tscn","res://scenes/level2.tscn","res://scenes/level3.tscn"]
var timers = [60, 10, 9]
var currentLevel = 0
#caracter stats
var enemy_stats: CharacterStats
var player_stats: CharacterStats
var player_current_health: int
# 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:
pass # Replace with function body. enemy_stats = load("res://scripts/rscs/slimeStats.tres")
player_stats = load("res://scripts/rscs/playerStats.tres")
player_current_health = player_stats.starting_health
reset()
print("in _ready")
add_child(timer)
timer.wait_time = 1
timer.one_shot = false
timer.connect("timeout", secondCounter)
timer.start()
# 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:
pass pass
func secondCounter():
timeAvailable -= 1
if timeAvailable <= 0:
print("you lose")
reset()
levelChangeSignal.emit(levels[currentLevel])
func _on_trigger(effect: Variant, body: Variant) -> void: func _on_trigger(effect: Variant, body: Variant) -> void:
print("game controller sees trigger "+effect+" "+body.name)
if effect == "destroy" && not body is Player: if effect == "destroy" && not body is Player:
body.queue_free() body.queue_free()
elif effect == "player_hurt": elif effect == "player_hurt":
@ -27,7 +58,24 @@ func onBulletHitSignal(body: Node, bullet: Bullet):
body.queue_free() body.queue_free()
func onCoinCollected(body, coin: Coin): func onCoinCollected(body, coin: Coin):
if body is Player: destroySignal.emit(coin)
score += 1
coin.queue_free() func setTotalCoinCount(coinCount: int):
totalCoin = coinCount
if totalCoin == 0:
print("you win!")
currentLevel += 1
if currentLevel >= levels.size():
currentLevel = 0
levelChangeSignal.emit(levels[currentLevel])
func reset():
timeAvailable = timers[currentLevel]
func playerAttacked(body, slime):
print("player was attacked")
player_current_health -= enemy_stats.melee_damage
if player_current_health <= 0:
print("YOU ARE DEAD")
else:
print("remaining life: ", player_current_health)

View File

@ -0,0 +1,9 @@
class_name CharacterStats extends Resource
@export var health: int = 100
@export var max_health: int = 100
@export var starting_health: int = 100
# damage dealing
@export var melee_damage: int = 10
@export var range_damage: int = 0

View File

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

View File

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="CharacterStats" load_steps=2 format=3 uid="uid://dq3ppg3sgdb11"]
[ext_resource type="Script" uid="uid://lgpdd5rgj2jq" path="res://scripts/rscs/characterstats.gd" id="1_01643"]
[resource]
script = ExtResource("1_01643")
health = 100
max_health = 100
starting_health = 100
melee_damage = 10
range_damage = 0
metadata/_custom_type_script = "uid://lgpdd5rgj2jq"

View File

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="CharacterStats" load_steps=2 format=3 uid="uid://brf6f5inl3irc"]
[ext_resource type="Script" uid="uid://lgpdd5rgj2jq" path="res://scripts/rscs/characterstats.gd" id="1_ppipo"]
[resource]
script = ExtResource("1_ppipo")
health = 100
max_health = 100
starting_health = 100
melee_damage = 20
range_damage = 0
metadata/_custom_type_script = "uid://lgpdd5rgj2jq"

View File

@ -2,10 +2,10 @@ class_name SceneManager extends Node2D
const bullet_scene = preload("res://scenes/bullet.tscn") const bullet_scene = preload("res://scenes/bullet.tscn")
@onready var game: Node2D = $".." var game := Gamecontroller
@onready var triggers: Node2D = $"../triggers" @onready var triggers: Node2D = $"../triggers"
@onready var coins: Node2D = $"../coins" @onready var coins: Node2D = $"../coins"
@onready var ennemies: Node2D = $"../ennemies"
var MAX_BULLET := 50 var MAX_BULLET := 50
var available_bullets = [] var available_bullets = []
@ -13,10 +13,10 @@ var available_bullets = []
var score := 0 var score := 0
func _ready() -> void: func _ready() -> void:
for i in range(MAX_BULLET): for i in range(MAX_BULLET):
var new_bullet = bullet_scene.instantiate() var new_bullet = bullet_scene.instantiate()
new_bullet.bulletHitSignal.connect(game.onBulletHitSignal) new_bullet.bulletHitSignal.connect(game.onBulletHitSignal)
print(new_bullet.bullet_graphic)
available_bullets.push_front(new_bullet) available_bullets.push_front(new_bullet)
if triggers: if triggers:
@ -24,11 +24,32 @@ func _ready() -> void:
if trig is Trigger: if trig is Trigger:
trig.areaTriggerSignal.connect(game._on_trigger) trig.areaTriggerSignal.connect(game._on_trigger)
if ennemies:
updateEnnemies()
if coins: if coins:
for coin in coins.get_children(): updateCoins()
if coin is Coin:
game.destroySignal.connect(destroy)
game.levelChangeSignal.connect(changeScene)
func updateEnnemies():
print("pdate ennemies")
for ennemy in ennemies.get_children():
if ennemy is Slime:
if not ennemy.playerDamageSignal.is_connected(game.playerAttacked):
ennemy.playerDamageSignal.connect(game.playerAttacked)
func updateCoins():
var coinCount := 0
for coin in coins.get_children():
if coin is Coin:
coinCount += 1
if not coin.coinCollectedSignal.is_connected(game.onCoinCollected):
coin.coinCollectedSignal.connect(game.onCoinCollected) coin.coinCollectedSignal.connect(game.onCoinCollected)
if not coin.tree_exited.is_connected(updateCoins):
coin.tree_exited.connect(updateCoins)
game.setTotalCoinCount(coinCount)
func make_bullet(start_position: Transform2D, speed: int): func make_bullet(start_position: Transform2D, speed: int):
var new_bullet = bullet_factory(start_position, speed) var new_bullet = bullet_factory(start_position, speed)
@ -46,3 +67,11 @@ func bullet_factory(start_position: Transform2D, speed: int) -> Bullet:
available_bullets.push_front(shot_bullet) available_bullets.push_front(shot_bullet)
return shot_bullet return shot_bullet
func destroy(body: Node2D):
body.queue_free()
func changeScene(level):
get_tree().call_deferred("change_scene_to_file", level)

46
scripts/slime.gd Normal file
View File

@ -0,0 +1,46 @@
class_name Slime extends Area2D
@onready var slime_graphic: AnimatedSprite2D = $SlimeGraphic
@onready var right_cast: RayCast2D = $RightCast
@onready var left_cast: RayCast2D = $LeftCast
@onready var left_cast_down: RayCast2D = $LeftCastDown
@onready var right_cast_down: RayCast2D = $RightCastDown
signal playerDamageSignal(body, slime)
var SPEED: int = 100
var direction = 1
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
position.x += direction * SPEED * delta
if right_cast.is_colliding():
var collider = right_cast.get_collider()
if collider is not Player:
direction = -1
if left_cast.is_colliding():
var collider = left_cast.get_collider()
if collider is not Player:
direction = 1
if not right_cast_down.is_colliding():
direction = -1
if not left_cast_down.is_colliding():
direction = 1
if direction == -1:
slime_graphic.flip_h = true
else:
slime_graphic.flip_h = false
func _on_body_entered(body: Node2D) -> void:
if body is Player:
playerDamageSignal.emit(body, self)

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

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