Compare commits
No commits in common. "7e712e5468ed2a15242283c4c0cda445d7d501e9" and "bd29a6d9b412f692189a3cf0605f349d2f94786a" have entirely different histories.
7e712e5468
...
bd29a6d9b4
3 changed files with 3 additions and 10 deletions
3
board.gd
3
board.gd
|
|
@ -82,7 +82,6 @@ func do_step():
|
||||||
pieces_diagonal.sort_custom(magnitude_sort)
|
pieces_diagonal.sort_custom(magnitude_sort)
|
||||||
|
|
||||||
if last_tween:
|
if last_tween:
|
||||||
last_tween.custom_step(413)
|
|
||||||
last_tween.kill()
|
last_tween.kill()
|
||||||
var tween := get_tree().create_tween()
|
var tween := get_tree().create_tween()
|
||||||
last_tween = tween
|
last_tween = tween
|
||||||
|
|
@ -94,7 +93,7 @@ func do_step():
|
||||||
|
|
||||||
if pieces_moving.is_empty():
|
if pieces_moving.is_empty():
|
||||||
# no tweens -> invalid -> annoying error message
|
# no tweens -> invalid -> annoying error message
|
||||||
tween.kill()
|
tween.stop()
|
||||||
|
|
||||||
func undo_step() -> Callable:
|
func undo_step() -> Callable:
|
||||||
var undos: Array[Callable] = []
|
var undos: Array[Callable] = []
|
||||||
|
|
|
||||||
5
main.gd
5
main.gd
|
|
@ -38,7 +38,7 @@ var advancing := false
|
||||||
@onready var sounds_undo := audio_stream_randomizer_from_dir("res://sfx/undo")
|
@onready var sounds_undo := audio_stream_randomizer_from_dir("res://sfx/undo")
|
||||||
@onready var sounds_redo := audio_stream_randomizer_from_dir("res://sfx/redo")
|
@onready var sounds_redo := audio_stream_randomizer_from_dir("res://sfx/redo")
|
||||||
|
|
||||||
@export_range(0, 1) var slowmo_speed := 0.2
|
@export_range(0, 1) var slowmo_speed := 0.1
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
advance_level()
|
advance_level()
|
||||||
|
|
@ -52,7 +52,6 @@ func _process(delta: float) -> void:
|
||||||
[time, Engine.get_frames_per_second(), move_hold_time, arrf(move_hold_time)]
|
[time, Engine.get_frames_per_second(), move_hold_time, arrf(move_hold_time)]
|
||||||
var slowmo := Input.is_action_pressed("slowmo");
|
var slowmo := Input.is_action_pressed("slowmo");
|
||||||
$SlowmoIndicator.text = "slowmo" if slowmo else ""
|
$SlowmoIndicator.text = "slowmo" if slowmo else ""
|
||||||
# TODO: only slowmo during rolltime?
|
|
||||||
Engine.time_scale = slowmo_speed if slowmo else 1.0
|
Engine.time_scale = slowmo_speed if slowmo else 1.0
|
||||||
# TODO: this is kinda comically slow BUT STOP WORKING ON THE GAME
|
# TODO: this is kinda comically slow BUT STOP WORKING ON THE GAME
|
||||||
AudioServer.playback_speed_scale = slowmo_speed if slowmo else 1.0
|
AudioServer.playback_speed_scale = slowmo_speed if slowmo else 1.0
|
||||||
|
|
@ -122,7 +121,7 @@ func restart():
|
||||||
func board_step():
|
func board_step():
|
||||||
hist.add_do_method(board.do_step)
|
hist.add_do_method(board.do_step)
|
||||||
hist.add_do_property(self, "time", time+1)
|
hist.add_do_property(self, "time", time+1)
|
||||||
hist.add_undo_property(self, "time", time)
|
hist.add_do_property(self, "time", time+1)
|
||||||
hist.add_undo_method(board.undo_step())
|
hist.add_undo_method(board.undo_step())
|
||||||
|
|
||||||
func step(move: Vector2i):
|
func step(move: Vector2i):
|
||||||
|
|
|
||||||
5
piece.gd
5
piece.gd
|
|
@ -25,13 +25,8 @@ func pos_of_lpos(pos: Vector2i, y := 0.0) -> Vector3:
|
||||||
func target_pos() -> Vector3:
|
func target_pos() -> Vector3:
|
||||||
return pos_of_lpos(lpos, position.y) + Vector3(0.5, 0, 0.5)
|
return pos_of_lpos(lpos, position.y) + Vector3(0.5, 0, 0.5)
|
||||||
|
|
||||||
var last_move_tween: Tween = null
|
|
||||||
func tween_to_target(tween := get_tree().create_tween()):
|
func tween_to_target(tween := get_tree().create_tween()):
|
||||||
if last_move_tween:
|
|
||||||
last_move_tween.custom_step(413)
|
|
||||||
last_move_tween.kill()
|
|
||||||
tween.tween_property(self, "position", target_pos(), anim_time)
|
tween.tween_property(self, "position", target_pos(), anim_time)
|
||||||
last_move_tween = tween
|
|
||||||
|
|
||||||
func lpos_of_pos(pos: Vector3) -> Vector2i:
|
func lpos_of_pos(pos: Vector3) -> Vector2i:
|
||||||
return Vector2i(int(pos.x), int(pos.z))
|
return Vector2i(int(pos.x), int(pos.z))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue