mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-22 16:20:19 +01:00
Rebuild lion level with 2D objects
This commit is contained in:
parent
61325b7a97
commit
0ba806108f
3 changed files with 57 additions and 16 deletions
|
@ -1,15 +0,0 @@
|
|||
title = Apples
|
||||
cards = checkout commit-auto reset-hard branch-delete
|
||||
|
||||
[description]
|
||||
|
||||
Testlevel for 2d interactive files.
|
||||
|
||||
[setup]
|
||||
|
||||
echo "x = 100
|
||||
y = 50" > apple
|
||||
echo "x = 200
|
||||
y = 50" > pear
|
||||
git add .
|
||||
git commit -m "An apple a day"
|
54
levels/2d/lion
Normal file
54
levels/2d/lion
Normal file
|
@ -0,0 +1,54 @@
|
|||
title = Parallelism
|
||||
cards = checkout commit-auto
|
||||
|
||||
[description]
|
||||
|
||||
Did you know that creating parallel timelines is perfectly legal and safe? It's true!
|
||||
|
||||
Can you find out when things went wrong in this zoo, and create a parallel universe where everyone is happy?
|
||||
|
||||
[setup]
|
||||
|
||||
echo "x = 500
|
||||
y = 100" > lion
|
||||
|
||||
echo "x = 100
|
||||
y = 100" > child
|
||||
git add .
|
||||
git commit -m "The beginning"
|
||||
|
||||
echo "x = 150
|
||||
y = 100" > lollipop
|
||||
git add .
|
||||
git commit -m "The child buys something"
|
||||
|
||||
echo "x = 400
|
||||
y = 100" > child
|
||||
git add .
|
||||
git commit -m "The child climbs somewhere"
|
||||
|
||||
git rm child
|
||||
#echo "Looks happy. :)" > lion
|
||||
git add .
|
||||
git commit -m "Oh no"
|
||||
|
||||
echo "x = 450
|
||||
y = 100" > lion
|
||||
git add .
|
||||
git commit -m "Nap time!"
|
||||
|
||||
git checkout --detach
|
||||
git branch -d main
|
||||
|
||||
[win]
|
||||
|
||||
# Is the child still there, and is the lion not hungry?
|
||||
{ git ls-tree --name-only -r HEAD | grep child; } && { git show HEAD:lollipop | grep "x = 4"; }
|
||||
|
||||
[congrats]
|
||||
|
||||
Whew, good job! This seems like a *much* better outcome.
|
||||
|
||||
Feel free to add more parallel timelines, or make them longer.
|
||||
|
||||
If you're ready, our next mission is already waiting...
|
|
@ -34,9 +34,11 @@ func read_from_file():
|
|||
"index":
|
||||
content = file_browser.shell.run("git show :'%s'" % label)
|
||||
modulate = Color(0, 0, 1.0)
|
||||
$Sprite.scale = Vector2(0.75, 0.75)
|
||||
"head":
|
||||
content = file_browser.shell.run("git show HEAD:'%s'" % label)
|
||||
modulate = Color(0, 0, 0, 0.5)
|
||||
modulate = Color(0, 0, 0, 0.2)
|
||||
$Sprite.scale = Vector2(0.8, 0.8)
|
||||
|
||||
attributes = helpers.parse(content)
|
||||
position.x = int(attributes["x"])
|
||||
|
|
Loading…
Reference in a new issue