fix: better timer label anim, alarm light shader activation
This commit is contained in:
parent
79e0fe4a2e
commit
ee5feb73c1
@ -1,5 +1,22 @@
|
|||||||
extends Camera2D
|
extends Camera2D
|
||||||
|
|
||||||
|
export var camera_horizontal_shift = 60
|
||||||
|
export var offset_reset_seconds := 1
|
||||||
|
export var offset_adapt_seconds := 1
|
||||||
|
export var offset_input_seconds := 0.618 * 2
|
||||||
|
export var alarm_light_shader: Material
|
||||||
|
|
||||||
|
onready var levelState := $"%LevelState"
|
||||||
|
onready var signalManager := $"%SignalManager"
|
||||||
|
onready var shiftLeft = $CameraAnimationPlayer.get_animation("shiftingLeft")
|
||||||
|
onready var shiftRight = $CameraAnimationPlayer.get_animation("shiftingRight")
|
||||||
|
onready var shiftCenter = $CameraAnimationPlayer.get_animation("shiftingCenter")
|
||||||
|
onready var anim_player := $CameraAnimationPlayer
|
||||||
|
onready var horizontal_tween := $HorizontalShiftTween
|
||||||
|
onready var original_x_zoom := zoom.x
|
||||||
|
onready var original_y_zoom := zoom.y
|
||||||
|
onready var blobby := get_node("%Blobby")
|
||||||
|
|
||||||
var horizontal_facing = 0
|
var horizontal_facing = 0
|
||||||
var vertical_facing = 0
|
var vertical_facing = 0
|
||||||
var camera_vertical_shift = 0
|
var camera_vertical_shift = 0
|
||||||
@ -14,22 +31,7 @@ var original_limit_top: int
|
|||||||
var camera_is_panning: bool = false
|
var camera_is_panning: bool = false
|
||||||
var target_offset: Vector2 = Vector2(0,0)
|
var target_offset: Vector2 = Vector2(0,0)
|
||||||
|
|
||||||
export var camera_horizontal_shift = 60
|
var terminal_activated: bool = false
|
||||||
export var offset_reset_seconds := 1
|
|
||||||
export var offset_adapt_seconds := 1
|
|
||||||
export var offset_input_seconds := 0.618 * 2
|
|
||||||
|
|
||||||
onready var levelState := $"%LevelState"
|
|
||||||
onready var signalManager := $"%SignalManager"
|
|
||||||
onready var shiftLeft = $CameraAnimationPlayer.get_animation("shiftingLeft")
|
|
||||||
onready var shiftRight = $CameraAnimationPlayer.get_animation("shiftingRight")
|
|
||||||
onready var shiftCenter = $CameraAnimationPlayer.get_animation("shiftingCenter")
|
|
||||||
onready var anim_player := $CameraAnimationPlayer
|
|
||||||
onready var horizontal_tween := $HorizontalShiftTween
|
|
||||||
onready var original_x_zoom := zoom.x
|
|
||||||
onready var original_y_zoom := zoom.y
|
|
||||||
onready var blobby := get_node("%Blobby")
|
|
||||||
|
|
||||||
var image = Image.new()
|
var image = Image.new()
|
||||||
var texture = ImageTexture.new()
|
var texture = ImageTexture.new()
|
||||||
var prev_pos: Vector2
|
var prev_pos: Vector2
|
||||||
@ -51,12 +53,14 @@ func _ready():
|
|||||||
self.position = blobby.global_position
|
self.position = blobby.global_position
|
||||||
image.create(128, 2, false, Image.FORMAT_RGBAH)
|
image.create(128, 2, false, Image.FORMAT_RGBAH)
|
||||||
# TODO Test Performance
|
# TODO Test Performance
|
||||||
|
material.set_shader_param("light_data", null)
|
||||||
_update_lighting_shader()
|
_update_lighting_shader()
|
||||||
# TODO Trigger when needed
|
# TODO Trigger when needed
|
||||||
signalManager.connect("terminal_activated", self, "_on_SignalManager_terminal_activated")
|
signalManager.connect("terminal_activated", self, "_on_SignalManager_terminal_activated")
|
||||||
signalManager.connect("player_died", self, "_death_cam")
|
signalManager.connect("player_died", self, "_death_cam")
|
||||||
|
|
||||||
func _on_SignalManager_terminal_activated(animation_number: int = 0):
|
func _on_SignalManager_terminal_activated(animation_number: int = 0):
|
||||||
|
terminal_activated = true
|
||||||
get_node("LightAnimationPlayer").play("Pulsing")
|
get_node("LightAnimationPlayer").play("Pulsing")
|
||||||
|
|
||||||
#func _draw():
|
#func _draw():
|
||||||
@ -230,7 +234,9 @@ func _death_cam(animation_number: int = 0) -> void:
|
|||||||
if(animation_number == 1):
|
if(animation_number == 1):
|
||||||
$CameraAnimationPlayer.play("deathCamLateRotation")
|
$CameraAnimationPlayer.play("deathCamLateRotation")
|
||||||
|
|
||||||
|
# TODO Rename to alarm lights specially
|
||||||
func _update_lighting_shader() -> void:
|
func _update_lighting_shader() -> void:
|
||||||
|
if !terminal_activated: return
|
||||||
# Props to gameendaevour
|
# Props to gameendaevour
|
||||||
# TODO get this into a central world update management system
|
# TODO get this into a central world update management system
|
||||||
var lights = get_tree().get_nodes_in_group("light")
|
var lights = get_tree().get_nodes_in_group("light")
|
||||||
|
|||||||
@ -925,21 +925,21 @@ material = ExtResource( 38 )
|
|||||||
z_index = -1
|
z_index = -1
|
||||||
texture = ExtResource( 5 )
|
texture = ExtResource( 5 )
|
||||||
|
|
||||||
[node name="Emitter3" type="Sprite" parent="ParallaxBackground/ParallaxLayer4"]
|
[node name="Emitter3" type="Sprite" parent="ParallaxBackground/ParallaxLayer4" groups=["light"]]
|
||||||
visible = false
|
visible = false
|
||||||
position = Vector2( -154, 14 )
|
position = Vector2( -154, 14 )
|
||||||
texture = ExtResource( 40 )
|
texture = ExtResource( 40 )
|
||||||
script = ExtResource( 39 )
|
script = ExtResource( 39 )
|
||||||
color = Color( 1, 0, 0, 0.615686 )
|
color = Color( 1, 0, 0, 0.615686 )
|
||||||
|
|
||||||
[node name="Emitter4" type="Sprite" parent="ParallaxBackground/ParallaxLayer4"]
|
[node name="Emitter4" type="Sprite" parent="ParallaxBackground/ParallaxLayer4" groups=["light"]]
|
||||||
visible = false
|
visible = false
|
||||||
position = Vector2( 1, 14 )
|
position = Vector2( 1, 14 )
|
||||||
texture = ExtResource( 40 )
|
texture = ExtResource( 40 )
|
||||||
script = ExtResource( 39 )
|
script = ExtResource( 39 )
|
||||||
color = Color( 1, 0, 0, 0.615686 )
|
color = Color( 1, 0, 0, 0.615686 )
|
||||||
|
|
||||||
[node name="Emitter5" type="Sprite" parent="ParallaxBackground/ParallaxLayer4"]
|
[node name="Emitter5" type="Sprite" parent="ParallaxBackground/ParallaxLayer4" groups=["light"]]
|
||||||
visible = false
|
visible = false
|
||||||
position = Vector2( 154, 14 )
|
position = Vector2( 154, 14 )
|
||||||
texture = ExtResource( 40 )
|
texture = ExtResource( 40 )
|
||||||
@ -972,10 +972,10 @@ texture = ExtResource( 8 )
|
|||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
[node name="AnimatedSprite" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
||||||
frames = SubResource( 7 )
|
frames = SubResource( 7 )
|
||||||
frame = 4
|
frame = 13
|
||||||
playing = true
|
playing = true
|
||||||
|
|
||||||
[node name="AnimatedSprite2" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
[node name="AnimatedSprite2" type="AnimatedSprite" parent="ParallaxBackground/ParallaxLayer5"]
|
||||||
frames = SubResource( 8 )
|
frames = SubResource( 8 )
|
||||||
frame = 9
|
frame = 4
|
||||||
playing = true
|
playing = true
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=48 format=2]
|
[gd_scene load_steps=49 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://assets/enemy/froshler.png" type="Texture" id=1]
|
[ext_resource path="res://assets/enemy/froshler.png" type="Texture" id=1]
|
||||||
[ext_resource path="res://src/Actors/Enemies/Beings/WhatAreFrog.gd" type="Script" id=2]
|
[ext_resource path="res://src/Actors/Enemies/Beings/WhatAreFrog.gd" type="Script" id=2]
|
||||||
@ -432,6 +432,9 @@ extents = Vector2( 12, 0.5 )
|
|||||||
[sub_resource type="RectangleShape2D" id=3]
|
[sub_resource type="RectangleShape2D" id=3]
|
||||||
extents = Vector2( 18.2143, 13.5955 )
|
extents = Vector2( 18.2143, 13.5955 )
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=59]
|
||||||
|
extents = Vector2( 10, 15 )
|
||||||
|
|
||||||
[node name="WhatAreFrog" type="KinematicBody2D"]
|
[node name="WhatAreFrog" type="KinematicBody2D"]
|
||||||
collision_layer = 2
|
collision_layer = 2
|
||||||
collision_mask = 185
|
collision_mask = 185
|
||||||
@ -585,6 +588,14 @@ shape = SubResource( 3 )
|
|||||||
wait_time = 3.236
|
wait_time = 3.236
|
||||||
one_shot = true
|
one_shot = true
|
||||||
|
|
||||||
|
[node name="JumpCollisionBody" type="KinematicBody2D" parent="."]
|
||||||
|
collision_layer = 2
|
||||||
|
collision_mask = 8
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="JumpCollisionBody"]
|
||||||
|
position = Vector2( 0, -6 )
|
||||||
|
shape = SubResource( 59 )
|
||||||
|
|
||||||
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
|
[connection signal="body_entered" from="StompDetector" to="." method="_on_StompDetector_body_entered"]
|
||||||
[connection signal="body_exited" from="StompDetector" to="." method="_on_StompDetector_body_exited"]
|
[connection signal="body_exited" from="StompDetector" to="." method="_on_StompDetector_body_exited"]
|
||||||
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]
|
[connection signal="area_entered" from="EnemySkin" to="." method="_on_EnemySkin_area_entered"]
|
||||||
|
|||||||
@ -10,21 +10,21 @@ export(String, FILE, "*.tscn") var next_scene
|
|||||||
|
|
||||||
|
|
||||||
func _get_configuration_warning() -> String:
|
func _get_configuration_warning() -> String:
|
||||||
return "The next scene property can't be empty" if not next_scene else ""
|
return "The next scene property can't be empty" if not next_scene else ""
|
||||||
|
|
||||||
func level_completion() -> void:
|
func level_completion() -> void:
|
||||||
signalManager.emit_signal("level_completed")
|
signalManager.emit_signal("level_completed")
|
||||||
|
|
||||||
|
|
||||||
func teleport() -> void:
|
func teleport() -> void:
|
||||||
get_tree().paused = true
|
get_tree().paused = true
|
||||||
anim_player.play("fade_in")
|
anim_player.play("fade_in")
|
||||||
# TODO This doesn't pause the game but should
|
# TODO This doesn't pause the game but should
|
||||||
yield(anim_player, "animation_finished")
|
yield(anim_player, "animation_finished")
|
||||||
if ResourceLoader.exists(next_scene):
|
if ResourceLoader.exists(next_scene):
|
||||||
get_tree().change_scene(next_scene)
|
get_tree().change_scene(next_scene)
|
||||||
|
|
||||||
|
|
||||||
func _on_body_entered(_body: Node) -> void:
|
func _on_body_entered(_body: Node) -> void:
|
||||||
level_completion()
|
level_completion()
|
||||||
teleport()
|
teleport()
|
||||||
|
|||||||
@ -42,10 +42,10 @@ unique_name_in_owner = true
|
|||||||
process_mode = 1
|
process_mode = 1
|
||||||
|
|
||||||
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
[node name="AnimatedSprite" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="4"]
|
||||||
frame = 8
|
frame = 0
|
||||||
|
|
||||||
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
[node name="AnimatedSprite2" parent="BlobbyCam/ParallaxBackground/ParallaxLayer5" index="5"]
|
||||||
frame = 7
|
frame = 13
|
||||||
|
|
||||||
[node name="Blobby" parent="." instance=ExtResource( 7 )]
|
[node name="Blobby" parent="." instance=ExtResource( 7 )]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -39,7 +39,6 @@ tracks/0/keys = {
|
|||||||
script = ExtResource( 1 )
|
script = ExtResource( 1 )
|
||||||
|
|
||||||
[node name="anim" type="AnimationPlayer" parent="."]
|
[node name="anim" type="AnimationPlayer" parent="."]
|
||||||
pause_mode = 2
|
|
||||||
playback_process_mode = 0
|
playback_process_mode = 0
|
||||||
anims/Path = SubResource( 3 )
|
anims/Path = SubResource( 3 )
|
||||||
anims/RESET = SubResource( 4 )
|
anims/RESET = SubResource( 4 )
|
||||||
|
|||||||
@ -33,7 +33,8 @@ func start_timer(time):
|
|||||||
|
|
||||||
func _zoom_timer() -> void:
|
func _zoom_timer() -> void:
|
||||||
var tween := create_tween()
|
var tween := create_tween()
|
||||||
tween.tween_property(timer, "rect_scale", Vector2(1,1), 1.0)
|
tween.parallel().tween_property(timer, "rect_position", Vector2(295, 0), 1.0)
|
||||||
|
tween.parallel().tween_property(timer, "rect_scale", Vector2(1,1), 1.0)
|
||||||
|
|
||||||
|
|
||||||
func update_interface() -> void:
|
func update_interface() -> void:
|
||||||
|
|||||||
@ -88,12 +88,16 @@ unique_name_in_owner = true
|
|||||||
visible = false
|
visible = false
|
||||||
anchor_left = 0.5
|
anchor_left = 0.5
|
||||||
anchor_right = 0.5
|
anchor_right = 0.5
|
||||||
margin_left = 45.0
|
margin_left = -140.0
|
||||||
margin_right = 73.0
|
margin_right = -90.0
|
||||||
margin_bottom = 21.0
|
margin_bottom = 21.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
rect_scale = Vector2( 5, 5 )
|
rect_scale = Vector2( 5, 5 )
|
||||||
|
size_flags_horizontal = 0
|
||||||
|
size_flags_vertical = 0
|
||||||
text = "100"
|
text = "100"
|
||||||
align = 2
|
align = 1
|
||||||
|
|
||||||
[node name="Timer" type="Timer" parent="HUDOverlay/GetBackTimer"]
|
[node name="Timer" type="Timer" parent="HUDOverlay/GetBackTimer"]
|
||||||
wait_time = 100.0
|
wait_time = 100.0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user