Skip to content

Commit

Permalink
Merge #3 from physics-fix : Bug Fixes and ANGLE Support
Browse files Browse the repository at this point in the history
Bug Fixes and ANGLE Support
  • Loading branch information
etherealxx authored Apr 26, 2024
2 parents 4112e17 + 7008190 commit 08879ba
Show file tree
Hide file tree
Showing 20 changed files with 228 additions and 50 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#### For Godot User
- Clone this repo locally
- Open the project with `Godot 4.2.1`, and then open main scene (`"res://scenes/main.tscn"`)
- Open the project with `Godot 4.2.2`, and then open main scene (`"res://scenes/main.tscn"`)
- Follow the instruction provided there

#### Tips for player
Expand All @@ -44,7 +44,6 @@
- The game won't work on device with vertical (portrait) primary monitor.
- There's a weird bug in certain Windows 10 device, where the black part of the ending sequence is fully transparent, and the bluescreen is half transparent.
- You can run the executable again to launch another game while the game is still running.
- The game will look a bit weird on device with monitor resolution/display height smaller than +-900px
- The song will desync when running the game on low-end device
- The transition between choosing the key and the ending scene may freeze screen recorder (the recording will still going but the recorded video will looks weird). <br/>This can be mitigated by setting `fullscreen_ending` to `off` and `hide_title_on_maximize` to `on`.
- The blue pattern background on the ending scene may look cutted on certain device with higher resolution
Expand Down
2 changes: 1 addition & 1 deletion export_presets.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ runnable=true
dedicated_server=false
custom_features=""
export_filter="exclude"
export_files=PackedStringArray("res://addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension", "res://addons/discord-sdk-gd/nodes/assets/Checked.svg", "res://addons/discord-sdk-gd/nodes/assets/circle.svg", "res://addons/discord-sdk-gd/nodes/assets/Unchecked.svg", "res://addons/discord-sdk-gd/nodes/debug.gd", "res://addons/discord-sdk-gd/nodes/Debug.tscn", "res://addons/discord-sdk-gd/nodes/discord_autoload.gd", "res://addons/discord-sdk-gd/Debug.svg", "res://addons/discord-sdk-gd/example.gd", "res://addons/discord-sdk-gd/logo.png", "res://addons/discord-sdk-gd/Logo_V2_No_Bg.png", "res://addons/discord-sdk-gd/plugin.gd", "res://addons/discord-sdk-gd/restart_window.tscn", "res://addons/script-ide/icon/class.svg", "res://addons/script-ide/icon/constant.svg", "res://addons/script-ide/icon/export.svg", "res://addons/script-ide/icon/func.svg", "res://addons/script-ide/icon/func_get.svg", "res://addons/script-ide/icon/func_set.svg", "res://addons/script-ide/icon/keyword.svg", "res://addons/script-ide/icon/property.svg", "res://addons/script-ide/icon/signal.svg", "res://addons/script-ide/plugin.gd", "res://addons/script-ide/Popup.gd", "res://scripts/autoloads/discordrpc.gd", "res://shaders/test/Blur.gdshader", "res://shaders/test/blurtest.gdshader", "res://shaders/test/change2color_backup.gdshader", "res://shaders/test/change2color_greenexample.gdshader", "res://shaders/test/gaussianblur.gdshader", "res://shaders/test/simpleblur.gdshader", "res://test/bsod_by ether.png", "res://test/maintest2.gd", "res://test/maintest3.gd", "res://test/maintest3.tscn", "res://test/node2.gd", "res://test/node2.tscn", "res://test/node.tscn", "res://test/orbitingwindow.gd", "res://test/Sprite2D2.gd", "res://test/Sprite2D.gd", "res://test/testbackground.tscn", "res://test/test_2.tscn", "res://scripts/editorscript/toggleaddons.gd")
export_files=PackedStringArray("res://addons/discord-sdk-gd/bin/discord-rpc-gd.gdextension", "res://addons/discord-sdk-gd/nodes/assets/Checked.svg", "res://addons/discord-sdk-gd/nodes/assets/circle.svg", "res://addons/discord-sdk-gd/nodes/assets/Unchecked.svg", "res://addons/discord-sdk-gd/nodes/debug.gd", "res://addons/discord-sdk-gd/nodes/Debug.tscn", "res://addons/discord-sdk-gd/nodes/discord_autoload.gd", "res://addons/discord-sdk-gd/Debug.svg", "res://addons/discord-sdk-gd/example.gd", "res://addons/discord-sdk-gd/logo.png", "res://addons/discord-sdk-gd/Logo_V2_No_Bg.png", "res://addons/discord-sdk-gd/plugin.gd", "res://addons/discord-sdk-gd/restart_window.tscn", "res://addons/script-ide/icon/class.svg", "res://addons/script-ide/icon/constant.svg", "res://addons/script-ide/icon/export.svg", "res://addons/script-ide/icon/func.svg", "res://addons/script-ide/icon/func_get.svg", "res://addons/script-ide/icon/func_set.svg", "res://addons/script-ide/icon/keyword.svg", "res://addons/script-ide/icon/property.svg", "res://addons/script-ide/icon/signal.svg", "res://addons/script-ide/plugin.gd", "res://addons/script-ide/Popup.gd", "res://scripts/autoloads/discordrpc.gd", "res://scripts/editorscript/toggleaddons.gd")
include_filter=""
exclude_filter="*.dll, *.exe, *.zip, *.rar, *.7z, *.pck"
export_path="exports/limbo_keygen.exe"
Expand Down
2 changes: 1 addition & 1 deletion project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ config_version=5

