Skip to content

Commit

Permalink
Post release tweaks (#39)
Browse files Browse the repository at this point in the history
* level select ckpt

* make credits wait on input before progressing

* level select

* more minor timing tweaks

* lmao

---------

Co-authored-by: nvfp <[email protected]>
  • Loading branch information
this-is-envy and NV-FP authored Apr 25, 2024
1 parent 8a5487a commit 1a7cd4c
Show file tree
Hide file tree
Showing 19 changed files with 649 additions and 23 deletions.
Binary file added art/credits/advance-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/credits/advance-text.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cvc8eatcalsmo"
path="res://.godot/imported/advance-text.png-2860ab76f106ee56dbdf68c243e8be4c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/credits/advance-text.png"
dest_files=["res://.godot/imported/advance-text.png-2860ab76f106ee56dbdf68c243e8be4c.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added art/level-select/level1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/level-select/level1.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://c7ml5hykr5amx"
path="res://.godot/imported/level1.png-83115a2565d38a0265db6941fc29f1f5.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/level-select/level1.png"
dest_files=["res://.godot/imported/level1.png-83115a2565d38a0265db6941fc29f1f5.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added art/level-select/level2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/level-select/level2.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://trrudy114ht6"
path="res://.godot/imported/level2.png-b4a24c12c6ddf84285aab4e8d9ddd1e7.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/level-select/level2.png"
dest_files=["res://.godot/imported/level2.png-b4a24c12c6ddf84285aab4e8d9ddd1e7.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added art/level-select/level3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/level-select/level3.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bp111kmmjtorr"
path="res://.godot/imported/level3.png-667bb2ee1d0a4db03ba1afced9d35ffa.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/level-select/level3.png"
dest_files=["res://.godot/imported/level3.png-667bb2ee1d0a4db03ba1afced9d35ffa.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added art/level-select/level_base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/level-select/level_base.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bhc8xmbvkxs0"
path="res://.godot/imported/level_base.png-74ae8e9c669ccb15b0456c50a340649f.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/level-select/level_base.png"
dest_files=["res://.godot/imported/level_base.png-74ae8e9c669ccb15b0456c50a340649f.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added art/level-select/select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions art/level-select/select.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cm85sh6xrelrn"
path="res://.godot/imported/select.png-e7d7506ebf5d4e7b2d5d37ef0cd826bf.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/level-select/select.png"
dest_files=["res://.godot/imported/select.png-e7d7506ebf5d4e7b2d5d37ef0cd826bf.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
10 changes: 10 additions & 0 deletions nodes/Driver.gd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func _ready():
menu_system.start_game.connect(_game_start)
menu_system.quit_game.connect(_game_exit)
menu_system.show_credits.connect(_game_credits)
menu_system.select_level.connect(_start_level)

func _game_exit():
get_tree().quit()
Expand Down Expand Up @@ -60,6 +61,15 @@ func _game_credits():
return
_curtain_in(_load_credits)

func _start_level(level: int):
if not _can_start:
return
_can_start = false
# have to offset by 1 because the level emitted from the level select signal is 1-indexed
# ...because i'm a doofus
cur_level = level - 1
_curtain_in(_load_level)

# handles button presses so we can filter out spamming the start button
func _game_start():
if not _can_start:
Expand Down
84 changes: 70 additions & 14 deletions nodes/ui/Credits.gd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ signal end_credits

var initial_speed = 175
var speed = 175
var line_height_px = 10
var line_height_px = 9
var _space_color = Color(0, 0.098, 0.157)

@onready var _dlg = $Container/Blacksmith/Dialoge
Expand Down Expand Up @@ -35,22 +35,25 @@ var bart_scr = [
500,
func(): _speak(blurb[0]), # hi
1250,
func(): _speak(blurb[1]), # I'm bart
3750,
func(): _scroll_dlg(3, 1.5),
func(): _speak(blurb[1]), # I'm bart,
2250,
func(): _wait_for(WaitKeypress.ctor('ui_accept')),
func(): _scroll_dlg(5, 2),
func(): _speak(blurb[2]), # Most folks
3500,
func(): _scroll_dlg(5, 2.5),
2000,
func(): _wait_for(WaitKeypress.ctor('ui_accept')),
func(): _scroll_dlg(4, 1.75),
1750,
func(): _speak_clear(),
func(): _speak(blurb[3]), # paid
2750,
func(): _wait_for(WaitKeypress.ctor('ui_accept')),
func(): _speak_clear(),
func(): _speak(blurb[4]),
1000,
func(): _speak(blurb[5]),
2500,
func(): _speak(blurb[6]),
350,
func(): _wait_for(WaitKeypress.ctor('ui_accept')),
func(): _start_camera_move(80),
1500,
func(): _speak_clear(),
Expand All @@ -67,9 +70,9 @@ var bart_scr = [
2250,
func(): _speak_clear(),
func(): _speak(blurb[10]),
250,
600,
func(): _fade_out(_dlg, 1),
1000,
1250,
func(): _set_speed(initial_speed),
func(): _play_out_bart(),
func(): _switch_script(credits_scr)
Expand Down Expand Up @@ -243,17 +246,65 @@ func _done():
pass

var _advance_at = 0

enum BarierType {
TIME,
KEY,
}

class WaitTime:
var tgt
var type

static func ctor(time):
var wt = WaitTime.new()
wt.type = BarierType.TIME
wt.tgt = time
return wt

func can_progress() -> bool:
var now = Time.get_ticks_msec()
return now > tgt

class WaitKeypress:
var was_pressed
var tgt_key
var type

static func ctor(key):
var wk = WaitKeypress.new()
wk.type = BarierType.KEY
wk.was_pressed = false
wk.tgt_key = key
return wk

func check_key():
if Input.is_action_just_pressed(tgt_key):
was_pressed = true

func can_progress() -> bool:
return was_pressed

func _wait_for(new_barrier):
cur_barrier = new_barrier

var cur_barrier

func _process_script():
if frame_pointer >= scr.size():
return
var now = Time.get_ticks_msec()
if now < _advance_at:

if cur_barrier != null and not cur_barrier.can_progress():
return
if cur_barrier != null and cur_barrier.type == BarierType.KEY:
$Container/Blacksmith/Dialoge/Advance.visible = false
cur_barrier = null

var now = Time.get_ticks_msec()
var thing = scr[frame_pointer]
match typeof(thing):
TYPE_INT:
_advance_at = now + thing
_wait_for(WaitTime.ctor(now + thing))
TYPE_CALLABLE:
thing.call()

Expand All @@ -264,7 +315,12 @@ func _process(delta):
if Input.is_action_just_pressed('ui_cancel'):
end_credits.emit()

_process_script()
if cur_barrier != null and cur_barrier.type == BarierType.KEY:
$Container/Blacksmith/Dialoge/Advance.visible = true
cur_barrier.check_key()

_process_script()

if not in_sky:
var vel = _get_velocity()
_blacksmith.position += (delta * vel)
Loading

0 comments on commit 1a7cd4c

Please sign in to comment.