victory indicator, remove done todos
This commit is contained in:
parent
963fffb053
commit
a4f612f33b
5 changed files with 52 additions and 11 deletions
17
main.gd
17
main.gd
|
@ -7,20 +7,22 @@ extends Node3D
|
|||
|
||||
@onready var camera: Camera3D = $Camera
|
||||
@onready var rolltime_indicator: Sprite2D = $RolltimeIndicator
|
||||
@onready var victory_indicator: Sprite2D = $VictoryIndicator
|
||||
|
||||
# TODO: wall that player cannot go through but balls can
|
||||
# (important)
|
||||
# TODO: tutorialize slowmo when things get complicated
|
||||
|
||||
var hist := UndoRedo.new()
|
||||
var board: Board
|
||||
var player: Piece
|
||||
var level_num := -1
|
||||
# TODO: instead of dumb numbered levels, GIVE THEM GOOD NAMES AND MANUALLY ORDER THEM!
|
||||
# TODO: save progress
|
||||
var levels: Array[PackedScene] = [
|
||||
preload("res://level/test_nightmare_mini.tscn"),
|
||||
preload("res://level/player_barrier_01.tscn"),
|
||||
preload("res://level/level_00.tscn"),
|
||||
preload("res://level/level_01.tscn"),
|
||||
]
|
||||
|
||||
# TODO: sun movement takes exactly as much time as all piece movement
|
||||
var time := 0
|
||||
|
||||
var advancing := false
|
||||
|
@ -39,11 +41,9 @@ func _process(delta: float) -> void:
|
|||
$UndoButton.disabled = not hist.has_undo()
|
||||
$RedoButton.disabled = not hist.has_redo()
|
||||
$RestartButton.disabled = not hist.has_undo()
|
||||
# TODO: make this toggleable
|
||||
$Clock.text = "T = %d" % time
|
||||
var slowmo := Input.is_action_pressed("slowmo");
|
||||
$SlowmoIndicator.text = "slowmo" if slowmo else ""
|
||||
# TODO: only slowmo during rolltime?
|
||||
Engine.time_scale = slowmo_speed if slowmo else 1.0
|
||||
# TODO: this is kinda comically slow BUT STOP WORKING ON THE GAME
|
||||
AudioServer.playback_speed_scale = slowmo_speed if slowmo else 1.0
|
||||
|
@ -186,7 +186,10 @@ func advance_level():
|
|||
advancing = true
|
||||
if level_num >= 0:
|
||||
print("level won")
|
||||
await get_tree().create_timer(1).timeout
|
||||
var tween := get_tree().create_tween()
|
||||
tween.tween_property(victory_indicator, "modulate:a", 1, 0.1).set_delay(0.3)
|
||||
tween.tween_callback(func(): victory_indicator.modulate.a = 0).set_delay(0.9)
|
||||
await tween.finished
|
||||
advancing = false
|
||||
$Sun.rotation.y = 0
|
||||
time = 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=15 format=3 uid="uid://lrk2whqxl0w0"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://lrk2whqxl0w0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c707s0tgd88pg" path="res://main.gd" id="1_ig7tw"]
|
||||
[ext_resource type="Texture2D" uid="uid://crahyipmcudoy" path="res://ui/undo.png" id="3_lquwl"]
|
||||
|
@ -6,6 +6,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://cbb1q0usxd6ex" path="res://ui/restart.png" id="5_272bh"]
|
||||
[ext_resource type="Shader" uid="uid://c7e17bwc7nrgt" path="res://ground.gdshader" id="5_lquwl"]
|
||||
[ext_resource type="Texture2D" uid="uid://q6x7t05nx1d1" path="res://ui/rolltime-indicator.png" id="6_7mycd"]
|
||||
[ext_resource type="Texture2D" uid="uid://b8kvn3kumc08s" path="res://ui/victory-indicator.png" id="7_272bh"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_1bvp3"]
|
||||
sky_top_color = Color(0.467272, 0.753409, 0.87431, 1)
|
||||
|
@ -127,6 +128,12 @@ modulate = Color(1, 1, 1, 0)
|
|||
texture = ExtResource("6_7mycd")
|
||||
centered = false
|
||||
|
||||
[node name="VictoryIndicator" type="Sprite2D" parent="."]
|
||||
modulate = Color(0.796078, 0.639216, 0.0627451, 0)
|
||||
z_index = 1
|
||||
texture = ExtResource("7_272bh")
|
||||
centered = false
|
||||
|
||||
[connection signal="pressed" from="UndoButton" to="." method="undo"]
|
||||
[connection signal="pressed" from="RedoButton" to="." method="redo"]
|
||||
[connection signal="pressed" from="RestartButton" to="." method="restart"]
|
||||
|
|
3
piece.gd
3
piece.gd
|
@ -45,8 +45,6 @@ func lpos_of_pos(pos: Vector3) -> Vector2i:
|
|||
var speedometer: Label3D
|
||||
@onready var arrow := get_node_or_null("Arrow") as MeshInstance3D
|
||||
|
||||
# TODO: much, *much* better animation is needed. ESPECIALLY if we're doing slowmo
|
||||
# (we're doing slowmo because it is SICK)
|
||||
func do_step(board: Board, tween: Tween):
|
||||
var move := lvel.clampi(-1, 1)
|
||||
var new_pos := lpos + move
|
||||
|
@ -121,7 +119,6 @@ func do_bump(move: Vector2i, tween := get_tree().create_tween(), bumpee: Piece =
|
|||
tween.tween_callback(func(): lvel_displayed = lvel)
|
||||
tween_to_target(tween, get_parent().anim_time/2)
|
||||
|
||||
# TODO?: maybe fix? maybe the bump should be more complicated?
|
||||
func undo_bump(_move: Vector2i) -> Callable:
|
||||
return func(): pass
|
||||
|
||||
|
|
BIN
ui/victory-indicator.png
Normal file
BIN
ui/victory-indicator.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 12 KiB |
34
ui/victory-indicator.png.import
Normal file
34
ui/victory-indicator.png.import
Normal file
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b8kvn3kumc08s"
|
||||
path="res://.godot/imported/victory-indicator.png-0ab812ac98ddf323315a3cfcc1b177a8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://ui/victory-indicator.png"
|
||||
dest_files=["res://.godot/imported/victory-indicator.png-0ab812ac98ddf323315a3cfcc1b177a8.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
|
Loading…
Reference in a new issue