config/name="Keygen"
config/description="focus"
config/version="1.1.3"
config/version="1.2.0"
run/main_scene="res://scenes/main.tscn"
config/use_custom_user_dir=true
config/custom_user_dir_name="limbo-godot"
Expand Down
9 changes: 9 additions & 0 deletions resources/labelsettings/bsod_slboot_smallheight.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://b110sfyaw4ska"]

[ext_resource type="FontFile" uid="uid://cwf8bhunthy7q" path="res://fonts/segoe_slboot.ttf" id="1_3et3b"]

[resource]
line_spacing = 3.09
font = ExtResource("1_3et3b")
font_size = 30
shadow_size = 0
4 changes: 2 additions & 2 deletions scenes/bsod.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

[node name="ReferenceRect" type="ReferenceRect" parent="SixteenbyNine/HBoxContainer"]
[node name="LeftBorderRect" type="ReferenceRect" parent="SixteenbyNine/HBoxContainer"]
custom_minimum_size = Vector2(186, 0)
layout_mode = 2

[node name="VBoxContainer" type="VBoxContainer" parent="SixteenbyNine/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3

[node name="ReferenceRect" type="ReferenceRect" parent="SixteenbyNine/HBoxContainer/VBoxContainer"]
[node name="TopBorderRect" type="ReferenceRect" parent="SixteenbyNine/HBoxContainer/VBoxContainer"]
custom_minimum_size = Vector2(0, 105)
layout_mode = 2

Expand Down
2 changes: 1 addition & 1 deletion scenes/debug/debugwindow.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[node name="debugwindow" type="Window"]
position = Vector2i(5, 36)
size = Vector2i(150, 300)
size = Vector2i(150, 320)
script = ExtResource("1_5hrx3")

[node name="CanvasLayer" type="CanvasLayer" parent="."]
Expand Down
2 changes: 1 addition & 1 deletion scenes/debug/insidedebugwindow.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_bottom = 150.0
offset_bottom = 170.0
grow_horizontal = 2
grow_vertical = 2
9 changes: 8 additions & 1 deletion scenes/insidewindow.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_03hv5")

[node name="Key" type="TextureRect" parent="."]
[node name="Key" type="Sprite2D" parent="."]
material = SubResource("ShaderMaterial_7sq2e")
position = Vector2(75, 75)
texture = ExtResource("1_7hv0t")

[node name="Key_old" type="TextureRect" parent="."]
visible = false
material = SubResource("ShaderMaterial_7sq2e")
layout_mode = 1
anchors_preset = 15
Expand All @@ -32,6 +38,7 @@ grow_horizontal = 2
grow_vertical = 2
pivot_offset = Vector2(75, 75)
texture = ExtResource("1_7hv0t")
expand_mode = 1

[node name="DelayTimer" type="Timer" parent="."]
one_shot = true
3 changes: 3 additions & 0 deletions scenes/keywindow.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ script = ExtResource("1_lq4d8")
[node name="MoveDelay" type="Timer" parent="."]
one_shot = true

[node name="DebugGetPosTimer" type="Timer" parent="."]

[connection signal="timeout" from="MoveDelay" to="." method="_on_move_delay_timeout"]
[connection signal="timeout" from="DebugGetPosTimer" to="." method="_on_debug_get_pos_timer_timeout"]
1 change: 0 additions & 1 deletion scenes/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ title = "Limbo-godot"
initial_position = 1
size = Vector2i(232, 100)
unresizable = true
always_on_top = true
dialog_text = "You picked the WRONG key!"

[node name="ChangeSceneTimer" type="Timer" parent="."]
Expand Down
3 changes: 3 additions & 0 deletions scripts/audioplayer.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const limbomusic = preload("res://assets/musics/isolation_keypart_cut.mp3")
const deathsfx = preload("res://assets/sfx/geometry-dash-death-sound-effect.mp3")
const winsfx = preload("res://assets/sfx/level-complete-geometry-dash.mp3")

func is_playing_limbo_music() -> bool:
return stream == limbomusic

func set_volume(volume): # volume is between 0 and 20. default is 20
set_volume_db(volume - 20)

Expand Down
37 changes: 31 additions & 6 deletions scripts/autoloads/keymanager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@ var mainscene : Node
var ispolling := false
var orbitcenterpos : Vector2i
var correctkeychosen : bool
var checkreducemoves_initiated := false
var reducedwindows_finished := 0
var pollingtimer : Timer

func _ready():
for x in range(8):
readytomove_list.append((true)) # ready to move for the first time

func set_correctkey(keybool):
correctkeychosen = keybool
if pollingtimer:
pollingtimer.queue_free()

func get_main():
mainscene = get_tree().get_root().get_node("Main")
Expand All @@ -22,11 +27,12 @@ func get_main():
func startpolling():
if not ispolling:
ispolling = true
var newtimer = Timer.new()
newtimer.set_wait_time(polling_rate)
add_child(newtimer)
newtimer.timeout.connect(_on_polling)
newtimer.start()
pollingtimer = Timer.new()
pollingtimer.set_wait_time(polling_rate)
add_child(pollingtimer)
pollingtimer.timeout.connect(_on_polling)
VariableKeeper.timerprocesschanger(pollingtimer)
pollingtimer.start()

func donemoving_onewindow():
readytomove_list.append((true))
Expand All @@ -35,7 +41,8 @@ func movelist_checksize():
return readytomove_list.size()

func is_allwindow_moved():
if movelist_checksize() in [8, 16]: return true # 8 windows
if movelist_checksize() % 8 == 0 and movelist_checksize() > 0: # multiple of 8
return true # 8 windows
else: return false

func allwindow_moving():
Expand All @@ -56,3 +63,21 @@ func get_orbitcenterpos():

func set_orbitcenterpos(value : Vector2i):
orbitcenterpos = value

#func _exit_tree():
#if pollingtimer:
#pollingtimer.queue_free()

func _physics_process(_delta):
if LimboAudio.is_playing_limbo_music() and not checkreducemoves_initiated:
if LimboAudio.get_playback_position() >= 14.3:
checkreducemoves_initiated = true
print("reducemove request sent")
for window in mainscene.window_list:
window.checkreducemove()

func prepare_finished():
reducedwindows_finished += 1
if reducedwindows_finished >= 8:
for window in mainscene.window_list:
window.finishing_move()
10 changes: 9 additions & 1 deletion scripts/autoloads/variablekeeper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ var winning_wait_time := 3.0
var bluescreen_wait_time := 7.0
var transparent_background := true
var hide_border_on_maximize := true

var physics_process := true
var small_height_resolution := false
var main_saved_values

func checkvar(varname : String) -> bool:
Expand All @@ -22,5 +23,12 @@ func checkvar(varname : String) -> bool:
push_error("Property not found: " + varname)
return truth

func tweenprocesschanger(tween : Tween):
if physics_process:
tween.set_process_mode(Tween.TWEEN_PROCESS_PHYSICS)

func timerprocesschanger(timer : Timer):
if physics_process:
timer.set_timer_process_callback(Timer.TIMER_PROCESS_PHYSICS)
#func config_set_value_from_variable_name(mainnode, configfile, varname):
#configfile.set_value("settings", varname, mainnode.get(varname))
14 changes: 13 additions & 1 deletion scripts/bsod.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,23 @@ extends Control
var percentage := 0

@export var debug := false
@export var debugsmallheight := false

@onready var sixteenbyninecontrol = $SixteenbyNine
@onready var percentlabel = $SixteenbyNine/HBoxContainer/VBoxContainer/HBoxContainer2/percentcomplete
@onready var percenttimer = $PercentTimer
@onready var quittimer = $QuitTimer

var slboot_small = load("res://resources/labelsettings/bsod_slboot_smallheight.tres")

func _ready():
if debugsmallheight or VariableKeeper.small_height_resolution:
$SixteenbyNine/HBoxContainer/LeftBorderRect.set_custom_minimum_size(Vector2(131,0))
$SixteenbyNine/HBoxContainer/VBoxContainer/TopBorderRect.set_custom_minimum_size(Vector2(0,73))
$SixteenbyNine/HBoxContainer/VBoxContainer/frown.get_label_settings().set_font_size(145)
$SixteenbyNine/HBoxContainer/VBoxContainer/HBoxContainer/yourpc.set_label_settings(slboot_small)
$SixteenbyNine/HBoxContainer/VBoxContainer/HBoxContainer2/percentcomplete.set_label_settings(slboot_small)

ProjectSettings.set("display/window/per_pixel_transparency/allowed", false)
get_viewport().set_transparent_background(false)
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
Expand All @@ -20,6 +31,8 @@ func _ready():
else:
pass
currentwindow.set_flag(Window.FLAG_TRANSPARENT, false)
VariableKeeper.timerprocesschanger(quittimer)
VariableKeeper.timerprocesschanger(percenttimer)
quittimer.start(VariableKeeper.bluescreen_wait_time)
await get_tree().create_timer(0.5).timeout
percenttimer.start()
Expand All @@ -30,7 +43,6 @@ func _on_quit_timer_timeout():
func _input(event): # debug
if event.is_action_pressed("quit"):
get_tree().quit()
queue_free()

func _on_percent_timer_timeout():
percentage += randi_range(3, 9)
Expand Down
13 changes: 12 additions & 1 deletion scripts/debug/debugwindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ extends Window
@onready var inside = $CanvasLayer/insidedebugwindow
@onready var mainscript = get_parent()

var text

# Called when the node enters the scene tree for the first time.
func _ready():
var xpos := 5.0
Expand All @@ -20,6 +22,15 @@ func _ready():
newbutton.pressed.connect(func(): debugclick(i))
xpos += 40
i += 1


#text = Label.new()
#inside.add_child(text)
#text.global_position.y = ypos + 40

func debugclick(moveindex):
mainscript.startrandommove(moveindex)

#func _physics_process(delta):
#if text and LimboAudio.is_playing():
#var text_to_display : String = str(roundf(LimboAudio.get_playback_position() * 100) / 100)
#text.set_text(text_to_display)
4 changes: 2 additions & 2 deletions scripts/editorscript/toggleaddons.gd
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func _run():
var configtext
if mode_disableplugin:
disabledconfig.save(disabledaddonsfile_path)
print("Active addons now deactivated. Please reload the project on Project > Reload Current Project")
push_warning("Active addons now deactivated. Please reload the project on Project > Reload Current Project")
else:
projectconfig.load(projectsettingfile_path)
disabledconfig.load(disabledaddonsfile_path)
Expand All @@ -48,7 +48,7 @@ func _run():
projectconfig.set_value(section, key, disabledconfig.get_value(section, key))
disabledconfig.set_value(section, key, null)
disabledconfig.save(disabledaddonsfile_path)
print("Inactive addons now reactivated. Please reload the project on Project > Reload Current Project")
push_warning("Inactive addons now reactivated. Please reload the project on Project > Reload Current Project")

configtext = projectconfig.encode_to_text()
var projectsettingfile = FileAccess.open(projectsettingfile_path, FileAccess.WRITE)
Expand Down
30 changes: 24 additions & 6 deletions scripts/insidewindow.gd
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ var key_colors = [
#func keyshader_set_targetcolor(keyshader : Shader, target: String):
#keyshader.set("shader_parameter/u_color_key", Color(target))
#
#func keyshader_set_replacementcolor(keyshader : Shader, target: String):
#keyshader.set("shader_parameter/u_replacement_color", Color(target))
#
#func keyshader_set_tolerance(keyshader : Shader, tolerance: float):
#keyshader.set("shader_parameter/u_tolerance", tolerance)

func _ready():
key.position = self.size / 2.0
key.material = key.material.duplicate() # make unique

func tween_rotate(degree := 180.0, duration := 0.4):
var tween = create_tween()
VariableKeeper.tweenprocesschanger(tween)
tween.tween_property(key,
"rotation_degrees",
degree,
duration).as_relative().from_current().set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CUBIC)

func queue_rotate(delay : float, degree : float, duration : float):
timer.timeout.connect(_on_timer_delay_finished.bind(degree, duration))
VariableKeeper.timerprocesschanger(timer)
timer.start(delay)

func _on_timer_delay_finished(degree, duration):
Expand All @@ -41,6 +41,21 @@ func desaturize_color(colorcode : String):
new_color.s -= 0.3 # saturation
return new_color

#func click_animation():
#$Key/AnimationPlayer.play("click")

func click_animation():
var tween = create_tween()
VariableKeeper.tweenprocesschanger(tween)
tween.tween_property(key,
"scale",
Vector2(0.8, 0.8), # final value
0.15).set_trans(Tween.TRANS_QUINT) # duration
tween.tween_property(key,
"scale",
Vector2(1.0, 1.0), # final value
0.15).from_current().set_trans(Tween.TRANS_QUINT) # duration

func flash_green():
var keyshader : ShaderMaterial = key.get_material()
keyshader.set_shader_parameter("u_color_key1", Color("ff0006")) # the orange part of the default orange key
Expand All @@ -51,6 +66,7 @@ func flash_green():
keyshader.set_shader_parameter("u_interpolation_factor", 0.0)

var tween = create_tween()
VariableKeeper.tweenprocesschanger(tween)
tween.tween_property(keyshader,
"shader_parameter/u_interpolation_factor",
1.0, # final value
Expand All @@ -64,9 +80,10 @@ func flash_green():
0.0, # final value
0.7) # duration

func _input(event): # debug
if event.is_action_pressed("debugshuffle"): # F key
flash_green()
#func _input(event): # debug
#if event.is_action_pressed("debugshuffle"): # F key
##flash_green()
#click_animation()

func shift_color(index):

Expand All @@ -81,6 +98,7 @@ func shift_color(index):
keyshader.set_shader_parameter("u_interpolation_factor", 0.0)

var tween = create_tween()
VariableKeeper.tweenprocesschanger(tween)
tween.tween_property(keyshader,
"shader_parameter/u_interpolation_factor",
1.0, # final value
Expand Down
Loading

0 comments on commit 08879ba

Please sign in to comment.