[WIP] - new scene system + intro scene + tweaks and cleanup

This commit is contained in:
Sagi Dayan 2020-10-20 09:51:17 -04:00
parent 3997d6e378
commit ab334f7236
32 changed files with 1078 additions and 591 deletions

BIN
assets/Audio/SFX/wind01.ogg Normal file

Binary file not shown.

View file

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/wind01.ogg-026f1cb389bf20630dec6d09db72d7c0.oggstr"
[deps]
source_file="res://assets/Audio/SFX/wind01.ogg"
dest_files=[ "res://.import/wind01.ogg-026f1cb389bf20630dec6d09db72d7c0.oggstr" ]
[params]
loop=true
loop_offset=0

Binary file not shown.

View file

@ -0,0 +1,15 @@
[remap]
importer="ogg_vorbis"
type="AudioStreamOGGVorbis"
path="res://.import/Scene - Lucid Night.ogg-125beaea2f81884b06fa61796e9d61b8.oggstr"
[deps]
source_file="res://assets/Audio/Scene - Lucid Night.ogg"
dest_files=[ "res://.import/Scene - Lucid Night.ogg-125beaea2f81884b06fa61796e9d61b8.oggstr" ]
[params]
loop=true
loop_offset=0

View file

@ -2,107 +2,107 @@
[ext_resource path="res://assets/Tiles/tileset.png" type="Texture" id=1]
[sub_resource type="OccluderPolygon2D" id=1]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=53]
polygon = PoolVector2Array( 16, 16, 4.51224, 16, 4.51224, 5.0704, 16, 5.0704 )
[sub_resource type="OccluderPolygon2D" id=2]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=54]
polygon = PoolVector2Array( 16, 16, 4.4869, 16, 4.4869, 0, 16, 0 )
[sub_resource type="OccluderPolygon2D" id=3]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=57]
polygon = PoolVector2Array( 16, 0, 4.4869, 0, 4.4869, 10.994, 16, 10.994 )
[sub_resource type="OccluderPolygon2D" id=4]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=55]
polygon = PoolVector2Array( 16, 16, 0, 16, 0, 5.14114, 16, 5.2346 )
[sub_resource type="OccluderPolygon2D" id=5]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=58]
polygon = PoolVector2Array( 0, 16, 16, 16, 16, 0, 0, 0 )
[sub_resource type="OccluderPolygon2D" id=6]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=59]
polygon = PoolVector2Array( 16, 0, 0, 0, 0, 11.0875, 16, 11.0875 )
[sub_resource type="OccluderPolygon2D" id=7]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=56]
polygon = PoolVector2Array( 11.9286, 15.9829, 0, 16, 0, 5.32807, 11.8352, 5.32807 )
[sub_resource type="OccluderPolygon2D" id=8]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=60]
polygon = PoolVector2Array( 0, 0, 11.8352, 0, 11.7417, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=9]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=61]
polygon = PoolVector2Array( 11.5548, 0, 0, 0, 0, 11.0875, 11.5548, 11.0875 )
[sub_resource type="OccluderPolygon2D" id=10]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=62]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 11.4032, 12.8456, 11.4032, 11.6306, 11.4032, 11.724, 16, 0, 16, 0, 0 )
[sub_resource type="OccluderPolygon2D" id=11]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=63]
polygon = PoolVector2Array( 11.6306, 16, 0, 16, 0, 0, 11.6306, 0 )
[sub_resource type="OccluderPolygon2D" id=12]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=64]
polygon = PoolVector2Array( 11.4436, 0, 11.5371, 4.45152, 16, 4.54499, 16, 16, 0, 16, 0, 0 )
[sub_resource type="OccluderPolygon2D" id=13]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=65]
polygon = PoolVector2Array( 16, 0, 0, 0, 0, 11.2163, 16, 11.2163 )
[sub_resource type="OccluderPolygon2D" id=14]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=66]
polygon = PoolVector2Array( 16, 16, 0, 16, 0, 4.63845, 16, 4.63845 )
[sub_resource type="OccluderPolygon2D" id=15]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=67]
polygon = PoolVector2Array( 0, 11.4032, 0, 0, 16, 0, 16, 16, 3.18344, 16, 3.08997, 11.3097 )
[sub_resource type="OccluderPolygon2D" id=16]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=68]
polygon = PoolVector2Array( 16, 16, 3.08997, 16, 3.08997, 0, 16, 0 )
[sub_resource type="OccluderPolygon2D" id=17]
polygon = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="OccluderPolygon2D" id=69]
polygon = PoolVector2Array( 0, 4.73192, 0, 4.73192, 3.18344, 4.73192, 3.18344, 0, 16, 0, 15.8945, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=18]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=36]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=19]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=37]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=20]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=38]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=21]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=39]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=22]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=40]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=23]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=41]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=24]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=42]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=25]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=43]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=26]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=44]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=27]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=45]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=28]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=46]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=29]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=47]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=30]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=48]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=31]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=49]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=32]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=50]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=33]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=51]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="ConvexPolygonShape2D" id=34]
points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
[sub_resource type="ConvexPolygonShape2D" id=52]
points = PoolVector2Array( 0, 0, 16, 0, 16, 16, 0, 16 )
[sub_resource type="TileSet" id=35]
0/name = "tileset.png 0"
@ -116,7 +116,7 @@ points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
0/autotile/icon_coordinate = Vector2( 1, 0 )
0/autotile/tile_size = Vector2( 16, 16 )
0/autotile/spacing = 0
0/autotile/occluder_map = [ Vector2( 0, 0 ), SubResource( 1 ), Vector2( 0, 1 ), SubResource( 2 ), Vector2( 0, 2 ), SubResource( 3 ), Vector2( 1, 0 ), SubResource( 4 ), Vector2( 1, 1 ), SubResource( 5 ), Vector2( 1, 2 ), SubResource( 6 ), Vector2( 2, 0 ), SubResource( 7 ), Vector2( 2, 1 ), SubResource( 8 ), Vector2( 2, 2 ), SubResource( 9 ), Vector2( 3, 0 ), SubResource( 10 ), Vector2( 3, 1 ), SubResource( 11 ), Vector2( 3, 2 ), SubResource( 12 ), Vector2( 4, 0 ), SubResource( 13 ), Vector2( 4, 2 ), SubResource( 14 ), Vector2( 5, 0 ), SubResource( 15 ), Vector2( 5, 1 ), SubResource( 16 ), Vector2( 5, 2 ), SubResource( 17 ) ]
0/autotile/occluder_map = [ Vector2( 0, 0 ), SubResource( 53 ), Vector2( 0, 1 ), SubResource( 54 ), Vector2( 0, 2 ), SubResource( 57 ), Vector2( 1, 0 ), SubResource( 55 ), Vector2( 1, 1 ), SubResource( 58 ), Vector2( 1, 2 ), SubResource( 59 ), Vector2( 2, 0 ), SubResource( 56 ), Vector2( 2, 1 ), SubResource( 60 ), Vector2( 2, 2 ), SubResource( 61 ), Vector2( 3, 0 ), SubResource( 62 ), Vector2( 3, 1 ), SubResource( 63 ), Vector2( 3, 2 ), SubResource( 64 ), Vector2( 4, 0 ), SubResource( 65 ), Vector2( 4, 2 ), SubResource( 66 ), Vector2( 5, 0 ), SubResource( 67 ), Vector2( 5, 1 ), SubResource( 68 ), Vector2( 5, 2 ), SubResource( 69 ) ]
0/autotile/navpoly_map = [ ]
0/autotile/priority_map = [ ]
0/autotile/z_index_map = [ ]
@ -124,110 +124,110 @@ points = PoolVector2Array( 16, 16, 0, 16, 0, 0, 16, 0 )
0/navigation_offset = Vector2( 0, 0 )
0/shape_offset = Vector2( 0, 0 )
0/shape_transform = Transform2D( 1, 0, 0, 1, 0, 0 )
0/shape = SubResource( 18 )
0/shape = SubResource( 36 )
0/shape_one_way = false
0/shape_one_way_margin = 1.0
0/shapes = [ {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 36 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 18 ),
"shape": SubResource( 37 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 19 ),
"shape": SubResource( 38 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 20 ),
"shape": SubResource( 39 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 21 ),
"shape": SubResource( 40 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 22 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 23 ),
"shape": SubResource( 41 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 0, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 24 ),
"shape": SubResource( 42 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 1, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 25 ),
"shape": SubResource( 43 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 2, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 26 ),
"shape": SubResource( 44 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 27 ),
"shape": SubResource( 45 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 28 ),
"shape": SubResource( 46 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 3, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 29 ),
"shape": SubResource( 47 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 30 ),
"shape": SubResource( 48 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 4, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 31 ),
"shape": SubResource( 49 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 0 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 32 ),
"shape": SubResource( 50 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 1 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 33 ),
"shape": SubResource( 51 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
}, {
"autotile_coord": Vector2( 5, 2 ),
"one_way": false,
"one_way_margin": 1.0,
"shape": SubResource( 34 ),
"shape": SubResource( 52 ),
"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 )
} ]
0/z_index = 0

