Bitflinger Games docs

Make it dusk

You'll learn: that a game has many rules, and how to find them.
Time: 5 minutes.

Try itOpen this lesson in the Bitflinger Games app to try it.

The code

func _ready() -> void:
	Variations.set_rule("sky.time", 14.0)

sky.time is the hour of the day, on a 24-hour clock. 14.0 is two in the afternoon. Starter World reads this rule to colour the sky, move the sun and light the lamps.

Change it

Set it to 19.0 for dusk:

	Variations.set_rule("sky.time", 19.0)

Play. The sky turns orange and purple and the lamps start to glow.

Try this

func _ready() -> void:
	Variations.set_rule("sky.time", 19.0)
	Variations.set_rule("player.speed", 14.0)

Which rules are there?

Starter World has these rules. The value is what it starts with.

RuleStarts atWhat it does
player.speed7.0How fast you run
player.jump_height2.6How high one jump goes
player.double_jumptrueWhether you can jump again in the air
world.gravity24.0How fast you fall
world.fall_limit-40.0How far you can fall before you start again
sky.time14.0The hour of the day, from 0 to 24

true is another kind of value. It means yes, and false means no. Try setting player.double_jump to false.

What you learned

Next: When the game says no.