diff --git a/assets/graphics/environment/backgrounds/forestbackground.png b/assets/graphics/environment/backgrounds/forestbackground.png new file mode 100644 index 0000000..975c185 Binary files /dev/null and b/assets/graphics/environment/backgrounds/forestbackground.png differ diff --git a/assets/graphics/environment/backgrounds/forestbackground.png.import b/assets/graphics/environment/backgrounds/forestbackground.png.import new file mode 100644 index 0000000..086fe5a --- /dev/null +++ b/assets/graphics/environment/backgrounds/forestbackground.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://l4a5qfhhue26" +path="res://.godot/imported/forestbackground.png-1170ae197e211023a79091cf48300332.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/environment/backgrounds/forestbackground.png" +dest_files=["res://.godot/imported/forestbackground.png-1170ae197e211023a79091cf48300332.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 diff --git a/assets/graphics/environment/backgrounds/sky.png b/assets/graphics/environment/backgrounds/sky.png new file mode 100644 index 0000000..286d1c6 Binary files /dev/null and b/assets/graphics/environment/backgrounds/sky.png differ diff --git a/assets/graphics/environment/backgrounds/sky.png.import b/assets/graphics/environment/backgrounds/sky.png.import new file mode 100644 index 0000000..55ac426 --- /dev/null +++ b/assets/graphics/environment/backgrounds/sky.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://s14ukqbx5mtf" +path="res://.godot/imported/sky.png-b132b9e240387925c40cca10d1d14c56.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/environment/backgrounds/sky.png" +dest_files=["res://.godot/imported/sky.png-b132b9e240387925c40cca10d1d14c56.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 diff --git a/assets/graphics/environment/backgrounds/trees.png b/assets/graphics/environment/backgrounds/trees.png new file mode 100644 index 0000000..a8c2aa2 Binary files /dev/null and b/assets/graphics/environment/backgrounds/trees.png differ diff --git a/assets/graphics/environment/backgrounds/trees.png.import b/assets/graphics/environment/backgrounds/trees.png.import new file mode 100644 index 0000000..0cf34c2 --- /dev/null +++ b/assets/graphics/environment/backgrounds/trees.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dv63a7rb24ob8" +path="res://.godot/imported/trees.png-b1cfb32a6f99a640507fdab863a473f5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/environment/backgrounds/trees.png" +dest_files=["res://.godot/imported/trees.png-b1cfb32a6f99a640507fdab863a473f5.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 diff --git a/assets/graphics/environment/terrain/mushroom_32x64.png b/assets/graphics/environment/terrain/mushroom_32x64.png new file mode 100644 index 0000000..f3ed761 Binary files /dev/null and b/assets/graphics/environment/terrain/mushroom_32x64.png differ diff --git a/assets/graphics/environment/terrain/mushroom_32x64.png.import b/assets/graphics/environment/terrain/mushroom_32x64.png.import new file mode 100644 index 0000000..9efe631 --- /dev/null +++ b/assets/graphics/environment/terrain/mushroom_32x64.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cy0lgun8t11xv" +path="res://.godot/imported/mushroom_32x64.png-cefb137d64a82ca31a8f0068d916c09f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/environment/terrain/mushroom_32x64.png" +dest_files=["res://.godot/imported/mushroom_32x64.png-cefb137d64a82ca31a8f0068d916c09f.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 diff --git a/assets/graphics/environment/terrain/veg_32x32.png b/assets/graphics/environment/terrain/veg_32x32.png new file mode 100644 index 0000000..4e09fa9 Binary files /dev/null and b/assets/graphics/environment/terrain/veg_32x32.png differ diff --git a/assets/graphics/environment/terrain/veg_32x32.png.import b/assets/graphics/environment/terrain/veg_32x32.png.import new file mode 100644 index 0000000..e8b531f --- /dev/null +++ b/assets/graphics/environment/terrain/veg_32x32.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dvn642wmhcrfc" +path="res://.godot/imported/veg_32x32.png-4b0b47ef99f3aa28e8f24956e44a31a5.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/environment/terrain/veg_32x32.png" +dest_files=["res://.godot/imported/veg_32x32.png-4b0b47ef99f3aa28e8f24956e44a31a5.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 diff --git a/assets/graphics/objects/crate.png b/assets/graphics/objects/crate.png new file mode 100644 index 0000000..2b8bdcd Binary files /dev/null and b/assets/graphics/objects/crate.png differ diff --git a/assets/graphics/objects/crate.png.import b/assets/graphics/objects/crate.png.import new file mode 100644 index 0000000..2cdb2e0 --- /dev/null +++ b/assets/graphics/objects/crate.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bnhycmkyqxdiu" +path="res://.godot/imported/crate.png-b286bd97caa3cbc59746f2db7de46191.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/objects/crate.png" +dest_files=["res://.godot/imported/crate.png-b286bd97caa3cbc59746f2db7de46191.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 diff --git a/assets/graphics/pickups/coin.png b/assets/graphics/pickups/coin.png new file mode 100644 index 0000000..01ae33d Binary files /dev/null and b/assets/graphics/pickups/coin.png differ diff --git a/assets/graphics/pickups/coin.png.import b/assets/graphics/pickups/coin.png.import new file mode 100644 index 0000000..3a35f7d --- /dev/null +++ b/assets/graphics/pickups/coin.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b22ko1chbu1t2" +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/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 diff --git a/assets/graphics/projectiles/pixel_bullet.png b/assets/graphics/projectiles/pixel_bullet.png new file mode 100644 index 0000000..900d030 Binary files /dev/null and b/assets/graphics/projectiles/pixel_bullet.png differ diff --git a/assets/graphics/projectiles/pixel_bullet.png.import b/assets/graphics/projectiles/pixel_bullet.png.import new file mode 100644 index 0000000..bb57143 --- /dev/null +++ b/assets/graphics/projectiles/pixel_bullet.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dbm1x33raub7h" +path="res://.godot/imported/pixel_bullet.png-30d6d1e8b5e1332f8b2e2cee72a9e790.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/graphics/projectiles/pixel_bullet.png" +dest_files=["res://.godot/imported/pixel_bullet.png-30d6d1e8b5e1332f8b2e2cee72a9e790.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 diff --git a/project.godot b/project.godot index d8ae8dc..2f84cee 100644 --- a/project.godot +++ b/project.godot @@ -15,6 +15,14 @@ run/main_scene="uid://coiqh7p31ukig" config/features=PackedStringArray("4.4", "Forward Plus") config/icon="res://icon.svg" +[display] + +window/size/viewport_width=320 +window/size/viewport_height=180 +window/size/window_width_override=960 +window/size/window_height_override=540 +window/stretch/mode="viewport" + [input] shove={ diff --git a/scenes/bullet.tscn b/scenes/bullet.tscn index b7f85da..e23caf1 100644 --- a/scenes/bullet.tscn +++ b/scenes/bullet.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=3 format=3 uid="uid://dopt3unflv7l3"] +[gd_scene load_steps=4 format=3 uid="uid://dopt3unflv7l3"] [ext_resource type="Script" uid="uid://bhh178vuo5bgo" path="res://scripts/bullet.gd" id="1_mkf8s"] +[ext_resource type="Texture2D" uid="uid://dbm1x33raub7h" path="res://assets/graphics/projectiles/pixel_bullet.png" id="2_y25gk"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_y25gk"] size = Vector2(8, 4) @@ -12,4 +13,11 @@ script = ExtResource("1_mkf8s") shape = SubResource("RectangleShape2D_y25gk") debug_color = Color(0.97707, 0.111833, 0.261075, 0.42) +[node name="BulletGraphic" type="Sprite2D" parent="."] +texture_filter = 1 +position = Vector2(-2, -1) +rotation = 3.14159 +scale = Vector2(0.06, 0.06) +texture = ExtResource("2_y25gk") + [connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/coin.gd b/scenes/coin.gd new file mode 100644 index 0000000..551c4e0 --- /dev/null +++ b/scenes/coin.gd @@ -0,0 +1,7 @@ +class_name Coin extends Area2D + +signal coinCollectedSignal(body, coin) + +func _on_body_entered(body: Node2D) -> void: + print("coin collision") + coinCollectedSignal.emit(body, self) diff --git a/scenes/coin.gd.uid b/scenes/coin.gd.uid new file mode 100644 index 0000000..ed9a714 --- /dev/null +++ b/scenes/coin.gd.uid @@ -0,0 +1 @@ +uid://nqigicsb4oqh diff --git a/scenes/coin.tscn b/scenes/coin.tscn new file mode 100644 index 0000000..04e0c2a --- /dev/null +++ b/scenes/coin.tscn @@ -0,0 +1,114 @@ +[gd_scene load_steps=17 format=3 uid="uid://bfvm14fearqvq"] + +[ext_resource type="Script" uid="uid://nqigicsb4oqh" path="res://scenes/coin.gd" id="1_i64fm"] +[ext_resource type="Texture2D" uid="uid://b22ko1chbu1t2" path="res://assets/graphics/pickups/coin.png" id="2_11l1o"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_d14el"] +atlas = ExtResource("2_11l1o") +region = Rect2(0, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1ikuy"] +atlas = ExtResource("2_11l1o") +region = Rect2(16, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wnlwo"] +atlas = ExtResource("2_11l1o") +region = Rect2(32, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jig8b"] +atlas = ExtResource("2_11l1o") +region = Rect2(48, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_xmuha"] +atlas = ExtResource("2_11l1o") +region = Rect2(64, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kfxoj"] +atlas = ExtResource("2_11l1o") +region = Rect2(80, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_jsmju"] +atlas = ExtResource("2_11l1o") +region = Rect2(96, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_s0mny"] +atlas = ExtResource("2_11l1o") +region = Rect2(112, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_7cc30"] +atlas = ExtResource("2_11l1o") +region = Rect2(128, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_rojmm"] +atlas = ExtResource("2_11l1o") +region = Rect2(144, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ls27i"] +atlas = ExtResource("2_11l1o") +region = Rect2(160, 0, 16, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_ssuvv"] +atlas = ExtResource("2_11l1o") +region = Rect2(176, 0, 16, 16) + +[sub_resource type="SpriteFrames" id="SpriteFrames_6jg3o"] +animations = [{ +"frames": [{ +"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") +}, { +"duration": 1.0, +"texture": SubResource("AtlasTexture_ssuvv") +}], +"loop": true, +"name": &"idle", +"speed": 12.0 +}] + +[sub_resource type="CircleShape2D" id="CircleShape2D_rsyy1"] +radius = 5.0 + +[node name="Coin" type="Area2D"] +script = ExtResource("1_i64fm") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +texture_filter = 1 +sprite_frames = SubResource("SpriteFrames_6jg3o") +animation = &"idle" +autoplay = "idle" +frame_progress = 0.364422 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_rsyy1") + +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/scenes/crate.tscn b/scenes/crate.tscn index 74ae50b..c75291b 100644 --- a/scenes/crate.tscn +++ b/scenes/crate.tscn @@ -1,14 +1,19 @@ -[gd_scene load_steps=3 format=3 uid="uid://dlihpyr58tqqq"] +[gd_scene load_steps=4 format=3 uid="uid://dlihpyr58tqqq"] [ext_resource type="Script" uid="uid://c5gjsxgxmjfki" path="res://scripts/crate.gd" id="1_b66cd"] +[ext_resource type="Texture2D" uid="uid://bnhycmkyqxdiu" path="res://assets/graphics/objects/crate.png" id="2_dwt0d"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_uwrxv"] [node name="Crate" type="RigidBody2D" groups=["pushables", "shootables"]] -rotation = -0.301036 script = ExtResource("1_b66cd") metadata/_edit_group_ = true +[node name="Sprite2D" type="Sprite2D" parent="."] +texture_filter = 1 +scale = Vector2(0.08, 0.08) +texture = ExtResource("2_dwt0d") + [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("RectangleShape2D_uwrxv") debug_color = Color(0.817443, 0.400008, 0.177458, 0.42) diff --git a/scenes/game.tscn b/scenes/game.tscn index 3547036..f0561a0 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,67 +1,410 @@ -[gd_scene load_steps=12 format=3 uid="uid://coiqh7p31ukig"] +[gd_scene load_steps=18 format=4 uid="uid://coiqh7p31ukig"] [ext_resource type="Script" uid="uid://bblqtronap0j4" path="res://scripts/gamecontroller.gd" id="1_lnu2h"] [ext_resource type="PackedScene" uid="uid://dlihpyr58tqqq" path="res://scenes/crate.tscn" id="2_lbhrr"] [ext_resource type="PackedScene" uid="uid://boqg1nyudmkh4" path="res://scenes/player.tscn" id="2_lnu2h"] [ext_resource type="Script" uid="uid://d1daji4xwuj03" path="res://scripts/scene_manager.gd" id="2_p57ef"] -[ext_resource type="PackedScene" uid="uid://csotsc2cycyia" path="res://scenes/trigger.tscn" id="2_yqjtg"] +[ext_resource type="Texture2D" uid="uid://s14ukqbx5mtf" path="res://assets/graphics/environment/backgrounds/sky.png" id="3_0tnpc"] [ext_resource type="Texture2D" uid="uid://bqe3w5v76lyek" path="res://assets/graphics/environment/terrain/Terrain (32x32).png" id="3_u5sy4"] -[ext_resource type="PackedScene" uid="uid://dopt3unflv7l3" path="res://scenes/bullet.tscn" id="5_iywne"] +[ext_resource type="Texture2D" uid="uid://l4a5qfhhue26" path="res://assets/graphics/environment/backgrounds/forestbackground.png" id="4_vtaks"] +[ext_resource type="Texture2D" uid="uid://dv63a7rb24ob8" path="res://assets/graphics/environment/backgrounds/trees.png" id="5_kvpfn"] +[ext_resource type="Texture2D" uid="uid://dvn642wmhcrfc" path="res://assets/graphics/environment/terrain/veg_32x32.png" id="5_vtaks"] +[ext_resource type="Texture2D" uid="uid://cy0lgun8t11xv" path="res://assets/graphics/environment/terrain/mushroom_32x64.png" id="6_kvpfn"] +[ext_resource type="PackedScene" uid="uid://bfvm14fearqvq" path="res://scenes/coin.tscn" id="11_kvpfn"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_gee14"] texture = ExtResource("3_u5sy4") 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, 0.526663, -1.31666, -0.26333, -1.84332, 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, -0.26333, -16, 0) +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, -0.789993, 16, -0.26873, -0.129454, -16, 0) +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 0:1/0 = 0 +0:1/0/terrain_set = 0 +0:1/0/terrain = 0 +0:1/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, -16, -16, 1.31666, -16, 1.05332, 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/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(-1.31666, -16, 16, -16, 16, 16, -0.789993, 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, 3.94997, 16, 16, -16, 16, -16, -16, 1.31666, -16, 0.789993, 3.68664) +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.84332, 16, 16, -16, 16, -16, 1.57999) +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(-1.31666, -16, 16, -16, 16, 16, -16, 16, -16, 1.57999, 0.526663, 1.84332) +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, -16, -16, 0.26333, -16, 0.789993, 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.31666, 16, 1.31666, -16, 16, -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, 0.526663, -16, -16, 16, -16, 16, -0.26333) +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, 0.526663, -16, -16, 16, -16, 16, -0.26333) +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, -6.58328, 16, -16, 5.26662) +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, 7.37327, 7.6366, 16, -16, 16) +2:4/0/terrains_peering_bit/left_side = 0 4:4/0 = 0 +4:4/0/terrain_set = 0 +4:4/0/terrain = 0 +4:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, -16, 16, -16, 16, 16, -16, 16) 6:4/0 = 0 +6:4/0/terrain_set = 0 +6:4/0/terrain = 0 +6:4/0/physics_layer_0/polygon_0/points = PackedVector2Array(-16, 16, -16, -16, 0.26333, -16, 0.789993, 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.31666, 16, 1.31666, -16, 16, -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, 1.05333, 16, 0.526663, 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, 1.05333, 16, 0.526663, 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_dinhu"] +texture = ExtResource("5_vtaks") +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_kvuet"] +texture = ExtResource("6_kvpfn") +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="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" +terrain_set_0/terrain_1/color = Color(0.5, 0.4375, 0.25, 1) sources/0 = SubResource("TileSetAtlasSource_gee14") +sources/1 = SubResource("TileSetAtlasSource_dinhu") +sources/2 = SubResource("TileSetAtlasSource_kvuet") [sub_resource type="RectangleShape2D" id="RectangleShape2D_8cj0n"] size = Vector2(44, 20) @@ -75,13 +418,38 @@ script = ExtResource("1_lnu2h") unique_name_in_owner = true script = ExtResource("2_p57ef") +[node name="skylayer" type="Parallax2D" parent="."] +repeat_size = Vector2(320, 180) + +[node name="Sprite2D" type="Sprite2D" parent="skylayer"] +position = Vector2(160, 90) +texture = ExtResource("3_0tnpc") + +[node name="farlayer" type="Parallax2D" parent="."] +scroll_scale = Vector2(1.2, 1) +repeat_size = Vector2(320, 0) + +[node name="Sprite2D" type="Sprite2D" parent="farlayer"] +texture_filter = 1 +position = Vector2(160, 320) +texture = ExtResource("4_vtaks") + +[node name="Midlayer" type="Parallax2D" parent="."] +scroll_scale = Vector2(1.4, 1) +repeat_size = Vector2(320, 0) + +[node name="Sprite2D" type="Sprite2D" parent="Midlayer"] +texture_filter = 1 +position = Vector2(160, 330) +texture = ExtResource("5_kvpfn") + [node name="TileMapLayer" type="TileMapLayer" parent="."] texture_filter = 1 -tile_map_data = PackedByteArray(0, 0, 17, 0, 12, 0, 0, 0, 4, 0, 4, 0, 0, 0, 18, 0, 12, 0, 0, 0, 4, 0, 4, 0, 0, 0) +tile_map_data = PackedByteArray("AAAOAAsAAAACAAAAAAANAAsAAAAAAAAAAAAMAAkAAAAEAAQAAAAOAA4AAAACAAIAAAANAA4AAAAAAAIAAAAMABAAAAAEAAQAAAAWAAsAAAACAAIAAAAVAAsAAAAAAAIAAAAVAAoAAAAAAAAAAAAWAAoAAAACAAAAAAATAAkAAAACAAQAAAASAAkAAAABAAQAAAARAAkAAAAAAAQAAAASAAsAAQAAAAAAAAANAAoAAQAAAAAAAAATAAgAAQAAAAAAAAAVAAkAAQAAAAAAAAAWAAkAAgAAAAEAAAAWAAgAAgAAAAAAAAAHAA0AAAAAAAIAAAAIAA0AAAABAAIAAAAJAA0AAAABAAIAAAAKAA0AAAAHAAAAAAAKAA4AAAAAAAIAAAALAA4AAAACAAIAAAAMAA0AAAABAAIAAAANAA0AAAAHAAAAAAAOAA0AAAAGAAAAAAAPAA0AAAABAAIAAAAQAA0AAAABAAIAAAARAA0AAAABAAIAAAASAA0AAAABAAIAAAATAA0AAAABAAIAAAAUAA0AAAACAAIAAAAUAAwAAAACAAAAAAATAAwAAAABAAAAAAASAAwAAAABAAAAAAAQAAwAAAABAAAAAAAPAAwAAAABAAAAAAAOAAwAAAAGAAEAAAANAAwAAAAHAAEAAAAMAAwAAAABAAAAAAALAA0AAAAGAAAAAAALAAwAAAABAAAAAAAKAAwAAAABAAAAAAAJAAwAAAABAAAAAAAIAAwAAAABAAAAAAAHAAwAAAAAAAAAAAARAAwAAAABAAAAAAA=") tile_set = SubResource("TileSet_0tnpc") [node name="StaticBody2D" type="StaticBody2D" parent="."] -position = Vector2(567, 395) +position = Vector2(743, 490) metadata/_edit_group_ = true [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] @@ -98,15 +466,17 @@ metadata/_edit_group_ = true shape = SubResource("WorldBoundaryShape2D_8cj0n") [node name="Player" parent="." instance=ExtResource("2_lnu2h")] -position = Vector2(566, 374) - -[node name="Bullet" parent="." instance=ExtResource("5_iywne")] -position = Vector2(351, 312) +position = Vector2(563, 364) [node name="triggers" type="Node2D" parent="."] -[node name="player_hurt" parent="triggers" instance=ExtResource("2_yqjtg")] -position = Vector2(428, 547) -effect = "player_hurt" +[node name="coins" type="Node2D" parent="."] -[connection signal="areaTriggerSignal" from="triggers/player_hurt" to="." method="_on_trigger"] +[node name="Coin" parent="coins" instance=ExtResource("11_kvpfn")] +position = Vector2(606, 375) + +[node name="Coin2" parent="coins" instance=ExtResource("11_kvpfn")] +position = Vector2(395, 282) + +[node name="Coin3" parent="coins" instance=ExtResource("11_kvpfn")] +position = Vector2(703, 313) diff --git a/scenes/player.tscn b/scenes/player.tscn index 10209ee..c3b0ba3 100644 --- a/scenes/player.tscn +++ b/scenes/player.tscn @@ -208,4 +208,7 @@ sprite_frames = SubResource("SpriteFrames_jej6c") animation = &"fall" autoplay = "idle" +[node name="Camera2D" type="Camera2D" parent="."] +offset = Vector2(0, -40) + [connection signal="animation_finished" from="PlayerGraphic" to="." method="_on_animation_finished"] diff --git a/scripts/bullet.gd b/scripts/bullet.gd index 57a32a7..0e36f23 100644 --- a/scripts/bullet.gd +++ b/scripts/bullet.gd @@ -1,4 +1,5 @@ class_name Bullet extends Area2D +@onready var bullet_graphic: Sprite2D = $BulletGraphic var speed:float = 700 @@ -6,6 +7,10 @@ signal bulletDamageSignal(body, bullet) func setSpeed(value:float): speed = value + if value<0: + bullet_graphic.flip_h = true + if value>0: + bullet_graphic.flip_h = false func _physics_process(delta: float) -> void: position += transform.x * speed * delta diff --git a/scripts/gamecontroller.gd b/scripts/gamecontroller.gd index 86b9cfb..4fcac18 100644 --- a/scripts/gamecontroller.gd +++ b/scripts/gamecontroller.gd @@ -25,3 +25,6 @@ func bulletDamage(body, bullet): print("GC know about bullet hit") body.queue_free() +func coinCollected(body, coin): + print("GC knows coin collected") + diff --git a/scripts/scene_manager.gd b/scripts/scene_manager.gd index 83bdede..f32695b 100644 --- a/scripts/scene_manager.gd +++ b/scripts/scene_manager.gd @@ -4,6 +4,7 @@ var totalAllowedBullets = 7 var bullet = preload("res://scenes/bullet.tscn") @onready var game: Node2D = $".." @onready var triggers: Node2D = $"../triggers" +@onready var coins: Node2D = $"../coins" # Called when the node enters the scene tree for the first time. func _ready() -> void: @@ -11,6 +12,10 @@ func _ready() -> void: for obj in triggers.get_children(): if obj is Trigger: obj.areaTriggerSignal.connect(game._on_trigger) + if coins: + for obj in coins.get_children(): + if obj is Coin: + obj.coinCollectedSignal.connect(game.coinCollected) # Called every frame. 'delta' is the elapsed time since the previous frame.