View file

@ -74,6 +74,7 @@ config/icon="res://icon.png"
AudioManager="*res://src/Singletons/AudioManager.tscn"
GameState="*res://src/Singletons/GameState.gd"
Utils="*res://src/Singletons/Utils.gd"
Stage="*res://src/Singletons/Stage.tscn"
[display]
@ -177,4 +178,5 @@ attack={
[rendering]
quality/2d/use_pixel_snap=true
environment/default_clear_color=Color( 0, 0, 0, 1 )
environment/default_environment="res://default_env.tres"

View file

@ -11,7 +11,7 @@ func _on_Area2D_body_entered(body: Node) -> void:
func _physics_process(delta: float) -> void:
if not _is_alive: return
if _triggerd and _damage_enabled:
var player_direction = (_player_ref.position - position).normalized()
var player_direction = (_player_ref.position - global_position).normalized()
$Sprite.scale = Vector2(-1 if player_direction.x < 0 else 1, 1)
if _get_pit_direction() == 0 and dont_fall_patrol:
_velocity.x = $Sprite.scale.x * walking_speed * 2

View file

@ -6,13 +6,13 @@
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 6, 8 )
[sub_resource type="RectangleShape2D" id=5]
[sub_resource type="RectangleShape2D" id=2]
extents = Vector2( 7, 9 )
[sub_resource type="RectangleShape2D" id=6]
[sub_resource type="RectangleShape2D" id=3]
extents = Vector2( 35, 10 )
[sub_resource type="Animation" id=8]
[sub_resource type="Animation" id=4]
resource_name = "attack"
length = 0.3
loop = true
@ -101,8 +101,7 @@ tracks/6/keys = {
"values": [ false ]
}
[sub_resource type="Animation" id=2]
resource_name = "die"
[sub_resource type="Animation" id=5]
length = 0.5
loop = true
tracks/0/type = "value"
@ -204,7 +203,7 @@ tracks/7/keys = {
} ]
}
[sub_resource type="Animation" id=7]
[sub_resource type="Animation" id=6]
resource_name = "hit"
length = 0.2
tracks/0/type = "value"
@ -318,8 +317,7 @@ tracks/8/keys = {
} ]
}
[sub_resource type="Animation" id=3]
resource_name = "idle"
[sub_resource type="Animation" id=7]
length = 0.3
loop = true
tracks/0/type = "value"
@ -419,8 +417,7 @@ tracks/7/keys = {
"values": [ false ]
}
[sub_resource type="Animation" id=4]
resource_name = "walk"
[sub_resource type="Animation" id=8]
length = 0.5
loop = true
tracks/0/type = "value"
@ -514,21 +511,24 @@ collision_mask = 15
script = ExtResource( 2 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 0, -8 )
shape = SubResource( 1 )
[node name="Area2D" type="Area2D" parent="."]
visible = false
collision_layer = 2
[node name="DamageArea" type="CollisionShape2D" parent="Area2D"]
position = Vector2( 0, -8 )
shape = SubResource( 5 )
shape = SubResource( 2 )
[node name="TriggerZone" type="Area2D" parent="."]
visible = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="TriggerZone"]
position = Vector2( 0, -6 )
shape = SubResource( 6 )
shape = SubResource( 3 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -8 )
@ -539,19 +539,21 @@ frame = 8
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "idle"
anims/attack = SubResource( 8 )
anims/die = SubResource( 2 )
anims/hit = SubResource( 7 )
anims/idle = SubResource( 3 )
anims/walk = SubResource( 4 )
anims/attack = SubResource( 4 )
anims/die = SubResource( 5 )
anims/hit = SubResource( 6 )
anims/idle = SubResource( 7 )
anims/walk = SubResource( 8 )
[node name="RayCastLeft" type="RayCast2D" parent="."]
visible = false
position = Vector2( -6, 0 )
enabled = true
cast_to = Vector2( 0, 1 )
collision_mask = 8
[node name="RayCastRight" type="RayCast2D" parent="."]
visible = false
position = Vector2( 6, 0 )
enabled = true
cast_to = Vector2( 0, 1 )

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=11 format=2]
[gd_scene load_steps=12 format=2]
[ext_resource path="res://src/Actors/ligt_beam.png" type="Texture" id=1]
[ext_resource path="res://src/Actors/LightBeam.gd" type="Script" id=2]
[ext_resource path="res://assets/Items/torch_ligt_texture.png" type="Texture" id=3]
[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0, 0.189655, 0.366379, 0.616379, 1 )
@ -36,7 +37,7 @@ color_ramp = SubResource( 2 )
[sub_resource type="CircleShape2D" id=6]
radius = 3.0
[sub_resource type="Animation" id=8]
[sub_resource type="Animation" id=7]
resource_name = "lights_on"
length = 0.5
loop = true
@ -50,7 +51,7 @@ tracks/0/keys = {
"times": PoolRealArray( 0, 0.25, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ 1.0, 1.5, 1.0 ]
"values": [ 3.0, 4.0, 3.0 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Light2D:rotation_degrees")
@ -65,8 +66,7 @@ tracks/1/keys = {
"values": [ 0.0, -86.4, 33.4 ]
}
[sub_resource type="Animation" id=7]
resource_name = "lights_out"
[sub_resource type="Animation" id=8]
length = 0.5
step = 0.25
tracks/0/type = "value"
@ -116,13 +116,13 @@ texture = ExtResource( 1 )
script = ExtResource( 2 )
[node name="Light2D" type="Light2D" parent="."]
rotation = -0.253422
texture = ExtResource( 1 )
texture_scale = 0.8
energy = 2.0
rotation = -1.20637
texture = ExtResource( 3 )
texture_scale = 3.8
color = Color( 0.87451, 0.976471, 0.984314, 0.866667 )
range_item_cull_mask = 15375
shadow_enabled = true
shadow_item_cull_mask = 28
shadow_item_cull_mask = 30
[node name="Area2D" type="Area2D" parent="."]
collision_layer = 0
@ -133,6 +133,6 @@ shape = SubResource( 6 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "lights_on"
anims/lights_on = SubResource( 8 )
anims/lights_out = SubResource( 7 )
anims/lights_on = SubResource( 7 )
anims/lights_out = SubResource( 8 )
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]

View file

@ -25,7 +25,7 @@ signal died
var _velocity: Vector2 = Vector2.ZERO
var _landing_position:Vector2 = Vector2.ZERO
var _is_wall_jumping := false
var _alive := false
var _alive := true
var _can_dash := true
var _is_jump_canceled := false
var _direction := Vector2.ZERO
@ -52,8 +52,8 @@ export var abilities:= {
"light_beam": false
}
func _ready() -> void:
$AnimationPlayer.play("fade_in")
respawn_position = position
$AnimationPlayer.play("idle")
func _physics_process(delta: float) -> void:
if _alive:
@ -65,7 +65,7 @@ func _physics_process(delta: float) -> void:
func _input_check() -> void:
if GameState.get_state() == GameState.States.GAME:
if GameState.get_state() == GameState.States.GAME or GameState.get_state() == GameState.States.NEW_GAME:
_is_jump_canceled = Input.is_action_just_released("jump") and !_is_wall_jumping and _velocity.y < 0.0;
_get_direction()
_check_dash()
@ -199,7 +199,6 @@ func calculate_move_velocity(direction:Vector2, is_jump_canceled:bool, delta:fl
func _respawn():
position = respawn_position
_velocity = Vector2.ZERO
$AnimationPlayer.play("fade_in")
func _revive():
_alive = true
@ -250,11 +249,12 @@ func _attack():
func _on_die_animation_done():
emit_signal("died")
_respawn()
_revive()
func die():
_alive = false
GameState.player_died()
$AnimationPlayer.play("die")
GameState.player_died(self)
func setAbility(ability:String, enabled:bool=false):
if ability == 'dash':

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=18 format=2]
[gd_scene load_steps=17 format=2]
[ext_resource path="res://src/Actors/DashParticles_right.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/Actors/Player.gd" type="Script" id=2]
@ -28,7 +28,7 @@ tracks/0/keys = {
"values": [ 12, 13, 14, 15 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -36,11 +36,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -49,10 +49,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 4 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -60,11 +60,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 4 ]
"update": 0,
"values": [ Vector2( -8, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -72,18 +72,6 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( -8, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
@ -104,7 +92,7 @@ tracks/0/keys = {
"values": [ 12, 13, 14, 15 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -112,11 +100,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -125,10 +113,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 4 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -136,11 +124,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 4 ]
"update": 0,
"values": [ Vector2( 8, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -148,18 +136,6 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 8, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
@ -178,25 +154,13 @@ tracks/0/keys = {
"update": 1,
"values": [ 0, 1, 2, 3, 4, 5, 6, 7 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/type = "method"
tracks/1/path = NodePath(".")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.7, 0.9 ),
"transitions": PoolRealArray( 1, 1, 2.54912 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ), Color( 0, 0, 0, 0 ), Color( 0, 0, 0, 1 ) ]
}
tracks/2/type = "method"
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0.9 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
@ -204,8 +168,20 @@ tracks/2/keys = {
"method": "_on_die_animation_done"
} ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:vframes")
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -214,10 +190,10 @@ tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 8 ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:hframes")
tracks/4/path = NodePath("Sprite:position")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -225,11 +201,11 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite:position")
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
@ -237,113 +213,12 @@ tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/6/type = "value"
tracks/6/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=6]
length = 0.2
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": 1,
"values": [ 32 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.2 ),
"transitions": PoolRealArray( 1, 0.378929 ),
"update": 0,
"values": [ Color( 0, 0, 0, 1 ), Color( 0, 0, 0, 0 ) ]
}
tracks/2/type = "method"
tracks/2/path = NodePath(".")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0.2 ),
"transitions": PoolRealArray( 1 ),
"values": [ {
"args": [ ],
"method": "_revive"
} ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:vframes")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:hframes")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite:position")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/6/type = "value"
tracks/6/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=7]
length = 0.2
loop = true
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
@ -358,7 +233,7 @@ tracks/0/keys = {
"values": [ 40, 41, 42 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -366,11 +241,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -379,10 +254,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 8 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -390,11 +265,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -402,23 +277,11 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=8]
[sub_resource type="Animation" id=7]
length = 0.3
loop = true
tracks/0/type = "value"
@ -434,7 +297,7 @@ tracks/0/keys = {
"values": [ 32, 33, 34, 35 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -442,11 +305,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -455,10 +318,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 8 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -466,11 +329,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -478,23 +341,11 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=9]
[sub_resource type="Animation" id=8]
length = 0.2
loop = true
tracks/0/type = "value"
@ -510,7 +361,7 @@ tracks/0/keys = {
"values": [ 48, 49, 50 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -518,11 +369,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -531,10 +382,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 8 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -542,11 +393,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -554,23 +405,11 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=10]
[sub_resource type="Animation" id=9]
length = 0.1
tracks/0/type = "value"
tracks/0/path = NodePath("Sprite:frame")
@ -585,7 +424,7 @@ tracks/0/keys = {
"values": [ 72, 73 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -593,11 +432,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -606,10 +445,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 8 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -617,11 +456,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -629,23 +468,11 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=11]
[sub_resource type="Animation" id=10]
length = 0.5
loop = true
tracks/0/type = "value"
@ -661,7 +488,7 @@ tracks/0/keys = {
"values": [ 8, 9, 10, 11, 12, 13 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -669,11 +496,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -682,10 +509,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 8 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -693,11 +520,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -705,23 +532,11 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
[sub_resource type="Animation" id=12]
[sub_resource type="Animation" id=11]
length = 0.3
loop = true
tracks/0/type = "value"
@ -737,7 +552,7 @@ tracks/0/keys = {
"values": [ 45, 46, 47 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("ScreenOverlay/CanvasModulate:color")
tracks/1/path = NodePath("Sprite:vframes")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
@ -745,11 +560,11 @@ tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 0 ) ]
"update": 1,
"values": [ 13 ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Sprite:vframes")
tracks/2/path = NodePath("Sprite:hframes")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
@ -758,10 +573,10 @@ tracks/2/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 13 ]
"values": [ 8 ]
}
tracks/3/type = "value"
tracks/3/path = NodePath("Sprite:hframes")
tracks/3/path = NodePath("Sprite:position")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/imported = false
@ -769,11 +584,11 @@ tracks/3/enabled = true
tracks/3/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ 8 ]
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/4/type = "value"
tracks/4/path = NodePath("Sprite:position")
tracks/4/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/imported = false
@ -781,18 +596,6 @@ tracks/4/enabled = true
tracks/4/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Vector2( 0, -8 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/SordRange/CollisionShape2D:disabled")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ true ]
}
@ -813,8 +616,7 @@ position = Vector2( 1.90735e-06, -7 )
scale = Vector2( 3.83333, 3.83333 )
texture = ExtResource( 7 )
texture_scale = 3.07
color = Color( 0.262745, 0.890196, 0.937255, 1 )
energy = 0.61
color = Color( 0.87451, 0.976471, 0.984314, 1 )
range_height = -2048.0
range_item_cull_mask = 15
shadow_enabled = true
@ -822,11 +624,11 @@ shadow_item_cull_mask = 15
[node name="Sprite" type="Sprite" parent="."]
self_modulate = Color( 0.482353, 0.694118, 0.819608, 1 )
position = Vector2( 8, -8 )
position = Vector2( 0, -8 )
texture = ExtResource( 8 )
vframes = 13
hframes = 4
frame = 12
hframes = 8
frame = 33
[node name="SordRange" type="Area2D" parent="Sprite"]
position = Vector2( -8, 8 )
@ -835,6 +637,7 @@ collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/SordRange"]
position = Vector2( 14, -6 )
shape = SubResource( 2 )
disabled = true
[node name="LightBeamInitPoint" type="Position2D" parent="Sprite"]
position = Vector2( 14, 2 )
@ -844,24 +647,12 @@ autoplay = "idle"
anims/attack_left = SubResource( 3 )
anims/attack_right = SubResource( 4 )
anims/die = SubResource( 5 )
anims/fade_in = SubResource( 6 )
anims/fall = SubResource( 7 )
anims/idle = SubResource( 8 )
anims/jump = SubResource( 9 )
anims/pre_jump = SubResource( 10 )
anims/run = SubResource( 11 )
anims/wall_slide = SubResource( 12 )
[node name="ScreenOverlay" type="CanvasLayer" parent="."]
layer = 128
[node name="CanvasModulate" type="ColorRect" parent="ScreenOverlay"]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0, 0, 0, 0 )
__meta__ = {
"_edit_use_anchors_": false
}
anims/fall = SubResource( 6 )
anims/idle = SubResource( 7 )
anims/jump = SubResource( 8 )
anims/pre_jump = SubResource( 9 )
anims/run = SubResource( 10 )
anims/wall_slide = SubResource( 11 )
[node name="DashTimeout" type="Timer" parent="."]
wait_time = 0.1

View file

@ -1,7 +1,35 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=4 format=2]
[ext_resource path="res://src/Actors/WiseOldDude/wize_old_dude.png" type="Texture" id=1]
[sub_resource type="Animation" id=2]
resource_name = "fade"
length = 0.5
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": 1,
"values": [ 17 ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("Sprite:self_modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
[sub_resource type="Animation" id=1]
resource_name = "idle"
length = 0.8
@ -22,12 +50,14 @@ tracks/0/keys = {
[node name="WiseOldDude" type="Node2D"]
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -16 )
self_modulate = Color( 1, 1, 1, 0 )
position = Vector2( 9.53674e-07, -11 )
scale = Vector2( 0.6875, 0.6875 )
texture = ExtResource( 1 )
vframes = 6
hframes = 9
frame = 18
frame = 17
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "idle"
anims/fade = SubResource( 2 )
anims/idle = SubResource( 1 )

View file

@ -84,7 +84,7 @@ layer = 2
scale = Vector2( 0.533333, 0.533333 )
texture = ExtResource( 2 )
centered = false
offset = Vector2( 600, 50 )
offset = Vector2( 900, 50 )
flip_h = true
[node name="ColorRect" type="ColorRect" parent="Overlay"]

View file

@ -0,0 +1,56 @@
extends CutScene
func _ready() -> void:
start_scene()
func start_scene(camera:Camera2D = null):
var text_show_delay = 2
var no_text_delay = 1
$Wind.play()
$Wind/Tween.interpolate_property($Wind, "volume_db", $Wind.volume_db, -15, 0.5)
$Wind/Tween.start()
$MarginContainer/Text.text = '';
$AnimationPlayer.play("start")
yield($AnimationPlayer, "animation_finished")
$MarginContainer/Text.text = 'breathe...';
$AnimationPlayer.play("fade-text")
yield($AnimationPlayer, "animation_finished")
yield(get_tree().create_timer(text_show_delay), "timeout")
$AnimationPlayer.play_backwards("fade-text")
yield($AnimationPlayer, "animation_finished")
yield(get_tree().create_timer(no_text_delay), "timeout")
$MarginContainer/Text.text = 'you know you can do this';
$AnimationPlayer.play("fade-text")
yield($AnimationPlayer, "animation_finished")
yield(get_tree().create_timer(text_show_delay), "timeout")
$AnimationPlayer.play_backwards("fade-text")
yield($AnimationPlayer, "animation_finished")
yield(get_tree().create_timer(no_text_delay), "timeout")
$MarginContainer/Text.text = 'once again...';
$AnimationPlayer.play("fade-text")
yield($AnimationPlayer, "animation_finished")
yield(get_tree().create_timer(text_show_delay), "timeout")
$AnimationPlayer.play_backwards("fade-text")
yield($AnimationPlayer, "animation_finished")
yield(get_tree().create_timer(no_text_delay), "timeout")
$Wind.play()
$Wind/Tween.interpolate_property($Wind, "volume_db", $Wind.volume_db, -30, 0.5)
$Wind/Tween.start()
$AnimationPlayer.play_backwards("start")
yield($AnimationPlayer, "animation_finished")
_on_scene_exited()
func _on_scene_exited():
end_scene()
GameState.start_new_game(false, false)

View file

@ -0,0 +1,169 @@
[gd_scene load_steps=18 format=2]
[ext_resource path="res://src/CutScenes/IntroCutscene.gd" type="Script" id=1]
[ext_resource path="res://assets/Theme/menu_font.tres" type="DynamicFont" id=2]
[ext_resource path="res://assets/Audio/SFX/wind01.ogg" type="AudioStream" id=3]
[sub_resource type="Gradient" id=1]
colors = PoolColorArray( 0.180392, 0.352941, 0.537255, 1, 0.121569, 0.262745, 0.415686, 1 )
[sub_resource type="GradientTexture" id=2]
gradient = SubResource( 1 )
[sub_resource type="Gradient" id=3]
offsets = PoolRealArray( 0.00431034, 1 )
colors = PoolColorArray( 1, 1, 1, 0.815686, 1, 1, 1, 0.294118 )
[sub_resource type="GradientTexture" id=4]
gradient = SubResource( 3 )
[sub_resource type="Curve" id=5]
_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 1, 0.553738 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=6]
curve = SubResource( 5 )
[sub_resource type="ParticlesMaterial" id=7]
emission_shape = 2
emission_box_extents = Vector3( 250, 1, 1 )
flag_disable_z = true
direction = Vector3( 0, 1, 0 )
gravity = Vector3( 0, 0, 0 )
initial_velocity = 15.0
initial_velocity_random = 0.25
orbit_velocity = 0.0
orbit_velocity_random = 0.0
linear_accel = 1.0
linear_accel_random = 0.25
scale = 3.09
scale_random = 0.25
scale_curve = SubResource( 6 )
color_ramp = SubResource( 4 )
[sub_resource type="Animation" id=8]
resource_name = "fade-text"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("MarginContainer/Text:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
[sub_resource type="Animation" id=9]
length = 2.0
tracks/0/type = "value"
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 0, 0, 0, 1 ), Color( 1, 1, 1, 1 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath("MarginContainer/Text:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 0 ) ]
}
[sub_resource type="Gradient" id=10]
colors = PoolColorArray( 1, 1, 1, 0.243137, 1, 1, 1, 0.0392157 )
[sub_resource type="GradientTexture" id=11]
gradient = SubResource( 10 )
[sub_resource type="Curve" id=12]
_data = [ Vector2( 0, 1 ), 0.0, 0.0, 0, 0, Vector2( 0.988235, 0.906818 ), 0.0, 0.0, 0, 0 ]
[sub_resource type="CurveTexture" id=13]
curve = SubResource( 12 )
[sub_resource type="ParticlesMaterial" id=14]
emission_shape = 2
emission_box_extents = Vector3( 250, 1, 1 )
flag_disable_z = true
direction = Vector3( 0, 1, 0 )
gravity = Vector3( 0, 0, 0 )
initial_velocity = 50.0
orbit_velocity = 0.0
orbit_velocity_random = 0.0
scale = 15.0
scale_random = 0.8
scale_curve = SubResource( 13 )
color_ramp = SubResource( 11 )
[node name="IntroCutscene" type="Node2D"]
modulate = Color( 0.6, 0.6, 0.6, 1 )
script = ExtResource( 1 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( -86, 318 )
rotation = 4.70806
scale = Vector2( 0.163033, 650.745 )
texture = SubResource( 2 )
centered = false
[node name="BG" type="Particles2D" parent="."]
position = Vector2( 251, -15 )
amount = 200
lifetime = 15.0
preprocess = 15.0
explosiveness = 0.1
process_material = SubResource( 7 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/fade-text = SubResource( 8 )
anims/start = SubResource( 9 )
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = 481.0
margin_bottom = 271.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Text" type="Label" parent="MarginContainer"]
modulate = Color( 1, 1, 1, 0 )
margin_top = 125.0
margin_right = 481.0
margin_bottom = 146.0
custom_fonts/font = ExtResource( 2 )
text = "Every thing looks familiar..."
align = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="FG" type="Particles2D" parent="."]
position = Vector2( 248, -13 )
amount = 20
lifetime = 10.0
preprocess = 5.0
explosiveness = 0.2
process_material = SubResource( 14 )
[node name="Wind" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
volume_db = -30.0
autoplay = true
[node name="Tween" type="Tween" parent="Wind"]

View file

@ -0,0 +1,16 @@
extends Node2D
var LIGHTS = {
"DAY": Color(1, 1, 1, 1),
"NIGHT": Color("#848282")
}
var _current_light = 'DAY'
func change_light(light: String) -> void:
if _current_light != light:
$Tween.stop_all()
_current_light = light
$Tween.interpolate_property($CanvasModulate, "color" ,$CanvasModulate.color, LIGHTS[light],0.5 )
$Tween.start()

View file

@ -0,0 +1,48 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://src/GameWorld/AmbiantLighting.gd" type="Script" id=1]
[sub_resource type="Animation" id=1]
resource_name = "DAY"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("CanvasModulate:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0.5 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ) ]
}
[sub_resource type="Animation" id=2]
resource_name = "NIGHT"
length = 0.5
tracks/0/type = "value"
tracks/0/path = NodePath("CanvasModulate:color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0.5 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ Color( 0.615686, 0.223529, 0.223529, 1 ) ]
}
[node name="AmbiantLighting" type="Node2D"]
script = ExtResource( 1 )
[node name="CanvasModulate" type="CanvasModulate" parent="."]
color = Color( 0.517647, 0.509804, 0.509804, 1 )
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "DAY"
anims/DAY = SubResource( 1 )
anims/NIGHT = SubResource( 2 )
[node name="Tween" type="Tween" parent="."]

View file

@ -1,9 +1,7 @@
extends Node2D
var _Cutscenes = {
"old_man_intro": "res://src/CutScenes/ChallengeCutscene.tscn"
}
func _ready() -> void:
@ -11,17 +9,9 @@ func _ready() -> void:
$Player/Camera2D.limit_left = -45
$Player/Camera2D.limit_right = 700
func _on_OldDudeIntroArea_body_entered(body: Node) -> void:
if body.name == 'Player':
AudioManager.play_music(AudioManager.Music.Abandon)
GameState.start_cutscene()
var scene = (load(_Cutscenes.old_man_intro)).instance()
add_child(scene)
scene.start_scene($Player/Camera2D)
yield(scene, "cutscene_finished")
GameState.end_cutscene()
pass # Replace with function body.
func _process(delta: float) -> void:
if $Player.global_position.x > 330:
$AmbiantLighting.change_light("NIGHT")
else:
$AmbiantLighting.change_light("DAY")

File diff suppressed because one or more lines are too long

27
src/GameWorld/PreGame.gd Normal file
View file

@ -0,0 +1,27 @@
extends Node2D
var _Cutscenes = {
"old_man_intro": "res://src/CutScenes/ChallengeCutscene.tscn"
}
var _played_old_man_cutscene = false
func _on_OldDudeIntroArea_body_entered(body: Node) -> void:
if _played_old_man_cutscene: return
if body.name == 'Player':
var old_man_animation_palyer = $WiseOldDude/AnimationPlayer
old_man_animation_palyer.play("fade")
yield(old_man_animation_palyer, "animation_finished")
old_man_animation_palyer.play("idle")
_played_old_man_cutscene = true
AudioManager.play_music(AudioManager.Music.Abandon)
GameState.start_cutscene()
var scene = (load(_Cutscenes.old_man_intro)).instance()
add_child(scene)
scene.start_scene(body.get_node("Camera2D"))
yield(scene, "cutscene_finished")
old_man_animation_palyer.play_backwards("fade")
yield(old_man_animation_palyer, "animation_finished")
GameState.end_cutscene(GameState.States.NEW_GAME)
pass # Replace with function body.

246
src/GameWorld/PreGame.tscn Normal file

File diff suppressed because one or more lines are too long

View file

@ -10,6 +10,8 @@ var _pause_ref;
var _data_ref = null;
func _ready() -> void:
_data_ref = GameState.get_run_data()
var time_remaining = (GameState.GAME_TIMEOUT_MIN * 60) - _data_ref.time
$UI/TimeLabel.text = Utils.parse_seconds_to_display_str(time_remaining)
func _physics_process(delta: float) -> void:
_handle_pause()

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=8 format=2]
[ext_resource path="res://assets/Items/coin_animation_6_2.png" type="Texture" id=1]
[ext_resource path="res://src/Items/Coin.gd" type="Script" id=2]
[ext_resource path="res://assets/Theme/Theme.tres" type="Theme" id=3]
[ext_resource path="res://assets/Items/torch_ligt_texture.png" type="Texture" id=4]
[sub_resource type="CircleShape2D" id=1]
radius = 4.0
@ -184,23 +185,51 @@ tracks/4/keys = {
"update": 0,
"values": [ Color( 1, 1, 1, 1 ) ]
}
tracks/5/type = "value"
tracks/5/path = NodePath("Sprite/Light2D:texture_scale")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/keys = {
"times": PoolRealArray( 0, 0.2, 0.5 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ 1.0, 1.8, 1.0 ]
}
tracks/6/type = "value"
tracks/6/path = NodePath("Sprite/Light2D:energy")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/keys = {
"times": PoolRealArray( 0, 0.5 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 0.8, 0.8 ]
}
[node name="Coin" type="Area2D"]
collision_layer = 16
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
position = Vector2( 0, -8 )
position = Vector2( 0, -4 )
texture = ExtResource( 1 )
vframes = 2
hframes = 6
frame = 8
frame = 2
[node name="Light2D" type="Light2D" parent="Sprite"]
texture = ExtResource( 4 )
texture_scale = 1.5
color = Color( 1, 0.976471, 0.878431, 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2( 0, -4 )
shape = SubResource( 1 )
disabled = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "idle"

View file

@ -549,6 +549,14 @@ position = Vector2( -900.545, 401.773 )
[node name="Goblin" parent="Enemies" instance=ExtResource( 22 )]
position = Vector2( 380.375, 528 )
num_of_hits = 3
walking_speed = 20.0
attack_cool_down = 0.1
patroler = true
idle_interval = 0.5
idle_time = 0.2
dont_fall_patrol = true
gravity = 500.0
[node name="Hazards" type="Node2D" parent="."]
@ -606,8 +614,8 @@ position = Vector2( 37.3754, 256 )
wall_jump_speed_factor = Vector2( 2.5, 0.9 )
abilities = {
"attack": true,
"dash": false,
"wall_jump": false
"dash": true,
"wall_jump": true
}
[node name="HUD" parent="." instance=ExtResource( 14 )]

View file

@ -14,7 +14,7 @@ func _on_ControlsBtn_pressed() -> void:
func _on_NewGameBtn_pressed() -> void:
GameState.start_new_game()
GameState.start_new_game(true)
queue_free()
func _input(event: InputEvent) -> void:

View file

@ -157,6 +157,7 @@ shadow_enabled = true
position = Vector2( 87, 175.5 )
amount = 50
lifetime = 2.5
preprocess = 4.0
speed_scale = 0.4
explosiveness = 0.1
process_material = SubResource( 7 )

30
src/Scripts/SpawnPoint.gd Normal file
View file

@ -0,0 +1,30 @@
extends Position2D
tool
export var node:PackedScene = null
onready var player_ref:Player = get_tree().current_scene.get_node("Player")
func _ready() -> void:
if Engine.editor_hint:
_spawn()
else:
player_ref.connect("died", self, "_on_Player_died")
func _on_VisibilityNotifier2D_screen_entered() -> void:
respawn()
func respawn():
var current_node = get_node("node")
if current_node == null and node != null:
_spawn()
else:
pass
func _on_Player_died():
if $VisibilityNotifier2D.is_on_screen():
respawn()
func _spawn():
var inst = node.instance()
inst.name = "node"
add_child(inst)

View file

@ -0,0 +1,10 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://src/Scripts/SpawnPoint.gd" type="Script" id=1]
[node name="SpawnPoint" type="Position2D"]
script = ExtResource( 1 )
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
rect = Rect2( -50, -50, 100, 100 )
[connection signal="screen_entered" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_entered"]

View file

@ -11,11 +11,13 @@ var _DESIRED_PAUSE_VOLUME = -25.0
enum Music{
Intro,
Abandon
Abandon,
PreGame
}
var _music_files := {
Music.Intro: load("res://assets/Audio/Dungeon - Altus Stratum.ogg"),
Music.Abandon: load("res://assets/Audio/Dungeon - Abandoned One.ogg")
Music.Abandon: load("res://assets/Audio/Dungeon - Abandoned One.ogg"),
Music.PreGame: load("res://assets/Audio/Scene - Lucid Night.ogg")
}

View file

@ -1,10 +1,15 @@
extends Node
signal scene_changed
enum States{
INTRO,
INTRO_CUTSCENE,
TRANSITIONING,
MAIN_MENU,
GAME_OVER,
CONTROLS,
NEW_GAME,
GAME,
PUSE,
STATS,
@ -16,12 +21,15 @@ var _ENCRYPTION_KEY = "fas3uyf076HJsiUDs24dfI9"
var _SCENES := {
States.MAIN_MENU: "res://src/Menu/MainMenu.tscn",
States.GAME: "res://src/GameWorld/GameWorld.tscn",
States.NEW_GAME: "res://src/GameWorld/GameWorld.tscn",
States.INTRO_CUTSCENE: "res://src/CutScenes/IntroCutscene.tscn"
}
var _player_spawn_point;
var GAME_TIMEOUT_MIN = 10
var _data := {
var _default_data := {
"statistics": {
"deaths": 0,
"clears": 0,
@ -37,9 +45,15 @@ var _data := {
"coins": 0,
"orbs": 0,
"time": 0,
},
"achivements": {
"a": false,
"b": false
}
}
var _data := _default_data
var _run_data:= {
"deaths": 0,
"coins": 0,
@ -52,7 +66,7 @@ var _state = States.INTRO
func _ready() -> void:
load_data()
print(get_statistics())
print(_data)
func _physics_process(delta: float) -> void:
if _state == States.GAME:
@ -66,7 +80,14 @@ func load_data():
data_file.close()
save_data()
else:
_data = data_file.get_var()
var saved_data:Dictionary = data_file.get_var()
for key in saved_data.keys():
if _data.has(key):
if typeof(saved_data[key]) == TYPE_DICTIONARY:
for sub_key in saved_data[key]:
var subdict:Dictionary = _data[key];
if subdict.has(sub_key): _data[key][sub_key] = saved_data[key][sub_key]
else: _data[key] = saved_data[key]
data_file.close()
pass
@ -77,17 +98,21 @@ func save_data():
data_file.close()
pass
func start_new_game():
func start_new_game(from_main_menu:bool=false, change_music:bool=true):
for key in _run_data.keys():
_run_data[key] = 0
_state = States.GAME
_data.statistics.runs += 1
var state = States.INTRO_CUTSCENE if from_main_menu else States.NEW_GAME
if not from_main_menu: _data.statistics.runs += 1
save_data()
get_tree().change_scene_to(load(_SCENES[_state]))
var delay = 3 if state == States.INTRO_CUTSCENE else .2
if change_music: AudioManager.play_music(AudioManager.Music.PreGame, delay)
_change_scene(state, delay)
# get_tree().change_scene_to(load(_SCENES[_state]))
func start_cutscene():
_state = States.CUTSCENE
func end_cutscene():
_state = States.GAME
func end_cutscene(state:int = States.GAME):
_state = state
func get_heigh_score():
return _data.heigh_score.duplicate()
func get_statistics():
@ -97,12 +122,31 @@ func get_run_data():
func get_state():
return int(_state)
func go_to_main_menu():
_state = States.MAIN_MENU
save_data()
get_tree().change_scene_to(load(_SCENES[_state]))
func player_died():
_change_scene(States.MAIN_MENU)
yield(self, "scene_changed")
func _change_scene(state:int,duration:float=.2):
_state = States.TRANSITIONING
Stage.fade_out(duration/2)
yield(Stage, "fade_finished")
get_tree().change_scene_to(load(_SCENES[state]))
Stage.fade_in(duration/2)
yield(Stage, "fade_finished")
_state = state
emit_signal("scene_changed")
func player_died(player:Player):
_run_data.deaths += 1
_data.statistics.deaths += 1
var prev_state = _state
_state = States.TRANSITIONING
Stage.fade_out(.8)
yield(Stage, "fade_finished")
Stage.fade_in(.8)
yield(Stage, "fade_finished")
_state = prev_state
func coin_collected():
_run_data.coins += 10
_data.statistics.coins += 10

29
src/Singletons/Stage.gd Normal file
View file

@ -0,0 +1,29 @@
extends CanvasLayer
signal fade_finished
var _current_scene: Node = null;
var _next_scene: Node = null;
var _BLACK_COLOR = Color(0,0,0,1)
var _TRANSPARENT_COLOR = Color(0,0,0,0)
func _ready() -> void:
fade_in()
func fade_in(sec:float = .2):
$Tween.stop_all()
$Tween.interpolate_property($ColorRect, "color", $ColorRect.color, _TRANSPARENT_COLOR, sec)
$Tween.start()
func fade_out(sec:float = .2):
$Tween.stop_all()
$Tween.interpolate_property($ColorRect, "color", $ColorRect.color, _BLACK_COLOR, sec)
$Tween.start()
func _on_Tween_tween_completed(object: Object, key: NodePath) -> void:
emit_signal("fade_finished")

18
src/Singletons/Stage.tscn Normal file
View file

@ -0,0 +1,18 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://src/Singletons/Stage.gd" type="Script" id=1]
[node name="Stage" type="CanvasLayer"]
script = ExtResource( 1 )
[node name="Tween" type="Tween" parent="."]
[node name="ColorRect" type="ColorRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
color = Color( 0, 0, 0, 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="tween_completed" from="Tween" to="." method="_on_fade_finished"]
[connection signal="tween_completed" from="Tween" to="." method="_on_Tween_tween_completed"]