Player Animation converted to Animation Tree
Level 1 Design Door Mechanism Core Gameplay Mechanism - In-Progress
This commit is contained in:
3
.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.md5
Normal file
3
.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.md5
Normal file
@@ -0,0 +1,3 @@
|
||||
source_md5="ee0e10338434390644b7e0b9c4af51b9"
|
||||
dest_md5="1014a6752acaf8ab660e590f99bbd57b"
|
||||
|
||||
BIN
.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex
Normal file
BIN
.import/door.png-5d517bf8d15491aeda1cf3ab4a2489c5.stex
Normal file
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="156bfc6ce4a9ded88f2c0a5ff9aeae39"
|
||||
dest_md5="225db413ce8d8f60027e5f0d5805089e"
|
||||
|
||||
BIN
.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample
Normal file
BIN
.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample
Normal file
Binary file not shown.
3
.import/left.png-74bbf33828a4b134e6d58e317f953292.md5
Normal file
3
.import/left.png-74bbf33828a4b134e6d58e317f953292.md5
Normal file
@@ -0,0 +1,3 @@
|
||||
source_md5="1d4ff825279e78a9c2d11d734fe19878"
|
||||
dest_md5="6515911556e76936d6f95d2fa937ea06"
|
||||
|
||||
BIN
.import/left.png-74bbf33828a4b134e6d58e317f953292.stex
Normal file
BIN
.import/left.png-74bbf33828a4b134e6d58e317f953292.stex
Normal file
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
source_md5="156bfc6ce4a9ded88f2c0a5ff9aeae39"
|
||||
dest_md5="225db413ce8d8f60027e5f0d5805089e"
|
||||
|
||||
Binary file not shown.
3
.import/x.png-bb4069b3be26433a9f1a700ec612b871.md5
Normal file
3
.import/x.png-bb4069b3be26433a9f1a700ec612b871.md5
Normal file
@@ -0,0 +1,3 @@
|
||||
source_md5="b177c3e5cbb8ae86e1e61ee59966d136"
|
||||
dest_md5="4ab49f55270266f9f70e51d7023a9e03"
|
||||
|
||||
BIN
.import/x.png-bb4069b3be26433a9f1a700ec612b871.stex
Normal file
BIN
.import/x.png-bb4069b3be26433a9f1a700ec612b871.stex
Normal file
Binary file not shown.
@@ -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():
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -41,15 +41,15 @@ animations = [ {
|
||||
"name": "idle",
|
||||
"speed": 25.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 17 ), ExtResource( 1 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 18 ) ],
|
||||
"loop": true,
|
||||
"name": "hit",
|
||||
"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 ) ],
|
||||
"loop": true,
|
||||
"name": "run",
|
||||
"speed": 25.0
|
||||
}, {
|
||||
"frames": [ ExtResource( 17 ), ExtResource( 1 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 18 ) ],
|
||||
"loop": true,
|
||||
"name": "hit",
|
||||
"speed": 25.0
|
||||
} ]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id=3]
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,11 +49,16 @@ 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 ) ],
|
||||
"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": "wall_jump",
|
||||
"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( 6 ) ],
|
||||
@@ -65,24 +66,19 @@ animations = [ {
|
||||
"name": "fall",
|
||||
"speed": 5.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 ) ],
|
||||
"loop": true,
|
||||
"name": "hit",
|
||||
"speed": 30.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 )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -41,6 +41,11 @@ jump={
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_physics/layer_1="base"
|
||||
2d_physics/layer_3="enemies"
|
||||
|
||||
[physics]
|
||||
|
||||
common/enable_pause_aware_picking=true
|
||||
|
||||
4
scenes/level1.gd
Normal file
4
scenes/level1.gd
Normal file
@@ -0,0 +1,4 @@
|
||||
extends Node2D
|
||||
|
||||
func _ready():
|
||||
$Player.set("total_apples_need",$Apples.get_child_count())
|
||||
File diff suppressed because one or more lines are too long
@@ -2,12 +2,12 @@
|
||||
|
||||
importer="wav"
|
||||
type="AudioStreamSample"
|
||||
path="res://.import/found_item.wav-018b3bdc3b80db7e8e7981fb2514df67.sample"
|
||||
path="res://.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://sfx/found_item.wav"
|
||||
dest_files=[ "res://.import/found_item.wav-018b3bdc3b80db7e8e7981fb2514df67.sample" ]
|
||||
source_file="res://sfx/door_open.wav"
|
||||
dest_files=[ "res://.import/door_open.wav-d5d84f2217541d3bf4a8ec0beff4c3d5.sample" ]
|
||||
|
||||
[params]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
extends Node
|
||||
|
||||
signal on_hit
|
||||
signal on_apples_collected
|
||||
signal open_level_door
|
||||
|
||||
10
static/door/door.gd
Normal file
10
static/door/door.gd
Normal file
@@ -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")
|
||||
BIN
static/door/door.png
Normal file
BIN
static/door/door.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
35
static/door/door.png.import
Normal file
35
static/door/door.png.import
Normal file
@@ -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
|
||||
65
static/door/door.tscn
Normal file
65
static/door/door.tscn
Normal file
@@ -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 )
|
||||
BIN
static/left.png
Normal file
BIN
static/left.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 235 B |
35
static/left.png.import
Normal file
35
static/left.png.import
Normal file
@@ -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
|
||||
BIN
static/x.png
Normal file
BIN
static/x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 234 B |
35
static/x.png.import
Normal file
35
static/x.png.import
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user