mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +01:00
If there's no player in a level, add one
This commit is contained in:
parent
b91ebe0f36
commit
b5143ec906
2 changed files with 4 additions and 1 deletions
|
@ -134,7 +134,7 @@ func update():
|
|||
#item.position = Vector2(rand_range(0, world.rect_size.x), rand_range(0, world.rect_size.y))
|
||||
#randomize()
|
||||
world.add_child(item)
|
||||
if not player:
|
||||
if file_path == "you":
|
||||
player = item
|
||||
|
||||
FileBrowserMode.COMMIT:
|
||||
|
|
|
@ -101,6 +101,9 @@ func construct():
|
|||
var repo = repos[r]
|
||||
game.global_shell.cd(repo.path)
|
||||
game.global_shell.run(repo.setup_commands)
|
||||
# If there is no player, add one.
|
||||
if game.global_shell.run("test -f you && echo yes || echo no") == "no\n":
|
||||
game.global_shell.run("echo \"x = 200\ny = 200\" > you")
|
||||
|
||||
func check_win():
|
||||
var won = true
|
||||
|
|
Loading…
Reference in a new issue