platformer mostly working and overall game logic also coming along well

This commit is contained in:
Tabby 2025-05-16 23:16:29 +10:00
parent 88cb8f5899
commit df9ad93a43
5 changed files with 31 additions and 12 deletions

View file

@ -12,6 +12,7 @@ enum Mode{
@export var channel_name : String
@export var channel_scene : PackedScene
@export var dead_channel : bool
@export_group("Node References")
@export var offline_channel_cover : TextureRect
@export var static_channel_cover : TextureRect
@ -19,6 +20,8 @@ enum Mode{
var channel_mode : Mode = Mode.Offline
func _ready() -> void:
#var new_scene = channel_scene.instantiate()
#game_viewport.add_child(new_scene)

View file

@ -1,8 +1,9 @@
# High Priority
- [ ] remote breaking animation not working
- [x] pressing enter causes the platformer channel to restart event after the intiial prompt dismissial
- [ ] lasers not appearing
- [ ] only 1 lane getting warning
- [x] lasers not appearing
- [x] only 1 lane getting warning
- [ ] platformer works once but having trouble getting it to replay
# Minor

View file

@ -15,7 +15,7 @@ signal game_over(score : int)
@export var games : Array[PackedScene]
@export var zoom_speed : float = 0.5
@export_group("Channel Rules")
@export var target_channels : float = 2.5
@export var target_channels : float = 1.5
@export var channel_growth_per_min : float = 4
@export_group("Node References")
@ -68,14 +68,15 @@ func game_loop(delta : float):
var online_channels : Array[Channel]
var offline_channels : Array[Channel]
# sort all the channels into online and offline
if main_channel.channel_mode == Channel.Mode.Online:
#if main_channel.channel_mode == Channel.Mode.Online:
if main_channel.platformer_online:
online_channels.append(main_channel)
else:
online_channels.append(main_channel)
for channel in outer_channels:
if(channel.channel_mode == Channel.Mode.Online):
online_channels.append(channel)
else:
elif(!channel.dead_channel):
offline_channels.append(channel)
# if i need to switch a channel online, then pick one and run tis start channel method
#print("Online Channels: " + str(online_channels.size()))
@ -84,7 +85,9 @@ func game_loop(delta : float):
var random_game = randi_range(0, games.size()-1)
#offline_channels[random_channel_number].start_channel()
if(offline_channels[random_channel_number] != main_channel):
offline_channels[random_channel_number].start_specific_channel(games[random_game])
offline_channels[random_channel_number].start_channel()
#picking a random game is cool but we cant have two of the same!
#offline_channels[random_channel_number].start_specific_channel(games[random_game])
else:
main_channel.start_channel()

View file

@ -53,6 +53,7 @@ columns = 3
[node name="Control" parent="GridContainer" instance=ExtResource("1_mlf6e")]
layout_mode = 2
channel_scene = ExtResource("7_6e45b")
dead_channel = true
[node name="Control2" parent="GridContainer" instance=ExtResource("1_mlf6e")]
layout_mode = 2
@ -63,6 +64,7 @@ channel_scene = ExtResource("3_mj2jn")
layout_mode = 2
channel_name = "Asteroids"
channel_scene = ExtResource("3_mj2jn")
dead_channel = true
[node name="Control6" parent="GridContainer" instance=ExtResource("1_mlf6e")]
layout_mode = 2

View file

@ -35,12 +35,16 @@ func _ready() -> void:
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
for i in range(2):
#warning_areas[i].visible = stage == GameStage.Warning and safe_lane!=i
#laser_areas[i].visible = stage == GameStage.Lasers and safe_lane!=i
for i in range(3):
warning_areas[i].visible = stage == GameStage.Warning and safe_lane!=i
laser_areas[i].visible = stage == GameStage.Lasers and safe_lane!=i
if(stage == GameStage.Lasers and safe_lane!=i):
if laser_areas[i].get_overlapping_areas().size()>0:
end_game()
game_lose.emit()
pass
warning_areas[0].visible = stage == GameStage.Warning
laser_areas[0].visible = stage == GameStage.Lasers
#warning_areas[0].visible = stage == GameStage.Warning
#laser_areas[0].visible = stage == GameStage.Lasers
#todo make sure lasers dont trigger the door/remote/event hitboxes
func update_ui(score : int, lives :int):
@ -60,6 +64,7 @@ func start_game():
pass
func end_game():
# set stage back to none?
game_active = false
pass
@ -68,5 +73,10 @@ func _on_timer_timeout() -> void:
if(stage == GameStage.Warning):
stage = GameStage.Lasers
timer.start(laser_duration)
if(stage == GameStage.Lasers):
elif(stage == GameStage.Lasers):
stage = GameStage.None
if(game_active):
game_win.emit()
end_game()
#if i havent died yet, then win