mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-12-20 20:33:11 +01:00
Merge remote-tracking branch 'origin/main' into main
This commit is contained in:
commit
5c69308451
9 changed files with 60 additions and 12 deletions
|
@ -11,6 +11,10 @@ To learn how that works, we need to learn about the "index"! In the index, we ca
|
|||
|
||||
Initially, the index is empty. To make a commit that contains a new file, we need to add it!
|
||||
|
||||
[cli]
|
||||
|
||||
You can use tab completion in the terminal! Start typing a filename, then press the tab key to complete its name. This will often save you some time!
|
||||
|
||||
[setup]
|
||||
|
||||
echo "The candle is burning with a blue flame." > candle
|
||||
|
|
29
levels/intro/cli
Normal file
29
levels/intro/cli
Normal file
|
@ -0,0 +1,29 @@
|
|||
title = The command line
|
||||
cards =
|
||||
|
||||
[description]
|
||||
|
||||
These playing cards are designed to be easy to use and to remember! We'd suggest sticking to them if you don't have a lot of experience with Git!
|
||||
|
||||
[cli]
|
||||
|
||||
But there's another way to interact with Git:
|
||||
|
||||
Try typing `git init` into the black terminal below, and pressing the enter key!
|
||||
|
||||
[setup]
|
||||
|
||||
rm -rf .git
|
||||
|
||||
[win]
|
||||
|
||||
# Initialize the time machine!
|
||||
test -d .git
|
||||
|
||||
[congrats]
|
||||
|
||||
Cool! When you don't use the cards in a level, you'll get a golden sparkling "command line badge"! See it in the top left?
|
||||
|
||||
The command line is pretty powerful! Often, you can use it to solve tasks faster compared to using a graphical interface.
|
||||
|
||||
It's also totally optional in this game. But if you want to learn how to use Git from the command line, we invite you to this challenge! :)
|
|
@ -7,11 +7,7 @@ You've been accepted to time travel school! Yay! It's your first day! Your teach
|
|||
|
||||
"To do anything with a time machine, you first need to initialize it!"
|
||||
|
||||
Drag the blue card up to play it!
|
||||
|
||||
[cli]
|
||||
|
||||
Instead of using the card, you can also type `git init` into the black box below, and press the enter key!
|
||||
Drag that blue card up to play it!
|
||||
|
||||
[setup]
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ To clone the teacher's repo via the command line, you need this command:
|
|||
|
||||
(Don't forget the dot at the end!)
|
||||
|
||||
To go through old commands, you can press arrow up and down. That way, you don't have to type in long commands twice.
|
||||
|
||||
[congrats]
|
||||
|
||||
Welcome to time travel school! :) I'll see you for your first class tomorrow!
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
risky
|
||||
copies
|
||||
init
|
||||
cli
|
||||
commit
|
||||
remote
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
pr
|
||||
gitignore
|
||||
|
|
|
@ -2,6 +2,7 @@ extends TextureRect
|
|||
|
||||
export var active = true setget _set_active
|
||||
export var sparkling = true setget _set_sparkling
|
||||
export var impossible = false setget _set_impossible
|
||||
|
||||
|
||||
func _ready():
|
||||
|
@ -10,12 +11,16 @@ func _ready():
|
|||
func _set_active(new_active):
|
||||
active = new_active
|
||||
if active:
|
||||
self.modulate = Color(1, 1, 1)
|
||||
self.self_modulate = Color(1, 1, 1)
|
||||
else:
|
||||
self.modulate = Color(0.2, 0.2, 0.2)
|
||||
self.self_modulate = Color(0.2, 0.2, 0.2)
|
||||
sparkling = false
|
||||
|
||||
func _set_sparkling(new_sparkling):
|
||||
sparkling = new_sparkling
|
||||
if $Particles2D:
|
||||
$Particles2D.emitting = sparkling
|
||||
|
||||
func _set_impossible(new_impossible):
|
||||
impossible = new_impossible
|
||||
$Nope.visible = impossible
|
||||
|
|
|
@ -43,3 +43,11 @@ z_index = 1
|
|||
amount = 3
|
||||
randomness = 0.34
|
||||
process_material = SubResource( 3 )
|
||||
|
||||
[node name="Nope" type="Line2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2( 22.4111, 18.7121 )
|
||||
scale = Vector2( 1.32773, 1.32773 )
|
||||
points = PoolVector2Array( -16.448, 11.5553, 16.0161, -12.8519 )
|
||||
width = 5.0
|
||||
default_color = Color( 0.0705882, 0.0705882, 0.0705882, 1 )
|
||||
|
|
|
@ -50,8 +50,8 @@ func _process(delta):
|
|||
var length = _hint_client_connection.get_u32()
|
||||
var message = _hint_client_connection.get_string(length)
|
||||
game.notify(message)
|
||||
if game.used_cards:
|
||||
$Menu/CLIBadge.active = false
|
||||
# if game.used_cards:
|
||||
# $Menu/CLIBadge.impossible = true
|
||||
|
||||
# Magic height number to fix a weird rescaling bug that affected
|
||||
# the Rows height.
|
||||
|
@ -67,8 +67,6 @@ func load_level(level_id):
|
|||
level_description.show()
|
||||
game.current_level = level_id
|
||||
game.used_cards = false
|
||||
$Menu/CLIBadge.active = true
|
||||
$Menu/CLIBadge.sparkling = false
|
||||
|
||||
AudioServer.set_bus_mute(AudioServer.get_bus_index("SFX"), true)
|
||||
|
||||
|
@ -78,6 +76,11 @@ func load_level(level_id):
|
|||
level_description.bbcode_text = level.description[0]
|
||||
level_congrats.bbcode_text = level.congrats
|
||||
level_name.text = level.title
|
||||
|
||||
var slug = levels.chapters[game.current_chapter].slug + "/" + level.slug
|
||||
$Menu/CLIBadge.active = slug in game.state["cli_badge"]
|
||||
$Menu/CLIBadge.sparkling = false
|
||||
|
||||
#if levels.chapters[game.current_chapter].levels[game.current_level].cards.size() == 0:
|
||||
# cards.redraw_all_cards()
|
||||
#else:
|
||||
|
@ -184,6 +187,7 @@ func show_win_status(win_states):
|
|||
if not game.used_cards and not slug in game.state["cli_badge"]:
|
||||
game.state["cli_badge"].push_back(slug)
|
||||
game.save_state()
|
||||
$Menu/CLIBadge.active = true
|
||||
$Menu/CLIBadge.sparkling = true
|
||||
|
||||
#func repopulate_levels():
|
||||
|
|
Loading…
Reference in a new issue