Added catch up. Added level 2
This commit is contained in:
@@ -3,8 +3,12 @@ extends Node2D
|
|||||||
|
|
||||||
|
|
||||||
const CORRUPTION_DAMAGE = 10.0
|
const CORRUPTION_DAMAGE = 10.0
|
||||||
|
const ADDITIONAL_SCROLL_OFFSET = 500.0
|
||||||
|
const MAX_DISTANCE_TO_CORRUPTION = 320.0
|
||||||
|
|
||||||
|
|
||||||
|
@export var is_player_running_on_start := true
|
||||||
|
@export var background_offset := 0.0
|
||||||
@export var initial_corruption_x := -400.0
|
@export var initial_corruption_x := -400.0
|
||||||
@export var corruption_speed := 200.0
|
@export var corruption_speed := 200.0
|
||||||
@export var desctruction_offset := 100.0
|
@export var desctruction_offset := 100.0
|
||||||
@@ -28,14 +32,20 @@ var _corruption_x: float
|
|||||||
|
|
||||||
@onready var camera : Camera2D = player.camera
|
@onready var camera : Camera2D = player.camera
|
||||||
|
|
||||||
|
@onready var parallax_1 : Parallax2D = $Background/Parallax1
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
|
parallax_1.scroll_offset.x = ADDITIONAL_SCROLL_OFFSET + background_offset
|
||||||
|
|
||||||
_corruption_x = initial_corruption_x
|
_corruption_x = initial_corruption_x
|
||||||
pause_menu.hide()
|
pause_menu.hide()
|
||||||
game_over_menu.hide()
|
game_over_menu.hide()
|
||||||
completion_menu.hide()
|
completion_menu.hide()
|
||||||
|
|
||||||
|
if is_player_running_on_start:
|
||||||
|
player.velocity.x = player.move_max_speed_normal
|
||||||
|
|
||||||
health_bar.initialize(player.MAX_HEALTH, player.MAX_HEALTH)
|
health_bar.initialize(player.MAX_HEALTH, player.MAX_HEALTH)
|
||||||
player.health_changed.connect(health_bar.set_current_value)
|
player.health_changed.connect(health_bar.set_current_value)
|
||||||
|
|
||||||
@@ -63,7 +73,10 @@ func _physics_process(delta: float) -> void:
|
|||||||
if corruption_timer.is_stopped():
|
if corruption_timer.is_stopped():
|
||||||
corruption_timer.start()
|
corruption_timer.start()
|
||||||
else:
|
else:
|
||||||
|
MAX_DISTANCE_TO_CORRUPTION
|
||||||
corruption_timer.stop()
|
corruption_timer.stop()
|
||||||
|
if player.position.x - _corruption_x > MAX_DISTANCE_TO_CORRUPTION:
|
||||||
|
_corruption_x = player.position.x - MAX_DISTANCE_TO_CORRUPTION
|
||||||
|
|
||||||
if player.position.y > 0.0:
|
if player.position.y > 0.0:
|
||||||
SoundManager.play_sfx_stream(SoundManager.sfx_stream_fall, player.global_position)
|
SoundManager.play_sfx_stream(SoundManager.sfx_stream_fall, player.global_position)
|
||||||
|
|||||||
@@ -1895,8 +1895,9 @@ script = ExtResource("1_o2mui")
|
|||||||
|
|
||||||
[node name="Parallax1" type="Parallax2D" parent="Background" unique_id=1102720638]
|
[node name="Parallax1" type="Parallax2D" parent="Background" unique_id=1102720638]
|
||||||
scroll_scale = Vector2(0.01, 0.01)
|
scroll_scale = Vector2(0.01, 0.01)
|
||||||
scroll_offset = Vector2(-602, 180)
|
scroll_offset = Vector2(500, 180)
|
||||||
repeat_size = Vector2(900, 0)
|
repeat_size = Vector2(900, 0)
|
||||||
|
repeat_times = 2
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Background/Parallax1" unique_id=1313622890]
|
[node name="Sprite2D" type="Sprite2D" parent="Background/Parallax1" unique_id=1313622890]
|
||||||
texture = ExtResource("2_3fw0b")
|
texture = ExtResource("2_3fw0b")
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3,7 +3,8 @@
|
|||||||
[ext_resource type="Script" uid="uid://cm1lme51ido64" path="res://game/managers/level_manager.gd" id="1_te7jw"]
|
[ext_resource type="Script" uid="uid://cm1lme51ido64" path="res://game/managers/level_manager.gd" id="1_te7jw"]
|
||||||
[ext_resource type="PackedScene" uid="uid://deto1j12jm5rf" path="res://game/levels/level_1.tscn" id="2_dp0cj"]
|
[ext_resource type="PackedScene" uid="uid://deto1j12jm5rf" path="res://game/levels/level_1.tscn" id="2_dp0cj"]
|
||||||
[ext_resource type="PackedScene" uid="uid://cuig5x5fd47hs" path="res://game/levels/test_level.tscn" id="2_ow2rn"]
|
[ext_resource type="PackedScene" uid="uid://cuig5x5fd47hs" path="res://game/levels/test_level.tscn" id="2_ow2rn"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://d0rwlgmvvo637" path="res://game/levels/level_2.tscn" id="3_r84xe"]
|
||||||
|
|
||||||
[node name="LevelManager" type="Node" unique_id=1657502743]
|
[node name="LevelManager" type="Node" unique_id=1657502743]
|
||||||
script = ExtResource("1_te7jw")
|
script = ExtResource("1_te7jw")
|
||||||
levels = Array[PackedScene]([ExtResource("2_dp0cj"), ExtResource("2_ow2rn")])
|
levels = Array[PackedScene]([ExtResource("2_dp0cj"), ExtResource("3_r84xe"), ExtResource("2_ow2rn")])
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ config/name="NeonCollapse"
|
|||||||
run/main_scene="uid://cl0h2acqcq5wq"
|
run/main_scene="uid://cl0h2acqcq5wq"
|
||||||
config/features=PackedStringArray("4.7", "GL Compatibility")
|
config/features=PackedStringArray("4.7", "GL Compatibility")
|
||||||
run/max_fps=240
|
run/max_fps=240
|
||||||
|
boot_splash/show_image=false
|
||||||
config/icon="res://icon.svg"
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
[audio]
|
[audio]
|
||||||
|
|||||||
Reference in New Issue
Block a user