Time Trial Pizza Pursuit in Verse
Time Trial: Pizza Pursuit is a single-player game, where the goal is to pick up pizzas and deliver them to the designated delivery zone before the time runs out. Each successful delivery adds time to the countdown.
After each pizza pickup, a difficulty meter, called the pickup level in this example, increases. Pickup zones are tagged with their pickup level, and each new pickup zone is selected from the available pickup zones for the current pickup level.
Higher-level pickups should be harder to reach, but give more points to the player.
After a delivery, the pickup level resets.
This tutorial is a step-by-step guide on how to create this game using Verse.
Verse Language Features Used
- loop: This example uses the
loopexpression to repeat the selection of pickup and delivery zones, and loop the core gameplay. - race: The
raceexpression runs the pickup / delivery loop and stops the loop when the time runs out. Araceexpression executes multiple expressions at the same time and cancels any expression that doesn’t finish first. - spawn: A
spawnexpression starts an asynchronous expression in any context. - option: The
optiontype can contain one value or can be empty. - defer: The
deferexpression delays the execution of code until the current scope exits. - block: This example uses the
blockexpression to execute code sequentially in an asynchronous context, theraceexpression. - if: The
ifexpression tests conditions and accesses values that might fail. - class: This example creates a Verse class for managing and displaying the player’s score.
- constructor: A constructor is a special function that creates an instance of the class that it’s associated with.
- Access specifiers: You can use access specifiers to set the access level of your code.
You're reading a preview
The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.
Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.