Merge branch 'Rycarus_Level_4' into dev
This commit is contained in:
commit
4bce0a3ecf
18 changed files with 665 additions and 103 deletions
|
@ -1,11 +1,17 @@
|
|||
extends Node
|
||||
|
||||
@export var next : PackedScene
|
||||
@export var completed = preload("res://objects/LevelComplete.tscn")
|
||||
|
||||
@onready var animation = $AnimationPlayer
|
||||
|
||||
@onready var level_select_scene = preload("res://menu/level_menu/level_select.tscn")
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
animation.play("portal")
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
get_tree().change_scene_to_packed(next)
|
||||
if next == level_select_scene:
|
||||
get_tree().change_scene_to_packed(completed)
|
||||
else:
|
||||
get_tree().change_scene_to_packed(next)
|
||||
|
|
97
gmtk_2024/scripts/level_completed_control.gd
Normal file
97
gmtk_2024/scripts/level_completed_control.gd
Normal file
|
@ -0,0 +1,97 @@
|
|||
extends Control
|
||||
|
||||
var credits_text = """
|
||||
CONGRATULATIONS
|
||||
THIS SECTOR IS NOW INFECTED
|
||||
YOU NOW HAVE ACCESS TO THE NEXT SECTION
|
||||
|
||||
"""
|
||||
|
||||
var current_text = ""
|
||||
var char_index = 0
|
||||
var typing_speed = 0.05
|
||||
var fast_typing_speed = 0.0001
|
||||
var last_click_time = 0.0
|
||||
var double_click_time = 0.3
|
||||
var is_typing = true
|
||||
var current_button_index = 0
|
||||
var button
|
||||
|
||||
func _ready():
|
||||
_initialize_menu()
|
||||
_start_typing()
|
||||
|
||||
func _initialize_menu():
|
||||
button = $VBoxContainer/BackToMenu
|
||||
_update_button_visibility()
|
||||
_blink_current_button()
|
||||
|
||||
func _update_button_visibility():
|
||||
var hbox_container = button
|
||||
var label_node = hbox_container.get_child(0)
|
||||
if label_node != null:
|
||||
label_node.visible
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not is_typing:
|
||||
if Input.is_action_pressed("ui_accept"):
|
||||
typing_speed = fast_typing_speed
|
||||
|
||||
func _blink_current_button() -> void:
|
||||
while true:
|
||||
var hbox_container = button
|
||||
var label_node = hbox_container.get_child(0)
|
||||
if label_node != null:
|
||||
label_node.visible = true
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
if label_node != null:
|
||||
label_node.visible = false
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if is_typing:
|
||||
if event is InputEventKey and event.is_pressed():
|
||||
if get_time_since_last_click() <= double_click_time:
|
||||
_show_full_text()
|
||||
else:
|
||||
typing_speed = fast_typing_speed
|
||||
elif event is InputEventKey and not event.is_pressed():
|
||||
typing_speed = 0.05
|
||||
else:
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
button.get_child(1).emit_signal("pressed")
|
||||
|
||||
func _start_typing() -> void:
|
||||
current_text = ""
|
||||
char_index = 0
|
||||
is_typing = true
|
||||
_update_text()
|
||||
|
||||
func _update_text() -> void:
|
||||
if char_index < credits_text.length():
|
||||
current_text += credits_text[char_index]
|
||||
$VBoxContainer/Label.text = current_text
|
||||
char_index += 1
|
||||
await get_tree().create_timer(typing_speed).timeout
|
||||
_update_text()
|
||||
else:
|
||||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
func _show_menu_options() -> void:
|
||||
$VBoxContainer/BackToMenu.visible = true
|
||||
|
||||
func _return_to_main_menu() -> void:
|
||||
get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn")
|
||||
|
||||
func _show_full_text() -> void:
|
||||
current_text = credits_text
|
||||
$VBoxContainer/Label.text = current_text
|
||||
char_index = credits_text.length()
|
||||
_show_menu_options()
|
||||
|
||||
func get_time_since_last_click() -> float:
|
||||
var current_time = Time.get_ticks_msec() / 1000.0 # Zeit in Sekunden
|
||||
var time_since_last_click = current_time - last_click_time
|
||||
last_click_time = current_time
|
||||
return time_since_last_click
|
|
@ -1,6 +1,7 @@
|
|||
extends Control
|
||||
|
||||
func _ready():
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
|
||||
setup_level_box()
|
||||
connect_level_selected_to_level_box()
|
||||
|
||||
|
|
|
@ -4,38 +4,69 @@ var credits_text = """
|
|||
CREDITS:
|
||||
-----------
|
||||
Programming: Jannis, Fabio
|
||||
Design: Leon
|
||||
Pixel Art : Leon
|
||||
Music: TBN
|
||||
|
||||
"""
|
||||
|
||||
var current_text = ""
|
||||
var char_index = 0
|
||||
var typing_speed = 0.05 # Normale Tippgeschwindigkeit
|
||||
var fast_typing_speed = 0.01 # Schnellere Tippgeschwindigkeit
|
||||
var is_fast_typing = false # Statusvariable für schnelleres Tippen
|
||||
|
||||
# Zum Überprüfen eines Doppelklicks
|
||||
var typing_speed = 0.05
|
||||
var fast_typing_speed = 0.0001
|
||||
var last_click_time = 0.0
|
||||
var double_click_time = 0.3 # Zeitfenster für Doppelklick in Sekunden
|
||||
var double_click_time = 0.3
|
||||
var is_typing = true
|
||||
var current_button_index = 0
|
||||
var button
|
||||
|
||||
func _ready():
|
||||
_initialize_menu()
|
||||
_start_typing()
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
# Überprüfe, ob eine Taste oder Maustaste gedrückt gehalten wird
|
||||
if Input.is_action_pressed("ui_accept") or Input.is_action_pressed("ui_accept"):
|
||||
if get_time_since_last_click() <= double_click_time:
|
||||
_show_full_text()
|
||||
else:
|
||||
is_fast_typing = true
|
||||
else:
|
||||
is_fast_typing = false
|
||||
func _initialize_menu():
|
||||
button = $VBoxContainer/BackToMenu
|
||||
_update_button_visibility()
|
||||
_blink_current_button()
|
||||
|
||||
typing_speed = fast_typing_speed if is_fast_typing else 0.05
|
||||
func _update_button_visibility():
|
||||
var hbox_container = button
|
||||
var label_node = hbox_container.get_child(0)
|
||||
if label_node != null:
|
||||
label_node.visible
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not is_typing:
|
||||
if Input.is_action_pressed("ui_accept"):
|
||||
typing_speed = fast_typing_speed
|
||||
|
||||
func _blink_current_button() -> void:
|
||||
while true:
|
||||
var hbox_container = button
|
||||
var label_node = hbox_container.get_child(0)
|
||||
if label_node != null:
|
||||
label_node.visible = true
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
if label_node != null:
|
||||
label_node.visible = false
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if is_typing:
|
||||
if event is InputEventKey and event.is_pressed():
|
||||
if get_time_since_last_click() <= double_click_time:
|
||||
_show_full_text()
|
||||
else:
|
||||
typing_speed = fast_typing_speed
|
||||
elif event is InputEventKey and not event.is_pressed():
|
||||
typing_speed = 0.05
|
||||
else:
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
button.get_child(1).emit_signal("pressed")
|
||||
|
||||
func _start_typing() -> void:
|
||||
current_text = ""
|
||||
char_index = 0
|
||||
is_typing = true
|
||||
_update_text()
|
||||
|
||||
func _update_text() -> void:
|
||||
|
@ -46,6 +77,7 @@ func _update_text() -> void:
|
|||
await get_tree().create_timer(typing_speed).timeout
|
||||
_update_text()
|
||||
else:
|
||||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
func _show_menu_options() -> void:
|
||||
|
@ -58,6 +90,7 @@ func _show_full_text() -> void:
|
|||
current_text = credits_text
|
||||
$VBoxContainer/Label.text = current_text
|
||||
char_index = credits_text.length()
|
||||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
func get_time_since_last_click() -> float:
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
extends Control
|
||||
|
||||
var display_text = """
|
||||
SYSTEM INITIALIZATION...
|
||||
---------------------------------------
|
||||
PLACEHOLDER GAME NAME BOOT SEQUENCE
|
||||
COPYRIGHT PLACEHOLDER
|
||||
STARTING Infiltrate.exe ...
|
||||
MADE FOR GMTK GAME JAM 2024
|
||||
---------------------------------------
|
||||
|
||||
>> WARNING:
|
||||
>> RECOMMENDED ACTION:
|
||||
>> SECURITY PROTOCOLS: ACTIVE
|
||||
>> SCANNING FOR THREATS...
|
||||
|
||||
>> WARNING: UNAUTHORIZED ACCESS DETECTED
|
||||
>> INITIALIZING COUNTERMEASURES...
|
||||
|
||||
SYSTEM READY.
|
||||
PRESS START TO GET ACCESS.
|
||||
|
||||
"""
|
||||
|
@ -21,28 +21,71 @@ var typing_speed = 0.05
|
|||
var fast_typing_speed = 0.0001
|
||||
var last_click_time = 0.0
|
||||
var double_click_time = 0.3
|
||||
var is_typing = true
|
||||
var current_button_index = 0
|
||||
var buttons = []
|
||||
|
||||
func _ready():
|
||||
for hbox in $VBoxContainer/Buttons.get_children():
|
||||
hbox.visible = false
|
||||
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
_initialize_menu()
|
||||
_start_typing()
|
||||
|
||||
func _initialize_menu():
|
||||
buttons = $VBoxContainer/Buttons.get_children()
|
||||
_update_button_visibility()
|
||||
_blink_current_button()
|
||||
|
||||
func _update_button_visibility():
|
||||
for i in range(len(buttons)):
|
||||
var hbox_container = buttons[i]
|
||||
var label_node = hbox_container.get_child(0)
|
||||
if label_node != null:
|
||||
label_node.visible = (i == current_button_index)
|
||||
|
||||
func _blink_current_button() -> void:
|
||||
while true:
|
||||
var hbox_container = buttons[current_button_index]
|
||||
var label_node = hbox_container.get_child(0)
|
||||
if label_node != null:
|
||||
label_node.visible = true
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
if label_node != null:
|
||||
label_node.visible = false
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("ui_accept") or event is InputEventMouseButton:
|
||||
if get_time_since_last_click() <= double_click_time:
|
||||
_show_full_text()
|
||||
else:
|
||||
typing_speed = fast_typing_speed
|
||||
if is_typing:
|
||||
if event is InputEventKey and event.is_pressed():
|
||||
if get_time_since_last_click() <= double_click_time:
|
||||
_show_full_text()
|
||||
else:
|
||||
typing_speed = fast_typing_speed
|
||||
elif event is InputEventKey and not event.is_pressed():
|
||||
typing_speed = 0.05
|
||||
else:
|
||||
typing_speed = 0.05
|
||||
if event.is_action_pressed("ui_down") or event.is_action_pressed("down"):
|
||||
current_button_index = (current_button_index + 1) % buttons.size()
|
||||
_update_button_visibility()
|
||||
elif event.is_action_pressed("ui_up") or event.is_action_pressed("up"):
|
||||
current_button_index = (current_button_index - 1 + buttons.size()) % buttons.size()
|
||||
_update_button_visibility()
|
||||
elif event.is_action_pressed("ui_accept"):
|
||||
buttons[current_button_index].get_child(1).emit_signal("pressed")
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
pass # typing_speed = 0.05 # Zurück zur normalen Geschwindigkeit
|
||||
if not is_typing:
|
||||
if Input.is_action_pressed("ui_accept"):
|
||||
typing_speed = fast_typing_speed
|
||||
|
||||
func _start_typing() -> void:
|
||||
current_text = ""
|
||||
char_index = 0
|
||||
is_typing = true
|
||||
_update_text()
|
||||
|
||||
func _update_text() -> void:
|
||||
|
@ -53,6 +96,7 @@ func _update_text() -> void:
|
|||
await get_tree().create_timer(typing_speed).timeout
|
||||
_update_text()
|
||||
else:
|
||||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
func _show_menu_options() -> void:
|
||||
|
@ -63,6 +107,7 @@ func _show_full_text() -> void:
|
|||
current_text = display_text
|
||||
$VBoxContainer/VBoxContainer2/Label.text = current_text
|
||||
char_index = display_text.length()
|
||||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
func get_time_since_last_click() -> float:
|
||||
|
@ -72,12 +117,15 @@ func get_time_since_last_click() -> float:
|
|||
return time_since_last_click
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://levels/level_1.tscn")
|
||||
|
||||
func _on_level_select_pressed():
|
||||
get_tree().change_scene_to_file("res://menu/level_menu/level_select.tscn")
|
||||
|
||||
func _on_credits_button_pressed() -> void:
|
||||
get_tree().change_scene_to_file("res://menu/main_menu/CreditsScene.tscn")
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
$VBoxContainer/VBoxContainer2/Label.text += "\nLogging out!"
|
||||
$VBoxContainer/VBoxContainer2/Label.text += "Logging out!"
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
get_tree().quit()
|
||||
|
|
127
gmtk_2024/scripts/pause_menu_control.gd
Normal file
127
gmtk_2024/scripts/pause_menu_control.gd
Normal file
|
@ -0,0 +1,127 @@
|
|||
extends Control
|
||||
|
||||
var display_text = """
|
||||
PAUSING OPERATION ...
|
||||
---------------------------------------
|
||||
"""
|
||||
|
||||
signal continue_game
|
||||
signal restart_game
|
||||
signal back_to_main_menu
|
||||
|
||||
var current_text = ""
|
||||
var char_index = 0
|
||||
var typing_speed = 0.05
|
||||
var fast_typing_speed = 0.0001
|
||||
var last_click_time = 0.0
|
||||
var double_click_time = 0.3
|
||||
var is_typing = true
|
||||
var current_button_index = 0
|
||||
var buttons = []
|
||||
var current_scene = null
|
||||
var pause_menu_node = null
|
||||
|
||||
func _ready():
|
||||
current_scene = get_tree().current_scene
|
||||
|
||||
pause_menu_node = get_parent()
|
||||
|
||||
for hbox in $VBoxContainer/Buttons.get_children():
|
||||
hbox.visible = false
|
||||
|
||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||
_initialize_menu()
|
||||
_start_typing()
|
||||
|
||||
func _initialize_menu():
|
||||
buttons = $VBoxContainer/Buttons.get_children()
|
||||
_update_button_visibility()
|
||||
|
||||
func _update_button_visibility():
|
||||
for i in range(len(buttons)):
|
||||
var hbox_container = buttons[i]
|
||||
var label_node = hbox_container.get_child(0)
|
||||
if label_node != null:
|
||||
label_node.visible = (i == current_button_index)
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if is_typing:
|
||||
if event is InputEventKey and event.is_pressed():
|
||||
if get_time_since_last_click() <= double_click_time:
|
||||
_show_full_text()
|
||||
else:
|
||||
typing_speed = fast_typing_speed
|
||||
elif event is InputEventKey and not event.is_pressed():
|
||||
typing_speed = 0.05
|
||||
#else:
|
||||
#if event.is_action_pressed("pause"):
|
||||
#toggle_pause_menu()
|
||||
|
||||
if event.is_action_pressed("ui_down"):
|
||||
navigate_menu(1)
|
||||
elif event.is_action_pressed("ui_up"):
|
||||
navigate_menu(-1)
|
||||
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
buttons[current_button_index].get_child(1).emit_signal("pressed")
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if not is_typing and Input.is_action_pressed("ui_accept"):
|
||||
typing_speed = fast_typing_speed
|
||||
|
||||
func _start_typing() -> void:
|
||||
current_text = ""
|
||||
char_index = 0
|
||||
is_typing = true
|
||||
_update_text()
|
||||
|
||||
func _update_text() -> void:
|
||||
if char_index < display_text.length():
|
||||
current_text += display_text[char_index]
|
||||
$VBoxContainer/VBoxContainer2/Label.text = current_text
|
||||
char_index += 1
|
||||
await get_tree().create_timer(typing_speed).timeout
|
||||
_update_text()
|
||||
else:
|
||||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
func _show_menu_options() -> void:
|
||||
for hbox in $VBoxContainer/Buttons.get_children():
|
||||
hbox.visible = true
|
||||
grab_focus()
|
||||
|
||||
func _show_full_text() -> void:
|
||||
current_text = display_text
|
||||
$VBoxContainer/VBoxContainer2/Label.text = current_text
|
||||
char_index = display_text.length()
|
||||
is_typing = false
|
||||
_show_menu_options()
|
||||
|
||||
func get_time_since_last_click() -> float:
|
||||
var current_time = Time.get_ticks_msec() / 1000.0
|
||||
var time_since_last_click = current_time - last_click_time
|
||||
last_click_time = current_time
|
||||
return time_since_last_click
|
||||
|
||||
func toggle_pause_menu():
|
||||
if pause_menu_node.visible:
|
||||
_on_continue_button_pressed()
|
||||
else:
|
||||
pause_menu_node.visible = true
|
||||
get_tree().paused = true
|
||||
grab_focus()
|
||||
|
||||
func _on_continue_button_pressed():
|
||||
pause_menu_node.visible = false
|
||||
get_tree().paused = false
|
||||
|
||||
func _on_restart_button_pressed():
|
||||
emit_signal("restart_game")
|
||||
|
||||
func _on_back_to_main_menu_button_pressed():
|
||||
emit_signal("back_to_main_menu")
|
||||
|
||||
func navigate_menu(direction: int) -> void:
|
||||
current_button_index = (current_button_index + direction + buttons.size()) % buttons.size()
|
||||
_update_button_visibility()
|
|
@ -27,7 +27,7 @@ var cursor_scale_down = preload("res://textures/cursor_scale_down.png")
|
|||
func _ready():
|
||||
data_link = $data_link
|
||||
|
||||
func _unhandled_input(event):
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("click"):
|
||||
var nearest_block = find_nearest_block()
|
||||
if nearest_block:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue