Compare commits

..

1 commit

Author SHA1 Message Date
Sagi Dayan 5925b02fe7 light effects ? 2020-11-27 19:12:24 -05:00
9 changed files with 32 additions and 21 deletions

View file

@ -28,7 +28,7 @@
0/z_index = 0
[node name="FakeSolidsTileMap" type="TileMap"]
z_index = 10
z_index = 1
tile_set = SubResource( 35 )
cell_size = Vector2( 16, 16 )
collision_layer = 9

View file

@ -104,6 +104,7 @@ AudioManager="*res://src/Singletons/AudioManager.tscn"
GameState="*res://src/Singletons/GameState.gd"
Utils="*res://src/Singletons/Utils.gd"
Stage="*res://src/Singletons/Stage.tscn"
AmbiantLighting="*res://src/GameWorld/AmbiantLighting.tscn"
[display]

View file

@ -1,7 +1,8 @@
extends Level
func ready() -> void:
$AmbiantLighting.change_light("AREA1")
# func ready() -> void:
func _enter_tree() -> void:
AudioManager.play_music(AudioManager.Music.Abandon)
AudioManager.play_music(AudioManager.Music.Abandon)
AmbiantLighting.change_light("AREA1")

View file

@ -1,7 +1,6 @@
[gd_scene load_steps=20 format=2]
[gd_scene load_steps=19 format=2]
[ext_resource path="res://src/GameWorld/Levels/Area1/Area11.gd" type="Script" id=1]
[ext_resource path="res://src/GameWorld/AmbiantLighting.tscn" type="PackedScene" id=2]
[ext_resource path="res://assets/Tiles/SolidsTileMap.tscn" type="PackedScene" id=3]
[ext_resource path="res://src/Scripts/WarpZone.tscn" type="PackedScene" id=4]
[ext_resource path="res://assets/Tiles/TrapTiles.tscn" type="PackedScene" id=5]
@ -49,8 +48,6 @@ light_mask = 0
scale = Vector2( 2, 2 )
texture = ExtResource( 11 )
[node name="AmbiantLighting" parent="." instance=ExtResource( 2 )]
[node name="Tiles" type="Node2D" parent="."]
[node name="SemiSolidsTileMap" parent="Tiles" instance=ExtResource( 6 )]
@ -120,6 +117,7 @@ node = ExtResource( 8 )
[node name="Hazards" type="Node2D" parent="."]
position = Vector2( 417, 320 )
z_index = 1
[node name="MaskTrap" parent="Hazards" instance=ExtResource( 13 )]
position = Vector2( 16, 0 )

View file

@ -40,6 +40,6 @@ func _on_OldDudeIntroArea_body_entered(body: Node) -> void:
func _process(delta: float) -> void:
if is_active_level:
if _player.position.x > 330:
$AmbiantLighting.change_light("NIGHT")
AmbiantLighting.change_light("NIGHT")
else:
$AmbiantLighting.change_light("DAY")
AmbiantLighting.change_light("DAY")

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=30 format=2]
[gd_scene load_steps=29 format=2]
[ext_resource path="res://src/GameWorld/Levels/PreGame.gd" type="Script" id=1]
[ext_resource path="res://assets/Tiles/background_0.png" type="Texture" id=2]
@ -13,7 +13,6 @@
[ext_resource path="res://assets/Tiles/tileset.png" type="Texture" id=11]
[ext_resource path="res://assets/Tiles/SolidsTileMap.tscn" type="PackedScene" id=12]
[ext_resource path="res://src/Actors/WiseOldDude/WiseOldDude.tscn" type="PackedScene" id=13]
[ext_resource path="res://src/GameWorld/AmbiantLighting.tscn" type="PackedScene" id=14]
[ext_resource path="res://src/Scripts/WarpZone.tscn" type="PackedScene" id=15]
[ext_resource path="res://src/Hazards/SpikeTrap.tscn" type="PackedScene" id=16]
[ext_resource path="res://src/Items/Spring.tscn" type="PackedScene" id=17]
@ -268,14 +267,14 @@ position = Vector2( 281, -12 )
[node name="Coin3" parent="Coins" instance=ExtResource( 9 )]
position = Vector2( 122, 107 )
[node name="AmbiantLighting" parent="." instance=ExtResource( 14 )]
[node name="WarpZone" parent="." instance=ExtResource( 15 )]
position = Vector2( 723, 225 )
to_level_coord = Vector2( 0, 1 )
[node name="SpikeTrap" parent="." instance=ExtResource( 16 )]
position = Vector2( 352, 208 )
direction = 1
cooldown_timeout = 2.0
[node name="Spring" parent="." instance=ExtResource( 17 )]
position = Vector2( 134, 240 )
@ -297,7 +296,6 @@ position = Vector2( 217, 167 )
to_point = Vector2( 0, 65 )
duration = 0.5
delay = 0.2
g = "UP_DOWN"
[node name="BrakableVase" parent="." instance=ExtResource( 19 )]
position = Vector2( 295, 240 )

View file

@ -39,6 +39,18 @@ tracks/1/keys = {
"method": "queue_free"
} ]
}
tracks/2/type = "value"
tracks/2/path = NodePath("Light2D:energy")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 0.1 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ 1.44, 0.0 ]
}
[sub_resource type="Animation" id=4]
resource_name = "idle"
@ -85,11 +97,12 @@ anims/fade_out = SubResource( 3 )
anims/idle = SubResource( 4 )
[node name="Light2D" type="Light2D" parent="."]
position = Vector2( -2.5, -0.5 )
position = Vector2( -7, -0.5 )
scale = Vector2( 1.84, 0.28 )
texture = ExtResource( 3 )
color = Color( 0.905882, 0.6, 0.6, 1 )
range_item_cull_mask = 31775
color = Color( 0.976471, 0.282353, 0.282353, 1 )
energy = 1.44
range_item_cull_mask = 1071
shadow_enabled = true
shadow_item_cull_mask = 9
[connection signal="body_entered" from="HitZone" to="." method="_on_HitZone_body_entered"]
[connection signal="body_entered" from="PinZone" to="." method="_on_PinZone_body_entered"]

View file

@ -69,6 +69,7 @@ tracks/0/keys = {
}
[node name="MaskTrap" type="Node2D"]
z_index = 1
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]

View file

@ -82,7 +82,6 @@ tracks/0/keys = {
light_mask = 8
position = Vector2( 0, -12 )
frames = SubResource( 13 )
frame = 5
playing = true
[node name="Light2D" type="Light2D" parent="AnimatedSprite"]
@ -90,7 +89,7 @@ position = Vector2( 0, -5 )
texture = ExtResource( 2 )
texture_scale = 5.285
color = Color( 0.945098, 0.419608, 0.160784, 1 )
range_item_cull_mask = 1033
range_item_cull_mask = 1037
shadow_enabled = true
shadow_item_cull_mask = 1038