Stating to polish the time travel levels...

This commit is contained in:
Sebastian Morr 2020-10-29 15:55:10 +01:00
parent cb7742466b
commit eb4f46e52f
12 changed files with 209 additions and 82 deletions

View file

@ -114,11 +114,13 @@ func dropped_on(other):
func try_play(full_command):
if game.energy >= energy:
var terminal = $"../../../..".terminal
terminal.send_command(full_command)
#yield(terminal, "command_done")
$PlaySound.play()
var particles = preload("res://scenes/card_particles.tscn").instance()
particles.position = position
get_parent().add_child(particles)
$"../../../..".terminal.send_command(full_command)
buuurn()
game.energy -= energy
else:

View file

@ -20,7 +20,7 @@ func load(path):
title = config.get("title", slug)
description = config.get("description", "(no description)")
congrats = config.get("congrats", "Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next Level'.")
congrats = config.get("congrats", "Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next level'.")
cards = Array(config.get("cards", "checkout commit-auto merge rebase rebase-interactive reset-hard cherry-pick").split(" "))
var keys = config.keys()
@ -53,7 +53,7 @@ func load(path):
elif dir.file_exists(path+"/description"):
# This is an old-style level.
description = helpers.read_file(path+"/description", "(no description)")
congrats = helpers.read_file(path+"/congrats", "Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next Level'.")
congrats = helpers.read_file(path+"/congrats", "Good job, you solved the level!\n\nFeel free to try a few more things or click 'Next level'.")
var yours = LevelRepo.new()
yours.setup_commands = helpers.read_file(path+"/start", "")

View file

@ -129,13 +129,13 @@ __meta__ = {
[node name="NextLevelButton" type="Button" parent="Rows/Columns/RightSide/LevelInfo/Menu"]
margin_left = 406.0
margin_right = 516.0
margin_right = 511.0
margin_bottom = 35.0
focus_mode = 0
custom_styles/hover = SubResource( 1 )
custom_styles/normal = ExtResource( 4 )
enabled_focus_mode = 0
text = "Next Level"
text = "Next level"
__meta__ = {
"_edit_use_anchors_": false
}
@ -193,7 +193,7 @@ margin_right = 633.0
margin_bottom = 782.0
size_flags_vertical = 3
size_flags_stretch_ratio = 0.75
title = "Working directory"
title = "Current environment"
[node name="Controls" type="HBoxContainer" parent="Rows"]
margin_top = 790.0

View file

@ -46,14 +46,14 @@ func apply_forces():
var offset = Vector2(-80, 0)
for c in children.keys():
if type == "ref" or type == "head":
offset = Vector2(0, 80)
# if type == "ref" or type == "head":
# offset = Vector2(0, 80)
if repository.objects.has(c):
var other = repository.objects[c]
if other.visible:
var d = other.position.distance_to(position+offset)
var dir = (other.position - (position+offset)).normalized()
var f = (d*0.12)
var f = (d*0.06)
position += dir*f
other.position -= dir*f