added infinite lives mode

This commit is contained in:
pennyrigate 2023-02-13 02:30:44 -05:00
parent f19a49f6e7
commit ed04bf1c2e
13 changed files with 109 additions and 11 deletions

View file

@ -9,6 +9,7 @@ onready var high_score_any = $HighScoreAny
onready var high_score_100 = $HighScore100
onready var levelarrow_up = $LevelArrowUp
onready var levelarrow_down = $LevelArrowDown
onready var lives_mode_text = $LivesModeText
#Shards
onready var shards = [
$ShardGraphics/Shard,
@ -48,6 +49,14 @@ func _physics_process(delta):
if Input.is_action_just_pressed("jump"):
Game.current_level = current_level
Game.change_map(level.scene)
#Toggle lives mode
if Input.is_action_just_pressed("shoot"):
Game.use_lives = !Game.use_lives
Game.save()
if Game.use_lives:
lives_mode_text.text = "lives are on press z to change this"
else:
lives_mode_text.text = "lives are off press z to change this"
func change_current_shard(amount):
if current_shard + amount != -1 && current_shard + amount != 8: #Check if in range

View file

@ -91,6 +91,14 @@ text = "Collect all coins
"
align = 1
[node name="LivesModeText" type="Label" parent="."]
margin_left = 2.0
margin_top = 176.0
margin_right = 258.0
margin_bottom = 190.0
theme = ExtResource( 1 )
text = "lives are off press z to change this"
[node name="ShardGraphics" type="Node2D" parent="."]
position = Vector2( 0, 7 )