mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
Add "title" section to the level format
This commit is contained in:
parent
a457afdadb
commit
41e14be5dd
8 changed files with 15 additions and 1 deletions
|
@ -35,6 +35,8 @@ Wanna build your own level? Great! Here's how to do it:
|
|||
### Level format
|
||||
|
||||
```
|
||||
title = This is the level's title
|
||||
|
||||
[description]
|
||||
|
||||
This text will be shown when the level starts.
|
||||
|
|
2
level.gd
2
level.gd
|
@ -2,6 +2,7 @@ extends Node
|
|||
class_name Level
|
||||
|
||||
var slug
|
||||
var title
|
||||
var description
|
||||
var congrats
|
||||
var repos = {}
|
||||
|
@ -16,6 +17,7 @@ func load(path):
|
|||
# This is a new-style level.
|
||||
var config = helpers.parse(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'.")
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
title = This is the level's title
|
||||
|
||||
[description]
|
||||
|
||||
This text will be shown when the level starts.
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
title = Your first remote
|
||||
|
||||
[description]
|
||||
|
||||
A friend has asked you to help with an essay about hobbies! She has already started to write a list, started tracking it in a Git repository. You can get a copy by typing
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
title = Why Git?
|
||||
|
||||
[description]
|
||||
|
||||
(This chapter is not a complete introduction to Git yet, but it will explain some of the basic concepts to you.)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
title = Looking into the past
|
||||
|
||||
[description]
|
||||
|
||||
You've been working on your essay for a while. But - ughh! Now your cat walks over your keyboard and "helps you", so now it's all messed up again! :/
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
title = A better way
|
||||
|
||||
[description]
|
||||
|
||||
One month later, you're woking on an essay about tardigrades!
|
||||
|
|
2
main.gd
2
main.gd
|
@ -61,7 +61,7 @@ func load_level(level_id):
|
|||
var level = levels.chapters[current_chapter].levels[current_level]
|
||||
level_description.bbcode_text = level.description
|
||||
level_congrats.bbcode_text = level.congrats
|
||||
level_name.text = level.slug
|
||||
level_name.text = level.title
|
||||
|
||||
for r in repositories_node.get_children():
|
||||
r.queue_free()
|
||||
|
|
Loading…
Reference in a new issue