From 77b9080c3b375b44b0cd830fe31bf60480c85619 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Mon, 18 Apr 2022 01:21:58 +0530 Subject: Player Animation converted to Animation Tree Level 1 Design Door Mechanism Core Gameplay Mechanism - In-Progress --- .../door.png-5d517bf8d15491aeda1cf3ab4a2489c5.md5 | 3 + .../door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex | Bin 0 -> 1486 bytes ...r_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.md5 | 3 + ...pen.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample | Bin 0 -> 49157 bytes .../left.png-74bbf33828a4b134e6d58e317f953292.md5 | 3 + .../left.png-74bbf33828a4b134e6d58e317f953292.stex | Bin 0 -> 190 bytes ...pleted.wav-a05bc55f65f0fff09d96a709595406d1.md5 | 3 + ...ted.wav-a05bc55f65f0fff09d96a709595406d1.sample | Bin 0 -> 49157 bytes .import/x.png-bb4069b3be26433a9f1a700ec612b871.md5 | 3 + .../x.png-bb4069b3be26433a9f1a700ec612b871.stex | Bin 0 -> 190 bytes collectables/Apple.gd | 7 +- collectables/Apple.tscn | 15 +- entities/chicken/chicken.tscn | 14 +- entities/player/Player.gd | 35 +++-- entities/player/Player.tscn | 128 ++++++++++++++--- export_presets.cfg | 34 +++++ project.godot | 5 + scenes/level1.gd | 4 + scenes/level1.tscn | 158 +++++---------------- sfx/door_open.wav | Bin 0 -> 48870 bytes sfx/door_open.wav.import | 21 +++ sfx/found_item.wav | Bin 48870 -> 0 bytes sfx/found_item.wav.import | 21 --- singletons/SignalBus.gd | 3 +- static/door/door.gd | 10 ++ static/door/door.png | Bin 0 -> 2853 bytes static/door/door.png.import | 35 +++++ static/door/door.tscn | 65 +++++++++ static/left.png | Bin 0 -> 235 bytes static/left.png.import | 35 +++++ static/x.png | Bin 0 -> 234 bytes static/x.png.import | 35 +++++ 32 files changed, 448 insertions(+), 192 deletions(-) create mode 100644 .import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.md5 create mode 100644 .import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex create mode 100644 .import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.md5 create mode 100644 .import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample create mode 100644 .import/left.png-74bbf33828a4b134e6d58e317f953292.md5 create mode 100644 .import/left.png-74bbf33828a4b134e6d58e317f953292.stex create mode 100644 .import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.md5 create mode 100644 .import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.sample create mode 100644 .import/x.png-bb4069b3be26433a9f1a700ec612b871.md5 create mode 100644 .import/x.png-bb4069b3be26433a9f1a700ec612b871.stex create mode 100644 scenes/level1.gd create mode 100644 sfx/door_open.wav create mode 100644 sfx/door_open.wav.import delete mode 100644 sfx/found_item.wav delete mode 100644 sfx/found_item.wav.import create mode 100644 static/door/door.gd create mode 100644 static/door/door.png create mode 100644 static/door/door.png.import create mode 100644 static/door/door.tscn create mode 100644 static/left.png create mode 100644 static/left.png.import create mode 100644 static/x.png create mode 100644 static/x.png.import diff --git a/.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.md5 b/.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.md5 new file mode 100644 index 0000000..3acf881 --- /dev/null +++ b/.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.md5 @@ -0,0 +1,3 @@ +source_md5="ee0e10338434390644b7e0b9c4af51b9" +dest_md5="1014a6752acaf8ab660e590f99bbd57b" + diff --git a/.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex b/.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex new file mode 100644 index 0000000..1535c75 Binary files /dev/null and b/.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex differ diff --git a/.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.md5 b/.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.md5 new file mode 100644 index 0000000..128e96d --- /dev/null +++ b/.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.md5 @@ -0,0 +1,3 @@ +source_md5="156bfc6ce4a9ded88f2c0a5ff9aeae39" +dest_md5="225db413ce8d8f60027e5f0d5805089e" + diff --git a/.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample b/.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample new file mode 100644 index 0000000..a5907e2 Binary files /dev/null and b/.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample differ diff --git a/.import/left.png-74bbf33828a4b134e6d58e317f953292.md5 b/.import/left.png-74bbf33828a4b134e6d58e317f953292.md5 new file mode 100644 index 0000000..3572cce --- /dev/null +++ b/.import/left.png-74bbf33828a4b134e6d58e317f953292.md5 @@ -0,0 +1,3 @@ +source_md5="1d4ff825279e78a9c2d11d734fe19878" +dest_md5="6515911556e76936d6f95d2fa937ea06" + diff --git a/.import/left.png-74bbf33828a4b134e6d58e317f953292.stex b/.import/left.png-74bbf33828a4b134e6d58e317f953292.stex new file mode 100644 index 0000000..cba24b9 Binary files /dev/null and b/.import/left.png-74bbf33828a4b134e6d58e317f953292.stex differ diff --git a/.import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.md5 b/.import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.md5 new file mode 100644 index 0000000..128e96d --- /dev/null +++ b/.import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.md5 @@ -0,0 +1,3 @@ +source_md5="156bfc6ce4a9ded88f2c0a5ff9aeae39" +dest_md5="225db413ce8d8f60027e5f0d5805089e" + diff --git a/.import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.sample b/.import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.sample new file mode 100644 index 0000000..a5907e2 Binary files /dev/null and b/.import/level_completed.wav-a05bc55f65f0fff09d96a709595406d1.sample differ diff --git a/.import/x.png-bb4069b3be26433a9f1a700ec612b871.md5 b/.import/x.png-bb4069b3be26433a9f1a700ec612b871.md5 new file mode 100644 index 0000000..cb294f3 --- /dev/null +++ b/.import/x.png-bb4069b3be26433a9f1a700ec612b871.md5 @@ -0,0 +1,3 @@ +source_md5="b177c3e5cbb8ae86e1e61ee59966d136" +dest_md5="4ab49f55270266f9f70e51d7023a9e03" + diff --git a/.import/x.png-bb4069b3be26433a9f1a700ec612b871.stex b/.import/x.png-bb4069b3be26433a9f1a700ec612b871.stex new file mode 100644 index 0000000..1121846 Binary files /dev/null and b/.import/x.png-bb4069b3be26433a9f1a700ec612b871.stex differ diff --git a/collectables/Apple.gd b/collectables/Apple.gd index abf0db3..c69a100 100644 --- a/collectables/Apple.gd +++ b/collectables/Apple.gd @@ -1,13 +1,16 @@ extends Node2D export var health=10 +var collected = false func _ready(): $AnimationPlayer.play("idle") func _on_Area2D_body_entered(body): - if (body.name=="Player"): - body.health += health + if (body.name=="Player" and !collected): + collected = true + SignalBus.emit_signal("on_apples_collected",1) self.hide() + $Sprite/Area2D.set_collision_mask_bit(1,false) $pickup.play() func _on_pickup_finished(): diff --git a/collectables/Apple.tscn b/collectables/Apple.tscn index fe4a8e9..e092a9c 100644 --- a/collectables/Apple.tscn +++ b/collectables/Apple.tscn @@ -24,17 +24,20 @@ tracks/0/keys = { [sub_resource type="Animation" id=3] resource_name = "idle" +length = 2.0 loop = true -step = 0.0625 -tracks/0/type = "bezier" +step = 0.04 +tracks/0/type = "value" tracks/0/path = NodePath("Sprite:frame") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"points": PoolRealArray( 0, -0.25, 0, 0.25, 0, 1, -0.25, 0, 0.25, 0, 2, -0.25, 0, 0.25, 0, 3, -0.25, 0, 0.25, 0, 4, -0.25, 0, 0.25, 0, 5, -0.25, 0, 0.25, 0, 6, -0.25, 0, 0.25, 0, 7, -0.25, 0, 0.25, 0, 8, -0.25, 0, 0.25, 0, 9, -0.25, 0, 0.25, 0, 10, -0.25, 0, 0.25, 0, 11, -0.25, 0, 0.25, 0, 12, -0.25, 0, 0.25, 0, 13, -0.25, 0, 0.25, 0, 14, -0.25, 0, 0.25, 0, 15, -0.25, 0, 0.25, 0, 16, -0.25, 0, 0.25, 0 ), -"times": PoolRealArray( 0, 0.0625, 0.125, 0.1875, 0.25, 0.3125, 0.375, 0.4375, 0.5, 0.5625, 0.625, 0.6875, 0.75, 0.8125, 0.875, 0.9375, 1 ) +"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 16, 16, 16, 16 ] } [node name="Apple" type="Node2D"] @@ -52,11 +55,11 @@ shape = SubResource( 1 ) [node name="AnimationPlayer" type="AnimationPlayer" parent="."] playback_default_blend_time = 387.02 -playback_speed = 64.0 +playback_speed = 6.56 anims/RESET = SubResource( 2 ) anims/idle = SubResource( 3 ) -[node name="pickup" type="AudioStreamPlayer2D" parent="."] +[node name="pickup" type="AudioStreamPlayer" parent="."] stream = ExtResource( 3 ) [connection signal="body_entered" from="Sprite/Area2D" to="." method="_on_Area2D_body_entered"] diff --git a/entities/chicken/chicken.tscn b/entities/chicken/chicken.tscn index 23cd9ad..ec73f31 100644 --- a/entities/chicken/chicken.tscn +++ b/entities/chicken/chicken.tscn @@ -41,14 +41,14 @@ animations = [ { "name": "idle", "speed": 25.0 }, { -"frames": [ ExtResource( 17 ), ExtResource( 1 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 18 ) ], +"frames": [ ExtResource( 23 ), ExtResource( 30 ), ExtResource( 25 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 26 ), ExtResource( 21 ), ExtResource( 27 ), ExtResource( 28 ), ExtResource( 31 ), ExtResource( 24 ), ExtResource( 22 ), ExtResource( 29 ), ExtResource( 32 ) ], "loop": true, -"name": "hit", +"name": "run", "speed": 25.0 }, { -"frames": [ ExtResource( 23 ), ExtResource( 30 ), ExtResource( 25 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 26 ), ExtResource( 21 ), ExtResource( 27 ), ExtResource( 28 ), ExtResource( 31 ), ExtResource( 24 ), ExtResource( 22 ), ExtResource( 29 ), ExtResource( 32 ) ], +"frames": [ ExtResource( 17 ), ExtResource( 1 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 18 ) ], "loop": true, -"name": "run", +"name": "hit", "speed": 25.0 } ] @@ -59,6 +59,8 @@ extents = Vector2( 13, 14.5 ) extents = Vector2( 13, 14.5 ) [node name="Chicken" type="KinematicBody2D"] +collision_layer = 2 +collision_mask = 5 script = ExtResource( 33 ) [node name="AnimatedSprite" type="AnimatedSprite" parent="."] @@ -66,11 +68,15 @@ frames = SubResource( 1 ) animation = "run" [node name="Area2D" type="Area2D" parent="AnimatedSprite"] +collision_layer = 0 +collision_mask = 0 [node name="CollisionShape2D" type="CollisionShape2D" parent="AnimatedSprite/Area2D"] position = Vector2( 0, 0.5 ) shape = SubResource( 3 ) +one_way_collision_margin = 0.0 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] position = Vector2( 0, 0.5 ) shape = SubResource( 2 ) +one_way_collision_margin = 0.0 diff --git a/entities/player/Player.gd b/entities/player/Player.gd index 6087221..ff11b18 100644 --- a/entities/player/Player.gd +++ b/entities/player/Player.gd @@ -5,17 +5,18 @@ export (int) var jump_speed = -400 export (int) var gravity = 1200 export var entity_type = "PLAYER" export (int) var health = 90 -var hurt = false - +export (int) var total_apples_need = 0 +var total_apples_collected = 0 var velocity = Vector2() var jumping = false onready var sprite = $AnimatedSprite +onready var state_machine = $AnimationTree.get("parameters/playback") var facing_right = true func get_input(): velocity.x = 0 var right = Input.is_action_pressed('right') var left = Input.is_action_pressed('left') - var jump = Input.is_action_just_pressed('jump') + var jump = Input.is_action_pressed('jump') if facing_right == true: sprite.flip_h = false @@ -29,33 +30,37 @@ func get_input(): if right: velocity.x += run_speed facing_right = true - play_animation("run") + state_machine.travel("run") elif left: velocity.x -= run_speed facing_right = false - play_animation("run") - else: - play_animation("idle") + state_machine.travel("run") + + if velocity.length() == 0: + state_machine.travel("idle") if !jumping && !is_on_floor(): - play_animation("jump") + state_machine.travel("jump") func _physics_process(delta): get_input() velocity.y += gravity * delta if jumping and is_on_floor(): jumping = false + if total_apples_collected==total_apples_need: + SignalBus.emit_signal("open_level_door",true) velocity = move_and_slide(velocity, Vector2(0, -1)) + print("Total Apples Needed",total_apples_need) -func _on_enemyHit(health): - hurt = true - play_animation("hit") +func _on_enemyHit(_health): + state_machine.travel("hit") + +func _on_apples_collected(apple_count): + total_apples_collected += apple_count func _ready() -> void: SignalBus.connect("on_hit", self, "_on_enemyHit") + SignalBus.connect("on_apples_collected", self, "_on_apples_collected") func play_animation(animation_name): - if $AnimatedSprite.get_animation()!=animation_name : - #$AnimatedSprite.play(animation_name) - #$AnimatedSprite/AnimationPlayer.stop() - $AnimatedSprite/AnimationPlayer.play(animation_name) + pass diff --git a/entities/player/Player.tscn b/entities/player/Player.tscn index 26ade6f..bb0cea8 100644 --- a/entities/player/Player.tscn +++ b/entities/player/Player.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=52 format=2] +[gd_scene load_steps=64 format=2] [ext_resource path="res://pinkman/run/run7.png" type="Texture" id=1] [ext_resource path="res://pinkman/double-jump/double_jump6.png" type="Texture" id=2] -[ext_resource path="res://pinkman/hit/hit6.png" type="Texture" id=3] [ext_resource path="res://pinkman/idle/idle4.png" type="Texture" id=4] [ext_resource path="res://pinkman/wall-jump/wall-jump2.png" type="Texture" id=5] [ext_resource path="res://pinkman/fall/fall.png" type="Texture" id=6] @@ -35,13 +34,10 @@ [ext_resource path="res://pinkman/hit/hit3.png" type="Texture" id=33] [ext_resource path="res://pinkman/run/run1.png" type="Texture" id=34] [ext_resource path="res://pinkman/run/run8.png" type="Texture" id=35] -[ext_resource path="res://pinkman/hit/hit5.png" type="Texture" id=36] [ext_resource path="res://pinkman/run/run10.png" type="Texture" id=37] -[ext_resource path="res://pinkman/hit/hit4.png" type="Texture" id=38] [ext_resource path="res://pinkman/run/run2.png" type="Texture" id=39] [ext_resource path="res://pinkman/run/run12.png" type="Texture" id=40] [ext_resource path="res://pinkman/run/run3.png" type="Texture" id=41] -[ext_resource path="res://pinkman/hit/hit7.png" type="Texture" id=42] [ext_resource path="res://pinkman/run/run4.png" type="Texture" id=43] [ext_resource path="res://entities/player/Player.gd" type="Script" id=44] @@ -53,36 +49,36 @@ animations = [ { "frames": [ ExtResource( 12 ), ExtResource( 29 ), ExtResource( 20 ), ExtResource( 4 ), ExtResource( 22 ), ExtResource( 23 ), ExtResource( 13 ), ExtResource( 27 ), ExtResource( 21 ), ExtResource( 28 ), ExtResource( 9 ) ], "loop": true, "name": "idle", -"speed": 25.0 +"speed": 15.0 }, { -"frames": [ ExtResource( 17 ), ExtResource( 5 ), ExtResource( 30 ), ExtResource( 15 ), ExtResource( 14 ) ], -"loop": true, -"name": "wall_jump", -"speed": 25.0 -}, { -"frames": [ ExtResource( 6 ) ], +"frames": [ ExtResource( 34 ), ExtResource( 39 ), ExtResource( 41 ), ExtResource( 43 ), ExtResource( 32 ), ExtResource( 11 ), ExtResource( 1 ), ExtResource( 35 ), ExtResource( 26 ), ExtResource( 37 ), ExtResource( 16 ), ExtResource( 40 ) ], "loop": true, -"name": "fall", -"speed": 5.0 +"name": "run", +"speed": 15.0 }, { "frames": [ ExtResource( 8 ), ExtResource( 19 ), ExtResource( 10 ), ExtResource( 25 ), ExtResource( 24 ), ExtResource( 2 ) ], "loop": true, "name": "double_jump", "speed": 25.0 }, { -"frames": [ ExtResource( 7 ), ExtResource( 31 ), ExtResource( 33 ), ExtResource( 38 ), ExtResource( 36 ), ExtResource( 3 ), ExtResource( 42 ) ], +"frames": [ ExtResource( 6 ) ], "loop": true, -"name": "hit", -"speed": 30.0 +"name": "fall", +"speed": 5.0 }, { "frames": [ ExtResource( 18 ) ], "loop": true, "name": "jump", "speed": 5.0 }, { -"frames": [ ExtResource( 34 ), ExtResource( 39 ), ExtResource( 41 ), ExtResource( 43 ), ExtResource( 32 ), ExtResource( 11 ), ExtResource( 1 ), ExtResource( 35 ), ExtResource( 26 ), ExtResource( 37 ), ExtResource( 16 ), ExtResource( 40 ) ], +"frames": [ ExtResource( 7 ), ExtResource( 31 ), ExtResource( 33 ) ], "loop": true, -"name": "run", +"name": "hit", +"speed": 30.0 +}, { +"frames": [ ExtResource( 17 ), ExtResource( 5 ), ExtResource( 30 ), ExtResource( 15 ), ExtResource( 14 ) ], +"loop": true, +"name": "wall_jump", "speed": 25.0 } ] @@ -113,8 +109,37 @@ tracks/1/keys = { "values": [ 0 ] } +[sub_resource type="Animation" id=12] +resource_name = "fall" +tracks/0/type = "value" +tracks/0/path = NodePath(".:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ "fall" ] +} +tracks/1/type = "value" +tracks/1/path = NodePath(".:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0 ] +} + [sub_resource type="Animation" id=7] resource_name = "hit" +length = 0.1 +loop = true tracks/0/type = "value" tracks/0/path = NodePath(".:animation") tracks/0/interp = 1 @@ -134,10 +159,10 @@ tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 0.1, 0.2, 0.3, 0.4, 0.5 ), -"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ), +"times": PoolRealArray( 0, 0.05 ), +"transitions": PoolRealArray( 1, 1 ), "update": 1, -"values": [ 1, 2, 3, 4, 5, 6 ] +"values": [ 1, 2 ] } [sub_resource type="Animation" id=4] @@ -197,6 +222,8 @@ tracks/1/keys = { [sub_resource type="Animation" id=6] resource_name = "run" +loop = true +step = 0.0666667 tracks/0/type = "value" tracks/0/path = NodePath(".:animation") tracks/0/interp = 1 @@ -222,8 +249,58 @@ tracks/1/keys = { "values": [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] } +[sub_resource type="AnimationNodeAnimation" id=13] +animation = "fall" + +[sub_resource type="AnimationNodeAnimation" id=14] +animation = "hit" + +[sub_resource type="AnimationNodeAnimation" id=15] +animation = "idle" + +[sub_resource type="AnimationNodeAnimation" id=16] +animation = "jump" + +[sub_resource type="AnimationNodeAnimation" id=17] +animation = "run" + +[sub_resource type="AnimationNodeStateMachineTransition" id=36] + +[sub_resource type="AnimationNodeStateMachineTransition" id=37] + +[sub_resource type="AnimationNodeStateMachineTransition" id=38] + +[sub_resource type="AnimationNodeStateMachineTransition" id=39] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id=40] + +[sub_resource type="AnimationNodeStateMachineTransition" id=41] + +[sub_resource type="AnimationNodeStateMachineTransition" id=42] + +[sub_resource type="AnimationNodeStateMachineTransition" id=43] + +[sub_resource type="AnimationNodeStateMachine" id=34] +states/fall/node = SubResource( 13 ) +states/fall/position = Vector2( 439, 336.778 ) +states/hit/node = SubResource( 14 ) +states/hit/position = Vector2( 695.445, 173.667 ) +states/idle/node = SubResource( 15 ) +states/idle/position = Vector2( 447.691, 183 ) +states/jump/node = SubResource( 16 ) +states/jump/position = Vector2( 195, 173.815 ) +states/run/node = SubResource( 17 ) +states/run/position = Vector2( 446.852, 43 ) +transitions = [ "idle", "run", SubResource( 36 ), "run", "idle", SubResource( 37 ), "idle", "hit", SubResource( 38 ), "hit", "idle", SubResource( 39 ), "jump", "idle", SubResource( 40 ), "idle", "jump", SubResource( 41 ), "fall", "idle", SubResource( 42 ), "idle", "fall", SubResource( 43 ) ] +start_node = "idle" +graph_offset = Vector2( -117, -61.1126 ) + +[sub_resource type="AnimationNodeStateMachinePlayback" id=35] + [node name="Player" type="KinematicBody2D" groups=["player"]] z_index = 1 +collision_mask = 2 script = ExtResource( 44 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] @@ -242,7 +319,14 @@ animation = "idle" [node name="AnimationPlayer" type="AnimationPlayer" parent="AnimatedSprite"] anims/RESET = SubResource( 3 ) +anims/fall = SubResource( 12 ) anims/hit = SubResource( 7 ) anims/idle = SubResource( 4 ) anims/jump = SubResource( 5 ) anims/run = SubResource( 6 ) + +[node name="AnimationTree" type="AnimationTree" parent="."] +tree_root = SubResource( 34 ) +anim_player = NodePath("../AnimatedSprite/AnimationPlayer") +active = true +parameters/playback = SubResource( 35 ) diff --git a/export_presets.cfg b/export_presets.cfg index e69de29..c0b003f 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -0,0 +1,34 @@ +[preset.0] + +name="RAW" +platform="HTML5" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../GameExports/RAW/Raw.html" +script_export_mode=1 +script_encryption_key="" + +[preset.0.options] + +custom_template/debug="" +custom_template/release="" +variant/export_type=0 +vram_texture_compression/for_desktop=true +vram_texture_compression/for_mobile=false +html/export_icon=true +html/custom_html_shell="" +html/head_include="" +html/canvas_resize_policy=1 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color( 0, 0, 0, 1 ) diff --git a/project.godot b/project.godot index b5ee023..db50641 100644 --- a/project.godot +++ b/project.godot @@ -41,6 +41,11 @@ jump={ ] } +[layer_names] + +2d_physics/layer_1="base" +2d_physics/layer_3="enemies" + [physics] common/enable_pause_aware_picking=true diff --git a/scenes/level1.gd b/scenes/level1.gd new file mode 100644 index 0000000..cab2699 --- /dev/null +++ b/scenes/level1.gd @@ -0,0 +1,4 @@ +extends Node2D + +func _ready(): + $Player.set("total_apples_need",$Apples.get_child_count()) diff --git a/scenes/level1.tscn b/scenes/level1.tscn index 4f1c43d..92f6351 100644 --- a/scenes/level1.tscn +++ b/scenes/level1.tscn @@ -1,12 +1,17 @@ -[gd_scene load_steps=6 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://entities/player/Player.tscn" type="PackedScene" id=1] [ext_resource path="res://tileset/main_tileset.tres" type="TileSet" id=2] [ext_resource path="res://collectables/Apple.tscn" type="PackedScene" id=3] [ext_resource path="res://backgrounds/Brown.png" type="Texture" id=4] [ext_resource path="res://entities/chicken/chicken.tscn" type="PackedScene" id=5] +[ext_resource path="res://static/left.png" type="Texture" id=6] +[ext_resource path="res://static/x.png" type="Texture" id=7] +[ext_resource path="res://static/door/door.tscn" type="PackedScene" id=8] +[ext_resource path="res://scenes/level1.gd" type="Script" id=9] -[node name="Node2D" type="Node2D"] +[node name="Level1" type="Node2D"] +script = ExtResource( 9 ) [node name="ParallaxBackground" type="ParallaxBackground" parent="."] @@ -18,15 +23,30 @@ margin_bottom = 610.0 texture = ExtResource( 4 ) stretch_mode = 2 +[node name="X" type="Sprite" parent="ParallaxBackground/ParallaxLayer/TextureRect"] +position = Vector2( 282, 90 ) +texture = ExtResource( 7 ) + [node name="Player" parent="." instance=ExtResource( 1 )] -position = Vector2( 77, 31 ) +position = Vector2( 58, 80 ) [node name="TileMap" type="TileMap" parent="."] tile_set = ExtResource( 2 ) cell_size = Vector2( 16, 16 ) cell_custom_transform = Transform2D( 0, 0, 0, 0, 0, 0 ) +collision_layer = 3 +collision_mask = 3 format = 1 -tile_data = PoolIntArray( 0, 12, 0, 1, 13, 0, 2, 13, 0, 3, 13, 0, 4, 13, 0, 5, 13, 0, 6, 13, 0, 7, 13, 0, 8, 13, 0, 9, 13, 0, 10, 13, 0, 11, 13, 0, 12, 13, 0, 13, 13, 0, 14, 13, 0, 15, 13, 0, 16, 13, 0, 17, 13, 0, 18, 13, 0, 19, 13, 0, 20, 13, 0, 21, 13, 0, 22, 13, 0, 23, 13, 0, 24, 13, 0, 25, 13, 0, 26, 13, 0, 27, 13, 0, 28, 13, 0, 29, 13, 0, 30, 13, 0, 31, 13, 0, 32, 13, 0, 33, 13, 0, 34, 13, 0, 35, 13, 0, 36, 13, 0, 37, 13, 0, 38, 13, 0, 39, 13, 0, 40, 13, 0, 41, 13, 0, 42, 13, 0, 43, 13, 0, 44, 13, 0, 45, 13, 0, 46, 13, 0, 47, 13, 0, 48, 13, 0, 49, 14, 0, 65536, 15, 0, 65585, 15, 0, 131072, 37, 0, 131121, 37, 0, 196608, 37, 0, 196657, 37, 0, 262144, 37, 0, 262193, 37, 0, 327680, 37, 0, 327729, 37, 0, 393216, 37, 0, 393218, 6, 0, 393219, 7, 0, 393220, 7, 0, 393221, 7, 0, 393222, 7, 0, 393223, 7, 0, 393224, 7, 0, 393225, 7, 0, 393226, 7, 0, 393227, 7, 0, 393228, 8, 0, 393265, 37, 0, 458752, 37, 0, 458754, 50, 0, 458755, 51, 0, 458756, 51, 0, 458757, 51, 0, 458758, 51, 0, 458759, 51, 0, 458760, 51, 0, 458761, 51, 0, 458762, 51, 0, 458763, 51, 0, 458764, 52, 0, 458801, 37, 0, 524288, 37, 0, 524303, 6, 0, 524304, 7, 0, 524305, 7, 0, 524306, 7, 0, 524307, 7, 0, 524308, 7, 0, 524309, 7, 0, 524310, 7, 0, 524311, 7, 0, 524312, 7, 0, 524313, 7, 0, 524314, 8, 0, 524337, 37, 0, 589824, 37, 0, 589839, 50, 0, 589840, 51, 0, 589841, 51, 0, 589842, 51, 0, 589843, 51, 0, 589844, 51, 0, 589845, 51, 0, 589846, 51, 0, 589847, 51, 0, 589848, 51, 0, 589849, 51, 0, 589850, 52, 0, 589858, 6, 0, 589859, 7, 0, 589860, 7, 0, 589861, 7, 0, 589862, 7, 0, 589863, 7, 0, 589864, 7, 0, 589865, 7, 0, 589866, 7, 0, 589867, 7, 0, 589868, 7, 0, 589869, 8, 0, 589873, 37, 0, 655360, 37, 0, 655394, 50, 0, 655395, 51, 0, 655396, 51, 0, 655397, 51, 0, 655398, 51, 0, 655399, 51, 0, 655400, 51, 0, 655401, 51, 0, 655402, 51, 0, 655403, 51, 0, 655404, 51, 0, 655405, 52, 0, 655409, 37, 0, 720896, 37, 0, 720945, 37, 0, 786432, 37, 0, 786481, 37, 0, 851968, 37, 0, 852017, 37, 0, 917504, 37, 0, 917553, 37, 0, 983040, 37, 0, 983089, 37, 0, 1048576, 37, 0, 1048625, 37, 0, 1114112, 37, 0, 1114134, 6, 0, 1114135, 7, 0, 1114136, 7, 0, 1114137, 7, 0, 1114138, 7, 0, 1114139, 7, 0, 1114140, 7, 0, 1114141, 7, 0, 1114142, 7, 0, 1114143, 7, 0, 1114144, 7, 0, 1114145, 8, 0, 1114161, 37, 0, 1179648, 37, 0, 1179653, 6, 0, 1179654, 7, 0, 1179655, 7, 0, 1179656, 7, 0, 1179657, 7, 0, 1179658, 7, 0, 1179659, 7, 0, 1179660, 7, 0, 1179661, 7, 0, 1179662, 7, 0, 1179663, 7, 0, 1179664, 8, 0, 1179670, 50, 0, 1179671, 51, 0, 1179672, 51, 0, 1179673, 51, 0, 1179674, 51, 0, 1179675, 51, 0, 1179676, 51, 0, 1179677, 51, 0, 1179678, 51, 0, 1179679, 51, 0, 1179680, 51, 0, 1179681, 52, 0, 1179697, 37, 0, 1245184, 37, 0, 1245189, 50, 0, 1245190, 51, 0, 1245191, 51, 0, 1245192, 51, 0, 1245193, 51, 0, 1245194, 51, 0, 1245195, 51, 0, 1245196, 51, 0, 1245197, 51, 0, 1245198, 51, 0, 1245199, 51, 0, 1245200, 52, 0, 1245233, 37, 0, 1310720, 37, 0, 1310758, 6, 0, 1310759, 7, 0, 1310760, 7, 0, 1310761, 7, 0, 1310762, 7, 0, 1310763, 7, 0, 1310764, 7, 0, 1310765, 7, 0, 1310766, 7, 0, 1310767, 7, 0, 1310768, 8, 0, 1310769, 37, 0, 1376256, 37, 0, 1376294, 28, 0, 1376295, 29, 0, 1376296, 29, 0, 1376297, 29, 0, 1376298, 29, 0, 1376299, 29, 0, 1376300, 29, 0, 1376301, 29, 0, 1376302, 29, 0, 1376303, 29, 0, 1376304, 30, 0, 1376305, 37, 0, 1441792, 37, 0, 1441830, 50, 0, 1441831, 51, 0, 1441832, 51, 0, 1441833, 51, 0, 1441834, 51, 0, 1441835, 51, 0, 1441836, 51, 0, 1441837, 51, 0, 1441838, 51, 0, 1441839, 51, 0, 1441840, 52, 0, 1441841, 37, 0, 1507328, 37, 0, 1507377, 37, 0, 1572864, 37, 0, 1572913, 37, 0, 1638400, 37, 0, 1638449, 37, 0, 1703936, 37, 0, 1703985, 37, 0, 1769472, 37, 0, 1769521, 37, 0, 1835008, 37, 0, 1835057, 37, 0, 1900544, 37, 0, 1900593, 37, 0, 1966080, 37, 0, 1966129, 37, 0, 2031616, 37, 0, 2031665, 37, 0, 2097152, 37, 0, 2097201, 37, 0, 2162688, 37, 0, 2162737, 37, 0, 2228224, 37, 0, 2228273, 37, 0, 2293760, 37, 0, 2293809, 37, 0, 2359296, 59, 0, 2359345, 59, 0, 2424832, 12, 0, 2424833, 13, 0, 2424834, 13, 0, 2424835, 13, 0, 2424836, 13, 0, 2424837, 13, 0, 2424838, 13, 0, 2424839, 13, 0, 2424840, 13, 0, 2424841, 13, 0, 2424842, 13, 0, 2424843, 13, 0, 2424844, 13, 0, 2424845, 13, 0, 2424846, 13, 0, 2424847, 13, 0, 2424848, 13, 0, 2424849, 13, 0, 2424850, 13, 0, 2424851, 13, 0, 2424852, 13, 0, 2424853, 13, 0, 2424854, 13, 0, 2424855, 13, 0, 2424856, 13, 0, 2424857, 13, 0, 2424858, 13, 0, 2424859, 13, 0, 2424860, 13, 0, 2424861, 13, 0, 2424862, 13, 0, 2424863, 13, 0, 2424864, 13, 0, 2424865, 13, 0, 2424866, 13, 0, 2424867, 13, 0, 2424868, 13, 0, 2424869, 13, 0, 2424870, 13, 0, 2424871, 13, 0, 2424872, 13, 0, 2424873, 13, 0, 2424874, 13, 0, 2424875, 13, 0, 2424876, 13, 0, 2424877, 13, 0, 2424878, 13, 0, 2424879, 13, 0, 2424880, 13, 0, 2424881, 14, 0 ) +tile_data = PoolIntArray( 0, 12, 0, 1, 13, 0, 2, 13, 0, 3, 13, 0, 4, 13, 0, 5, 13, 0, 6, 13, 0, 7, 13, 0, 8, 13, 0, 9, 13, 0, 10, 13, 0, 11, 13, 0, 12, 13, 0, 13, 13, 0, 14, 13, 0, 15, 13, 0, 16, 13, 0, 17, 13, 0, 18, 13, 0, 19, 13, 0, 20, 13, 0, 21, 13, 0, 22, 13, 0, 23, 13, 0, 24, 13, 0, 25, 13, 0, 26, 13, 0, 27, 13, 0, 28, 13, 0, 29, 13, 0, 30, 13, 0, 31, 13, 0, 32, 13, 0, 33, 13, 0, 34, 13, 0, 35, 13, 0, 36, 13, 0, 37, 13, 0, 38, 13, 0, 39, 13, 0, 40, 13, 0, 41, 13, 0, 42, 13, 0, 43, 13, 0, 44, 13, 0, 45, 13, 0, 46, 13, 0, 47, 13, 0, 48, 13, 0, 49, 14, 0, 65536, 15, 0, 65585, 15, 0, 131072, 37, 0, 131121, 37, 0, 196608, 37, 0, 196643, 6, 0, 196644, 7, 0, 196645, 7, 0, 196646, 7, 0, 196647, 7, 0, 196648, 7, 0, 196649, 7, 0, 196650, 7, 0, 196651, 7, 0, 196652, 7, 0, 196653, 7, 0, 196654, 7, 0, 196655, 7, 0, 196656, 7, 0, 196657, 37, 0, 262144, 37, 0, 262179, 50, 0, 262180, 51, 0, 262181, 51, 0, 262182, 51, 0, 262183, 51, 0, 262184, 51, 0, 262185, 51, 0, 262186, 51, 0, 262187, 51, 0, 262188, 51, 0, 262189, 51, 0, 262190, 51, 0, 262191, 51, 0, 262192, 51, 0, 262193, 37, 0, 327680, 37, 0, 327729, 37, 0, 393216, 37, 0, 393217, 7, 0, 393218, 7, 0, 393219, 7, 0, 393220, 7, 0, 393221, 7, 0, 393222, 7, 0, 393223, 7, 0, 393224, 7, 0, 393225, 7, 0, 393226, 7, 0, 393227, 7, 0, 393228, 8, 0, 393241, 6, 0, 393242, 7, 0, 393243, 7, 0, 393244, 7, 0, 393245, 7, 0, 393246, 7, 0, 393247, 8, 0, 393265, 37, 0, 458752, 37, 0, 458753, 51, 0, 458754, 51, 0, 458755, 51, 0, 458756, 51, 0, 458757, 51, 0, 458758, 51, 0, 458759, 51, 0, 458760, 51, 0, 458761, 51, 0, 458762, 51, 0, 458763, 51, 0, 458764, 52, 0, 458777, 50, 0, 458778, 51, 0, 458779, 51, 0, 458780, 51, 0, 458781, 51, 0, 458782, 51, 0, 458783, 52, 0, 458801, 37, 0, 524288, 37, 0, 524303, 6, 0, 524304, 7, 0, 524305, 7, 0, 524306, 7, 0, 524307, 536870918, 0, 524323, 6, 0, 524324, 7, 0, 524325, 7, 0, 524326, 7, 0, 524327, 7, 0, 524328, 7, 0, 524329, 8, 0, 524337, 37, 0, 589824, 37, 0, 589839, 50, 0, 589840, 51, 0, 589841, 51, 0, 589842, 51, 0, 589843, 52, 0, 589859, 50, 0, 589860, 51, 0, 589861, 51, 0, 589862, 51, 0, 589863, 51, 0, 589864, 51, 0, 589865, 52, 0, 589873, 37, 0, 655360, 37, 0, 655409, 37, 0, 720896, 37, 0, 720922, 6, 0, 720923, 7, 0, 720924, 7, 0, 720925, 7, 0, 720926, 7, 0, 720927, 7, 0, 720928, 8, 0, 720945, 37, 0, 786432, 37, 0, 786458, 50, 0, 786459, 51, 0, 786460, 51, 0, 786461, 51, 0, 786462, 51, 0, 786463, 51, 0, 786464, 52, 0, 786481, 37, 0, 851968, 37, 0, 852017, 37, 0, 917504, 37, 0, 917507, 6, 0, 917508, 7, 0, 917509, 7, 0, 917510, 7, 0, 917511, 7, 0, 917512, 7, 0, 917513, 8, 0, 917515, 18, 0, 917516, 18, 0, 917517, 18, 0, 917518, 18, 0, 917520, 6, 0, 917521, 7, 0, 917522, 7, 0, 917523, 7, 0, 917524, 7, 0, 917525, 7, 0, 917526, 8, 0, 917553, 37, 0, 983040, 37, 0, 983043, 50, 0, 983044, 51, 0, 983045, 51, 0, 983046, 51, 0, 983047, 51, 0, 983048, 51, 0, 983049, 52, 0, 983056, 50, 0, 983057, 51, 0, 983058, 51, 0, 983059, 51, 0, 983060, 51, 0, 983061, 51, 0, 983062, 52, 0, 983072, 6, 0, 983073, 7, 0, 983074, 7, 0, 983075, 7, 0, 983076, 7, 0, 983077, 7, 0, 983078, 8, 0, 983089, 37, 0, 1048576, 37, 0, 1048608, 50, 0, 1048609, 51, 0, 1048610, 51, 0, 1048611, 51, 0, 1048612, 51, 0, 1048613, 51, 0, 1048614, 52, 0, 1048625, 37, 0, 1114112, 37, 0, 1114161, 37, 0, 1179648, 37, 0, 1179697, 37, 0, 1245184, 37, 0, 1245206, 6, 0, 1245207, 7, 0, 1245208, 7, 0, 1245209, 7, 0, 1245210, 7, 0, 1245211, 7, 0, 1245212, 8, 0, 1245233, 37, 0, 1310720, 37, 0, 1310742, 28, 0, 1310743, 29, 0, 1310744, 29, 0, 1310745, 29, 0, 1310746, 29, 0, 1310747, 29, 0, 1310748, 30, 0, 1310757, 6, 0, 1310758, 7, 0, 1310759, 7, 0, 1310760, 7, 0, 1310761, 7, 0, 1310762, 7, 0, 1310763, 7, 0, 1310764, 7, 0, 1310765, 7, 0, 1310766, 7, 0, 1310767, 7, 0, 1310768, 7, 0, 1310769, 37, 0, 1376256, 37, 0, 1376257, 7, 0, 1376258, 7, 0, 1376259, 7, 0, 1376260, 7, 0, 1376261, 7, 0, 1376262, 8, 0, 1376271, 6, 0, 1376272, 7, 0, 1376273, 7, 0, 1376274, 7, 0, 1376275, 7, 0, 1376276, 7, 0, 1376277, 7, 0, 1376278, 29, 0, 1376279, 29, 0, 1376280, 29, 0, 1376281, 29, 0, 1376282, 29, 0, 1376283, 29, 0, 1376284, 30, 0, 1376293, 50, 0, 1376294, 51, 0, 1376295, 51, 0, 1376296, 51, 0, 1376297, 51, 0, 1376298, 51, 0, 1376299, 51, 0, 1376300, 51, 0, 1376301, 51, 0, 1376302, 51, 0, 1376303, 51, 0, 1376304, 51, 0, 1376305, 37, 0, 1441792, 37, 0, 1441793, 51, 0, 1441794, 51, 0, 1441795, 51, 0, 1441796, 51, 0, 1441797, 51, 0, 1441798, 52, 0, 1441807, 50, 0, 1441808, 51, 0, 1441809, 51, 0, 1441810, 51, 0, 1441811, 51, 0, 1441812, 51, 0, 1441813, 51, 0, 1441814, 51, 0, 1441815, 51, 0, 1441816, 51, 0, 1441817, 51, 0, 1441818, 51, 0, 1441819, 51, 0, 1441820, 52, 0, 1441841, 37, 0, 1507328, 37, 0, 1507377, 37, 0, 1572864, 37, 0, 1572913, 37, 0, 1638400, 37, 0, 1638404, 6, 0, 1638405, 7, 0, 1638406, 7, 0, 1638407, 7, 0, 1638408, 7, 0, 1638409, 7, 0, 1638410, 8, 0, 1638449, 37, 0, 1703936, 37, 0, 1703940, 50, 0, 1703941, 51, 0, 1703942, 51, 0, 1703943, 51, 0, 1703944, 51, 0, 1703945, 51, 0, 1703946, 52, 0, 1703985, 37, 0, 1769472, 37, 0, 1769487, 6, 0, 1769488, 7, 0, 1769489, 7, 0, 1769490, 7, 0, 1769491, 7, 0, 1769492, 7, 0, 1769493, 8, 0, 1769521, 37, 0, 1835008, 37, 0, 1835023, 50, 0, 1835024, 51, 0, 1835025, 51, 0, 1835026, 51, 0, 1835027, 51, 0, 1835028, 51, 0, 1835029, 52, 0, 1835033, 6, 0, 1835034, 7, 0, 1835035, 7, 0, 1835036, 7, 0, 1835037, 7, 0, 1835038, 7, 0, 1835039, 8, 0, 1835057, 37, 0, 1900544, 37, 0, 1900569, 50, 0, 1900570, 51, 0, 1900571, 51, 0, 1900572, 51, 0, 1900573, 51, 0, 1900574, 51, 0, 1900575, 52, 0, 1900578, 6, 0, 1900579, 7, 0, 1900580, 7, 0, 1900581, 7, 0, 1900582, 7, 0, 1900583, 7, 0, 1900584, 8, 0, 1900593, 37, 0, 1966080, 37, 0, 1966114, 50, 0, 1966115, 51, 0, 1966116, 51, 0, 1966117, 51, 0, 1966118, 51, 0, 1966119, 51, 0, 1966120, 52, 0, 1966129, 37, 0, 2031616, 37, 0, 2031665, 37, 0, 2097152, 37, 0, 2097201, 37, 0, 2162688, 37, 0, 2162694, 6, 0, 2162695, 7, 0, 2162696, 7, 0, 2162697, 7, 0, 2162698, 7, 0, 2162699, 7, 0, 2162700, 8, 0, 2162711, 6, 0, 2162712, 7, 0, 2162713, 7, 0, 2162714, 7, 0, 2162715, 7, 0, 2162716, 7, 0, 2162717, 8, 0, 2162729, 6, 0, 2162730, 7, 0, 2162731, 7, 0, 2162732, 7, 0, 2162733, 7, 0, 2162734, 7, 0, 2162735, 8, 0, 2162737, 37, 0, 2228224, 37, 0, 2228230, 50, 0, 2228231, 51, 0, 2228232, 51, 0, 2228233, 51, 0, 2228234, 51, 0, 2228235, 51, 0, 2228236, 52, 0, 2228247, 50, 0, 2228248, 51, 0, 2228249, 51, 0, 2228250, 51, 0, 2228251, 51, 0, 2228252, 51, 0, 2228253, 52, 0, 2228265, 50, 0, 2228266, 51, 0, 2228267, 51, 0, 2228268, 51, 0, 2228269, 51, 0, 2228270, 51, 0, 2228271, 52, 0, 2228273, 37, 0, 2293760, 37, 0, 2293809, 37, 0, 2359296, 59, 0, 2359345, 59, 0, 2424832, 12, 0, 2424833, 13, 0, 2424834, 13, 0, 2424835, 13, 0, 2424836, 13, 0, 2424837, 13, 0, 2424838, 13, 0, 2424839, 13, 0, 2424840, 13, 0, 2424841, 13, 0, 2424842, 13, 0, 2424843, 13, 0, 2424844, 13, 0, 2424845, 13, 0, 2424846, 13, 0, 2424847, 13, 0, 2424848, 13, 0, 2424849, 13, 0, 2424850, 13, 0, 2424851, 13, 0, 2424852, 13, 0, 2424853, 13, 0, 2424854, 13, 0, 2424855, 13, 0, 2424856, 13, 0, 2424857, 13, 0, 2424858, 13, 0, 2424859, 13, 0, 2424860, 13, 0, 2424861, 13, 0, 2424862, 13, 0, 2424863, 13, 0, 2424864, 13, 0, 2424865, 13, 0, 2424866, 13, 0, 2424867, 13, 0, 2424868, 13, 0, 2424869, 13, 0, 2424870, 13, 0, 2424871, 13, 0, 2424872, 13, 0, 2424873, 13, 0, 2424874, 13, 0, 2424875, 13, 0, 2424876, 13, 0, 2424877, 13, 0, 2424878, 13, 0, 2424879, 13, 0, 2424880, 13, 0, 2424881, 14, 0 ) + +[node name="Left" type="Sprite" parent="TileMap"] +position = Vector2( 61, 60 ) +texture = ExtResource( 6 ) + +[node name="Right" type="Sprite" parent="TileMap"] +position = Vector2( 109, 60 ) +scale = Vector2( -1, 1 ) +texture = ExtResource( 6 ) [node name="Camera2D" type="Camera2D" parent="."] position = Vector2( 400, 305 ) @@ -37,133 +57,29 @@ zoom = Vector2( 1, 1.01 ) position = Vector2( 400, 300 ) [node name="Apple" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -146, -191 ) +position = Vector2( -328, 189 ) [node name="Apple2" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -126, -191 ) +position = Vector2( 307, 278 ) [node name="Apple3" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -106, -191 ) +position = Vector2( -329, -91 ) [node name="Apple4" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -86, -191 ) +position = Vector2( 281, 0 ) [node name="Apple5" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -66, -191 ) +position = Vector2( 95, -136 ) [node name="Apple6" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -46, -191 ) - -[node name="Apple7" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -26, -191 ) - -[node name="Apple8" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -6, -191 ) - -[node name="Apple9" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 14, -191 ) - -[node name="Apple11" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -287, -32 ) - -[node name="Apple12" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -267, -32 ) - -[node name="Apple13" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -247, -32 ) - -[node name="Apple14" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -227, -32 ) - -[node name="Apple15" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -207, -32 ) - -[node name="Apple16" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -187, -32 ) - -[node name="Apple17" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -167, -32 ) - -[node name="Apple18" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -147, -32 ) - -[node name="Apple19" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -34, -46 ) - -[node name="Apple20" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( -14, -46 ) - -[node name="Apple21" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 6, -46 ) - -[node name="Apple22" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 26, -46 ) - -[node name="Apple23" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 46, -46 ) - -[node name="Apple24" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 66, -46 ) +position = Vector2( -146, -192 ) -[node name="Apple25" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 86, -46 ) - -[node name="Apple26" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 106, -46 ) - -[node name="Apple27" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 126, -46 ) - -[node name="Apple36" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 156, -173 ) - -[node name="Apple37" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 176, -173 ) - -[node name="Apple38" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 196, -173 ) - -[node name="Apple39" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 216, -173 ) - -[node name="Apple40" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 236, -173 ) - -[node name="Apple41" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 256, -173 ) - -[node name="Apple42" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 276, -173 ) - -[node name="Apple43" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 296, -173 ) - -[node name="Apple44" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 316, -173 ) - -[node name="Apple28" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 225, 6 ) - -[node name="Apple29" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 245, 6 ) - -[node name="Apple30" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 265, 6 ) - -[node name="Apple31" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 285, 6 ) - -[node name="Apple32" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 305, 6 ) - -[node name="Apple33" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 325, 6 ) - -[node name="Apple34" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 345, 6 ) +[node name="Chicken" parent="." instance=ExtResource( 5 )] +position = Vector2( 729, 32 ) -[node name="Apple35" parent="Apples" instance=ExtResource( 3 )] -position = Vector2( 365, 6 ) +[node name="Chicken2" parent="." instance=ExtResource( 5 )] +position = Vector2( 394, 284 ) -[node name="Chicken" parent="." instance=ExtResource( 5 )] -position = Vector2( 174, 68 ) +[node name="Door" parent="." instance=ExtResource( 8 )] +position = Vector2( 770, 32 ) +scale = Vector2( 0.6, 0.6 ) diff --git a/sfx/door_open.wav b/sfx/door_open.wav new file mode 100644 index 0000000..eef9fdf Binary files /dev/null and b/sfx/door_open.wav differ diff --git a/sfx/door_open.wav.import b/sfx/door_open.wav.import new file mode 100644 index 0000000..ff9ac4e --- /dev/null +++ b/sfx/door_open.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample" + +[deps] + +source_file="res://sfx/door_open.wav" +dest_files=[ "res://.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/sfx/found_item.wav b/sfx/found_item.wav deleted file mode 100644 index eef9fdf..0000000 Binary files a/sfx/found_item.wav and /dev/null differ diff --git a/sfx/found_item.wav.import b/sfx/found_item.wav.import deleted file mode 100644 index 81fbc3b..0000000 --- a/sfx/found_item.wav.import +++ /dev/null @@ -1,21 +0,0 @@ -[remap] - -importer="wav" -type="AudioStreamSample" -path="res://.import/found_item.wav-018b3bdc3b80db7e8e7981fb2514df67.sample" - -[deps] - -source_file="res://sfx/found_item.wav" -dest_files=[ "res://.import/found_item.wav-018b3bdc3b80db7e8e7981fb2514df67.sample" ] - -[params] - -force/8_bit=false -force/mono=false -force/max_rate=false -force/max_rate_hz=44100 -edit/trim=false -edit/normalize=false -edit/loop=false -compress/mode=0 diff --git a/singletons/SignalBus.gd b/singletons/SignalBus.gd index ba9851d..eae1fb7 100644 --- a/singletons/SignalBus.gd +++ b/singletons/SignalBus.gd @@ -1,3 +1,4 @@ extends Node - signal on_hit +signal on_apples_collected +signal open_level_door diff --git a/static/door/door.gd b/static/door/door.gd new file mode 100644 index 0000000..e4580c7 --- /dev/null +++ b/static/door/door.gd @@ -0,0 +1,10 @@ +extends Node2D +var is_opened = false +func _open_level_door(should_open): + if should_open and !is_opened: + is_opened = true + $door_opened.play() + $AnimationPlayer.play("open") + +func _ready(): + SignalBus.connect("open_level_door",self,"_open_level_door") diff --git a/static/door/door.png b/static/door/door.png new file mode 100644 index 0000000..2292efe Binary files /dev/null and b/static/door/door.png differ diff --git a/static/door/door.png.import b/static/door/door.png.import new file mode 100644 index 0000000..95b3e07 --- /dev/null +++ b/static/door/door.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://static/door/door.png" +dest_files=[ "res://.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/static/door/door.tscn b/static/door/door.tscn new file mode 100644 index 0000000..e504e2d --- /dev/null +++ b/static/door/door.tscn @@ -0,0 +1,65 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://static/door/door.png" type="Texture" id=1] +[ext_resource path="res://static/door/door.gd" type="Script" id=2] +[ext_resource path="res://sfx/door_open.wav" type="AudioStream" id=3] + +[sub_resource type="Animation" id=1] +length = 0.001 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 0 ] +} + +[sub_resource type="Animation" id=2] +resource_name = "closed" +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 1 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0 ] +} + +[sub_resource type="Animation" id=3] +resource_name = "open" +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.1, 0.2, 0.3 ), +"transitions": PoolRealArray( 1, 1, 1, 1 ), +"update": 1, +"values": [ 0, 1, 2, 3 ] +} + +[node name="Door" type="Node2D"] +script = ExtResource( 2 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 1 ) +hframes = 5 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/RESET = SubResource( 1 ) +anims/closed = SubResource( 2 ) +anims/open = SubResource( 3 ) + +[node name="door_opened" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 3 ) diff --git a/static/left.png b/static/left.png new file mode 100644 index 0000000..29bf54a Binary files /dev/null and b/static/left.png differ diff --git a/static/left.png.import b/static/left.png.import new file mode 100644 index 0000000..cd91898 --- /dev/null +++ b/static/left.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/left.png-74bbf33828a4b134e6d58e317f953292.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://static/left.png" +dest_files=[ "res://.import/left.png-74bbf33828a4b134e6d58e317f953292.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/static/x.png b/static/x.png new file mode 100644 index 0000000..a136bd7 Binary files /dev/null and b/static/x.png differ diff --git a/static/x.png.import b/static/x.png.import new file mode 100644 index 0000000..b98a38a --- /dev/null +++ b/static/x.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/x.png-bb4069b3be26433a9f1a700ec612b871.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://static/x.png" +dest_files=[ "res://.import/x.png-bb4069b3be26433a9f1a700ec612b871.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 -- cgit v1.2.3