Level loading and camera bounds system
- Added MainGame scene - Converted player into reusable scene - Added CameraBounds support - Added Demon Woods level - Fixed SceneManager references
This commit is contained in:
parent
07b5ce7c8d
commit
7c7e607a6e
Binary file not shown.
|
After Width: | Height: | Size: 947 B |
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://deprjxf7mfx2j"
|
||||
path="res://.godot/imported/parallax-demon-woods-bg.png-8143f03ad87cce020cc71f004cf237ea.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-bg.png"
|
||||
dest_files=["res://.godot/imported/parallax-demon-woods-bg.png-8143f03ad87cce020cc71f004cf237ea.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: 6.0 KiB |
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c6svcdw8rw64o"
|
||||
path="res://.godot/imported/parallax-demon-woods-close-trees.png-113246efebae77cf8a05d7a72d7fc413.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-close-trees.png"
|
||||
dest_files=["res://.godot/imported/parallax-demon-woods-close-trees.png-113246efebae77cf8a05d7a72d7fc413.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: 3.9 KiB |
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://rqo2a3nuk173"
|
||||
path="res://.godot/imported/parallax-demon-woods-far-trees.png-8c3360716e2ee4416f77bf696e9b01b6.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-far-trees.png"
|
||||
dest_files=["res://.godot/imported/parallax-demon-woods-far-trees.png-8c3360716e2ee4416f77bf696e9b01b6.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: 11 KiB |
@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bjkgrsnn5l0uu"
|
||||
path="res://.godot/imported/parallax-demon-woods-mid-trees.png-0453894a5d95c89b5c75278d3b451fe4.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-mid-trees.png"
|
||||
dest_files=["res://.godot/imported/parallax-demon-woods-mid-trees.png-0453894a5d95c89b5c75278d3b451fe4.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
|
||||
File diff suppressed because one or more lines are too long
@ -1,20 +1,19 @@
|
||||
[gd_scene load_steps=18 format=4 uid="uid://bcray1583u4e6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://c0aoaemjratj1" path="res://Assets/Graphics/Terrains/forestsky.png" id="1_mtqcm"]
|
||||
[ext_resource type="Texture2D" uid="uid://cugs4plceapu2" path="res://Assets/Graphics/Terrains/forestbackground.png" id="2_mmf1u"]
|
||||
[ext_resource type="Texture2D" uid="uid://e4k3axgdgkcw" path="res://Assets/Graphics/Terrains/spookytrees.png" id="3_vn460"]
|
||||
[ext_resource type="Texture2D" uid="uid://mfcyrgamj3cc" path="res://Assets/Graphics/Terrains/Terrain (32x32).png" id="4_r8hce"]
|
||||
[ext_resource type="Texture2D" uid="uid://kjupkmvjxlrg" path="res://Assets/Graphics/Terrains/mushroom_32x64.png" id="5_ca0bt"]
|
||||
[ext_resource type="Texture2D" uid="uid://bcrc6n8wjvwnh" path="res://Assets/Graphics/Terrains/veg_32x32.png" id="6_yj6rp"]
|
||||
[ext_resource type="Script" uid="uid://bs4frobn6kxne" path="res://Scripts/scene_manager.gd" id="7_orbd0"]
|
||||
[ext_resource type="PackedScene" uid="uid://bu8e4iyw8pc03" path="res://Scenes/Player.tscn" id="8_5flq6"]
|
||||
[ext_resource type="PackedScene" uid="uid://cd7fv3pwgr880" path="res://Scenes/crate.tscn" id="9_051s1"]
|
||||
[ext_resource type="PackedScene" uid="uid://b5d8himq5sttt" path="res://Scenes/trigger.tscn" id="10_in4v8"]
|
||||
[ext_resource type="PackedScene" uid="uid://dr1mp5x0cmbhw" path="res://Scenes/coin.tscn" id="11_mu7lp"]
|
||||
[ext_resource type="PackedScene" uid="uid://k42k25w6fsbo" path="res://Scenes/ui.tscn" id="12_mmf1u"]
|
||||
[ext_resource type="Texture2D" uid="uid://deprjxf7mfx2j" path="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-bg.png" id="1_aiupx"]
|
||||
[ext_resource type="Texture2D" uid="uid://rqo2a3nuk173" path="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-far-trees.png" id="2_v8qg6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bjkgrsnn5l0uu" path="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-mid-trees.png" id="3_q7uud"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6svcdw8rw64o" path="res://Assets/Graphics/Terrains/Background/Demon Woods/parallax-demon-woods-close-trees.png" id="4_ai43x"]
|
||||
[ext_resource type="Texture2D" uid="uid://mfcyrgamj3cc" path="res://Assets/Graphics/Terrains/Terrain (32x32).png" id="5_qcnhb"]
|
||||
[ext_resource type="Texture2D" uid="uid://kjupkmvjxlrg" path="res://Assets/Graphics/Terrains/mushroom_32x64.png" id="6_6fou7"]
|
||||
[ext_resource type="Texture2D" uid="uid://bcrc6n8wjvwnh" path="res://Assets/Graphics/Terrains/veg_32x32.png" id="7_ina8l"]
|
||||
[ext_resource type="PackedScene" uid="uid://bu8e4iyw8pc03" path="res://Scenes/Player.tscn" id="8_6aau3"]
|
||||
[ext_resource type="PackedScene" uid="uid://b5d8himq5sttt" path="res://Scenes/trigger.tscn" id="9_osu04"]
|
||||
[ext_resource type="PackedScene" uid="uid://dr1mp5x0cmbhw" path="res://Scenes/coin.tscn" id="10_y4887"]
|
||||
[ext_resource type="PackedScene" uid="uid://k42k25w6fsbo" path="res://Scenes/ui.tscn" id="11_otmkx"]
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_v158k"]
|
||||
texture = ExtResource("4_r8hce")
|
||||
texture = ExtResource("5_qcnhb")
|
||||
texture_region_size = Vector2i(32, 32)
|
||||
0:0/0 = 0
|
||||
0:0/0/terrain_set = 0
|
||||
@ -377,7 +376,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
16:4/0/terrains_peering_bit/top_side = 0
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_o5yvi"]
|
||||
texture = ExtResource("5_ca0bt")
|
||||
texture = ExtResource("6_6fou7")
|
||||
texture_region_size = Vector2i(32, 32)
|
||||
0:0/0 = 0
|
||||
0:0/0/terrain_set = 0
|
||||
@ -389,7 +388,7 @@ texture_region_size = Vector2i(32, 32)
|
||||
0:1/0/terrains_peering_bit/top_side = 1
|
||||
|
||||
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_rku1e"]
|
||||
texture = ExtResource("6_yj6rp")
|
||||
texture = ExtResource("7_ina8l")
|
||||
texture_region_size = Vector2i(32, 32)
|
||||
0:0/0 = 0
|
||||
0:0/0/terrain_set = 0
|
||||
@ -409,62 +408,65 @@ sources/4 = SubResource("TileSetAtlasSource_rku1e")
|
||||
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1l0tm"]
|
||||
|
||||
[node name="Game" type="Node2D"]
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mtqcm"]
|
||||
size = Vector2(36, 662)
|
||||
|
||||
[node name="ParallaxBackground" type="Parallax2D" parent="."]
|
||||
repeat_size = Vector2(320, 180)
|
||||
[node name="DemonRace" type="Node2D"]
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="ParallaxBackground"]
|
||||
position = Vector2(160, 90)
|
||||
texture = ExtResource("1_mtqcm")
|
||||
[node name="DemonWoodsParallax" type="ParallaxBackground" parent="."]
|
||||
|
||||
[node name="ParallaxMidGround" type="Parallax2D" parent="."]
|
||||
scroll_scale = Vector2(1.1, 0)
|
||||
repeat_size = Vector2(320, 0)
|
||||
[node name="BG_Layer" type="ParallaxLayer" parent="DemonWoodsParallax"]
|
||||
motion_scale = Vector2(0.1, 0.1)
|
||||
motion_mirroring = Vector2(480, 0)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="ParallaxMidGround"]
|
||||
position = Vector2(160, 300)
|
||||
texture = ExtResource("2_mmf1u")
|
||||
[node name="Sprite2D" type="Sprite2D" parent="DemonWoodsParallax/BG_Layer"]
|
||||
z_index = -40
|
||||
position = Vector2(242, 140)
|
||||
texture = ExtResource("1_aiupx")
|
||||
|
||||
[node name="ParallaxForeground" type="Parallax2D" parent="."]
|
||||
scroll_scale = Vector2(1.2, 1)
|
||||
scroll_offset = Vector2(-320, 0)
|
||||
repeat_size = Vector2(320, 0)
|
||||
[node name="FarTrees_Layer" type="ParallaxLayer" parent="DemonWoodsParallax"]
|
||||
motion_scale = Vector2(0.3, 0.3)
|
||||
motion_mirroring = Vector2(592, 0)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="ParallaxForeground"]
|
||||
position = Vector2(160, 300)
|
||||
texture = ExtResource("3_vn460")
|
||||
[node name="Sprite2D" type="Sprite2D" parent="DemonWoodsParallax/FarTrees_Layer"]
|
||||
z_index = -30
|
||||
position = Vector2(295, 140)
|
||||
texture = ExtResource("2_v8qg6")
|
||||
|
||||
[node name="MidTrees_Layer" type="ParallaxLayer" parent="DemonWoodsParallax"]
|
||||
motion_scale = Vector2(0.5, 0.5)
|
||||
motion_mirroring = Vector2(592, 0)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="DemonWoodsParallax/MidTrees_Layer"]
|
||||
z_index = -20
|
||||
position = Vector2(295, 140)
|
||||
texture = ExtResource("3_q7uud")
|
||||
|
||||
[node name="CloseTrees_Layer" type="ParallaxLayer" parent="DemonWoodsParallax"]
|
||||
motion_scale = Vector2(0.8, 0.8)
|
||||
motion_mirroring = Vector2(592, 0)
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="DemonWoodsParallax/CloseTrees_Layer"]
|
||||
z_index = -10
|
||||
position = Vector2(295, 140)
|
||||
texture = ExtResource("4_ai43x")
|
||||
|
||||
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||
texture_filter = 1
|
||||
tile_map_data = PackedByteArray("AAAWAAoAAAAQAAQAAAAWAA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ABAAQAAAANAAwAAAABAAQAAAAOAAwAAAABAAQAAAAPAAwAAAABAAQAAAAQAAwAAAABAAQAAAARAAwAAAABAAQAAAASAAwAAAABAAQAAAATAAwAAAAQAAQAAAATAAsAAAAPAAMAAAAUAAsAAAABAAQAAAAVAAsAAAAQAAQAAAAVAAoAAAAPAAMAAAAJAAsAAQAAAAEAAAAJAAoAAQAAAAAAAAAOAAsABAAAAAAAAAASAAsABAAAAAAAAAACAAsABAAAAAAAAAA=")
|
||||
position = Vector2(0, -1)
|
||||
tile_map_data = PackedByteArray("AAAAAAgAAAABAAEAAAABAAgAAAABAAEAAAACAAgAAAABAAEAAAADAAgAAAABAAEAAAAEAAgAAAABAAEAAAAFAAgAAAABAAEAAAAGAAgAAAABAAEAAAAHAAgAAAABAAEAAAAIAAgAAAABAAEAAAAJAAgAAAABAAEAAAAKAAgAAAABAAEAAAALAAgAAAABAAEAAAAMAAgAAAABAAEAAAANAAgAAAABAAEAAAAOAAgAAAABAAEAAAAPAAgAAAABAAEAAAAQAAgAAAABAAEAAAARAAgAAAABAAEAAAASAAgAAAABAAEAAAATAAgAAAABAAEAAAAUAAgAAAABAAEAAAAVAAgAAAABAAEAAAAWAAgAAAABAAEAAAAXAAgAAAABAAEAAAAYAAgAAAABAAEAAAAZAAgAAAABAAEAAAAaAAgAAAABAAEAAAAbAAgAAAABAAEAAAAcAAgAAAABAAEAAAAdAAgAAAABAAEAAAAeAAgAAAABAAEAAAAfAAgAAAABAAEAAAAgAAgAAAABAAEAAAAhAAgAAAABAAEAAAAiAAgAAAABAAEAAAAjAAgAAAABAAEAAAAkAAgAAAABAAEAAAAlAAgAAAABAAEAAAAmAAgAAAABAAEAAAAnAAgAAAABAAEAAAAoAAgAAAABAAEAAAApAAgAAAABAAEAAAAqAAgAAAABAAEAAAArAAgAAAABAAEAAAAsAAgAAAABAAEAAAAtAAgAAAABAAEAAAAuAAgAAAABAAEAAAAvAAgAAAABAAEAAAAwAAgAAAABAAEAAAAxAAgAAAABAAEAAAAyAAgAAAABAAEAAAAzAAgAAAABAAEAAAA0AAgAAAABAAEAAAA1AAgAAAABAAEAAAA2AAgAAAABAAEAAAA3AAgAAAABAAEAAAA4AAgAAAABAAEAAAA5AAgAAAABAAEAAAA6AAgAAAABAAEAAAA7AAgAAAABAAEAAAA8AAgAAAABAAEAAAA9AAgAAAABAAEAAAA+AAgAAAABAAEAAAA/AAgAAAABAAEAAABAAAgAAAABAAEAAABBAAgAAAABAAEAAABCAAgAAAABAAEAAABDAAgAAAABAAEAAABEAAgAAAABAAEAAABFAAgAAAABAAEAAABGAAgAAAABAAEAAABHAAgAAAABAAEAAABIAAgAAAABAAEAAABJAAgAAAABAAEAAABKAAgAAAABAAEAAABLAAgAAAABAAEAAABMAAgAAAABAAEAAABNAAgAAAABAAEAAABOAAgAAAABAAEAAABPAAgAAAABAAEAAABQAAgAAAABAAEAAABRAAgAAAABAAEAAABSAAgAAAABAAEAAABTAAgAAAABAAEAAABUAAgAAAABAAEAAABVAAgAAAABAAEAAABWAAgAAAABAAEAAABXAAgAAAABAAEAAABYAAgAAAABAAEAAABZAAgAAAABAAEAAABaAAgAAAABAAEAAABbAAgAAAABAAEAAABcAAgAAAABAAEAAABdAAgAAAABAAEAAABeAAgAAAABAAEAAABfAAgAAAABAAEAAABgAAgAAAABAAEAAABhAAgAAAABAAEAAABiAAgAAAABAAEAAABjAAgAAAABAAEAAABkAAgAAAABAAEAAABlAAgAAAABAAEAAABmAAgAAAABAAEAAABnAAgAAAABAAEAAABoAAgAAAABAAEAAABpAAgAAAABAAEAAABqAAgAAAABAAEAAABrAAgAAAABAAEAAABsAAgAAAABAAEAAABtAAgAAAABAAEAAABuAAgAAAABAAEAAABvAAgAAAABAAEAAABwAAgAAAABAAEAAABxAAgAAAABAAEAAAByAAgAAAABAAEAAAA=")
|
||||
tile_set = SubResource("TileSet_h4fw4")
|
||||
|
||||
[node name="SceneManager" type="Node2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("7_orbd0")
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("8_5flq6")]
|
||||
position = Vector2(984, 162)
|
||||
|
||||
[node name="Crates" type="Node2D" parent="."]
|
||||
|
||||
[node name="RigidBody2D5" parent="Crates" instance=ExtResource("9_051s1")]
|
||||
position = Vector2(1036, 364)
|
||||
|
||||
[node name="RigidBody2D4" parent="Crates" instance=ExtResource("9_051s1")]
|
||||
position = Vector2(1132, 137)
|
||||
|
||||
[node name="RigidBody2D3" parent="Crates" instance=ExtResource("9_051s1")]
|
||||
position = Vector2(430, 515)
|
||||
[node name="Player" parent="." instance=ExtResource("8_6aau3")]
|
||||
position = Vector2(3338, 199)
|
||||
|
||||
[node name="Triggers" type="Node2D" parent="."]
|
||||
|
||||
[node name="Area2D2" parent="Triggers" instance=ExtResource("10_in4v8")]
|
||||
position = Vector2(166, 525)
|
||||
[node name="Area2D2" parent="Triggers" instance=ExtResource("9_osu04")]
|
||||
position = Vector2(663, 332)
|
||||
effect = "destroy"
|
||||
|
||||
[node name="Area2D3" parent="Triggers" instance=ExtResource("10_in4v8")]
|
||||
[node name="Area2D3" parent="Triggers" instance=ExtResource("9_osu04")]
|
||||
position = Vector2(900, 341)
|
||||
|
||||
[node name="WorldBoundary" type="StaticBody2D" parent="."]
|
||||
@ -474,22 +476,28 @@ metadata/_edit_group_ = true
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="WorldBoundary"]
|
||||
shape = SubResource("WorldBoundaryShape2D_1l0tm")
|
||||
|
||||
[node name="StaticBody2D" type="StaticBody2D" parent="WorldBoundary"]
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="WorldBoundary/StaticBody2D"]
|
||||
position = Vector2(-577, -321)
|
||||
shape = SubResource("RectangleShape2D_mtqcm")
|
||||
|
||||
[node name="Coins" type="Node2D" parent="."]
|
||||
|
||||
[node name="Area2D" parent="Coins" instance=ExtResource("11_mu7lp")]
|
||||
[node name="Area2D" parent="Coins" instance=ExtResource("10_y4887")]
|
||||
position = Vector2(902, 169)
|
||||
|
||||
[node name="Area2D2" parent="Coins" instance=ExtResource("11_mu7lp")]
|
||||
[node name="Area2D2" parent="Coins" instance=ExtResource("10_y4887")]
|
||||
position = Vector2(1081, 155)
|
||||
|
||||
[node name="Area2D3" parent="Coins" instance=ExtResource("11_mu7lp")]
|
||||
[node name="Area2D3" parent="Coins" instance=ExtResource("10_y4887")]
|
||||
position = Vector2(952, 174)
|
||||
|
||||
[node name="Enemies" type="Node2D" parent="."]
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="."]
|
||||
|
||||
[node name="UI" parent="CanvasLayer" instance=ExtResource("12_mmf1u")]
|
||||
[node name="UI" parent="CanvasLayer" instance=ExtResource("11_otmkx")]
|
||||
|
||||
[connection signal="areatrigger" from="Triggers/Area2D2" to="." method="_on_areatrigger"]
|
||||
[connection signal="areatrigger" from="Triggers/Area2D3" to="." method="_on_areatrigger"]
|
||||
16
Scenes/Levels/MainGame.tscn
Normal file
16
Scenes/Levels/MainGame.tscn
Normal file
@ -0,0 +1,16 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://coknidvakx3e5"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bu8e4iyw8pc03" path="res://Scenes/Player.tscn" id="1_d5ayw"]
|
||||
[ext_resource type="Script" uid="uid://bs4frobn6kxne" path="res://Scripts/scene_manager.gd" id="2_us1pb"]
|
||||
[ext_resource type="PackedScene" uid="uid://c6mxse0hqjro7" path="res://Scenes/Levels/Level_1_library.tscn" id="3_cwqmr"]
|
||||
|
||||
[node name="MainGame" type="Node2D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_d5ayw")]
|
||||
|
||||
[node name="SceneManager" type="Node2D" parent="."]
|
||||
script = ExtResource("2_us1pb")
|
||||
|
||||
[node name="CurrentLevel" type="Node2D" parent="."]
|
||||
|
||||
[node name="Level_1_library" parent="CurrentLevel" instance=ExtResource("3_cwqmr")]
|
||||
@ -7,8 +7,6 @@
|
||||
[ext_resource type="Texture2D" uid="uid://bplvpwu7ktbqc" path="res://Assets/Graphics/Player/Idle/Adult_idle.png" id="5_megsn"]
|
||||
[ext_resource type="Texture2D" uid="uid://b6wf75yygb5jo" path="res://Assets/Graphics/Player/Run/Adult_run.png" id="6_yoq75"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_2poj3"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_ksbbd"]
|
||||
atlas = ExtResource("2_nn08x")
|
||||
region = Rect2(0, 0, 123, 122)
|
||||
@ -287,11 +285,24 @@ animations = [{
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_2poj3"]
|
||||
|
||||
[node name="CharacterBody2D" type="CharacterBody2D"]
|
||||
position = Vector2(2, -1)
|
||||
script = ExtResource("1_0y7nr")
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(-7, -43)
|
||||
|
||||
[node name="PlayerGraphic" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -6)
|
||||
sprite_frames = SubResource("SpriteFrames_miouo")
|
||||
animation = &"idle"
|
||||
autoplay = "idle"
|
||||
frame_progress = 0.47372988
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
scale = Vector2(1.6423842, 3.448035)
|
||||
shape = SubResource("CircleShape2D_2poj3")
|
||||
@ -309,15 +320,4 @@ position = Vector2(17, -3)
|
||||
[node name="LeftSpawn" type="Node2D" parent="."]
|
||||
position = Vector2(-14, -3)
|
||||
|
||||
[node name="PlayerGraphic" type="AnimatedSprite2D" parent="."]
|
||||
texture_filter = 1
|
||||
position = Vector2(0, -6)
|
||||
sprite_frames = SubResource("SpriteFrames_miouo")
|
||||
animation = &"idle"
|
||||
autoplay = "idle"
|
||||
frame_progress = 0.47372988
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(-7, -43)
|
||||
|
||||
[connection signal="animation_finished" from="PlayerGraphic" to="." method="_on_animation_finished"]
|
||||
|
||||
@ -3,7 +3,7 @@ extends Node2D
|
||||
var totalCoinsAvailable
|
||||
|
||||
var timer = Timer.new()
|
||||
var timeAvailable
|
||||
var timeAvailable := 0
|
||||
var level="res://Scenes/game.tscn"
|
||||
var levelTwo = "res://Scenes/level2.tscn"
|
||||
var startingCoins = 0
|
||||
@ -33,6 +33,7 @@ func _ready() -> void:
|
||||
enemy = load("res://Scripts/rscs/slimeStats.tres")
|
||||
|
||||
playerHealth = player.starting_health
|
||||
timeAvailable = timers[currentLevel]
|
||||
|
||||
add_child(timer)
|
||||
timer.wait_time = 1
|
||||
|
||||
@ -9,6 +9,7 @@ const JUMP_VELOCITY = -400.0
|
||||
@onready var right_spawn: Node2D = $RightSpawn
|
||||
@onready var left_spawn: Node2D = $LeftSpawn
|
||||
@onready var player_graphic: AnimatedSprite2D = $PlayerGraphic
|
||||
@onready var camera: Camera2D = $Camera2D
|
||||
|
||||
|
||||
enum FaceDirection{LEFT, RIGHT}
|
||||
@ -39,10 +40,10 @@ func _physics_process(delta: float) -> void:
|
||||
|
||||
# --- STAIRS OPT-IN LOGIC ---
|
||||
if can_mount_stairs and not is_on_stairs:
|
||||
print("Player: inside stairs trigger, waiting for up/down")
|
||||
|
||||
if Input.is_action_just_pressed("ui_up"):
|
||||
print("Player: ui_up pressed")
|
||||
|
||||
if Input.is_action_just_pressed("ui_down"):
|
||||
print("Player: ui_down pressed")
|
||||
|
||||
@ -97,11 +98,7 @@ func update_animation():
|
||||
player_graphic.play("hurt")
|
||||
State.DEATH:
|
||||
player_graphic.play("death")
|
||||
func handle_movement(delta):
|
||||
# Add the gravity.
|
||||
if not is_on_floor():
|
||||
velocity += get_gravity() * delta
|
||||
|
||||
func handle_movement(_delta):
|
||||
if direction:
|
||||
velocity.x = direction * SPEED
|
||||
if direction <0:
|
||||
@ -135,8 +132,8 @@ func handle_input():
|
||||
%SceneManager.makeBullet(left_spawn.global_transform, -700)
|
||||
|
||||
# Get the input direction and handle the movement/deceleration.
|
||||
# As good practice, you should replace UI actions with custom gameplay actions.
|
||||
direction = Input.get_axis("ui_left", "ui_right")
|
||||
|
||||
func handle_collisions():
|
||||
for i in get_slide_collision_count():
|
||||
var c = get_slide_collision(i)
|
||||
@ -169,6 +166,18 @@ func _ready() -> void:
|
||||
# Allow climbing up steeper slopes (default is ~45°)
|
||||
floor_max_angle = deg_to_rad(60) # you can increase or decrease as needed
|
||||
|
||||
func set_camera_limits(left: int, top: int, right: int, bottom: int) -> void:
|
||||
camera.limit_left = left
|
||||
camera.limit_top = top
|
||||
camera.limit_right = right
|
||||
camera.limit_bottom = bottom
|
||||
|
||||
print("Camera limits set:")
|
||||
print("Left: ", left)
|
||||
print("Top: ", top)
|
||||
print("Right: ", right)
|
||||
print("Bottom: ", bottom)
|
||||
|
||||
func _set_stair_collision(enabled: bool) -> void:
|
||||
print("[Player] set stair collision to:", enabled)
|
||||
set_collision_mask_value(STAIRS_LAYER, enabled)
|
||||
|
||||
@ -3,14 +3,28 @@ extends Node2D
|
||||
var bullet = preload("res://Scenes/bullet.tscn")
|
||||
var bulletArray = []
|
||||
var totalAllowedBullets = 7
|
||||
@onready var triggers: Node2D = $"../Triggers"
|
||||
@onready var coins: Node2D = $"../Coins"
|
||||
@onready var enemies: Node2D = $"../Enemies"
|
||||
@onready var player: Player = $"../Player"
|
||||
@onready var ui: Control = $"../CanvasLayer/UI"
|
||||
|
||||
var current_level_container: Node2D
|
||||
var current_level: Node2D
|
||||
var triggers: Node2D
|
||||
var coins: Node2D
|
||||
var enemies: Node2D
|
||||
var player: Player
|
||||
var ui: Control
|
||||
|
||||
func _ready() -> void:
|
||||
current_level_container = $"../CurrentLevel"
|
||||
current_level = current_level_container.get_child(0)
|
||||
|
||||
triggers = current_level.get_node("Triggers")
|
||||
coins = current_level.get_node("Coins")
|
||||
enemies = current_level.get_node_or_null("Enemies")
|
||||
|
||||
player = get_parent().get_node("Player")
|
||||
ui = current_level.get_node_or_null("CanvasLayer/UI")
|
||||
|
||||
apply_camera_limits()
|
||||
|
||||
Gamecontroller.reset()
|
||||
|
||||
for obj in triggers.get_children():
|
||||
@ -35,6 +49,23 @@ func _ready() -> void:
|
||||
Gamecontroller.playerDiesSignal.connect(player.playerDies)
|
||||
player.deathAnimationCompleteSignal.connect(Gamecontroller.playerDead)
|
||||
|
||||
func apply_camera_limits() -> void:
|
||||
var bounds = current_level.get_node_or_null("CameraBounds")
|
||||
|
||||
if bounds == null:
|
||||
print("No CameraBounds found in level")
|
||||
return
|
||||
|
||||
var top_left = bounds.get_node("TopLeft")
|
||||
var bottom_right = bounds.get_node("BottomRight")
|
||||
|
||||
player.set_camera_limits(
|
||||
int(top_left.global_position.x),
|
||||
int(top_left.global_position.y),
|
||||
int(bottom_right.global_position.x),
|
||||
int(bottom_right.global_position.y)
|
||||
)
|
||||
|
||||
#call this any time the coins change
|
||||
func updateCoins() -> void:
|
||||
var coinCount = 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user