Beetle is a turn-based game inspired by the classic dice game where players build a beetle piece by piece. Each player takes turns rolling a dice, and depending on the number rolled, a new part of their beetle appears.
The beetle is built from simple 3D shapes (spheres, capsules, and cylinders) that are added and positioned step by step. The game keeps track of whose turn it is, which parts have already been added, and who wins first.
This project shows how you can use procedures, lists, random numbers, and game rules to build a complete playable game in Flock XR.
Try it out
1. Open Flock XR and go to the Demo menu. 2. Select 🪲 Beetle 3. Press Play. 4. Follow the on-screen instructions to take turns. 5. Roll the dice and watch beetle parts appear. 6. Keep playing until one player completes their beetle and wins 🎉
Explore the code
Open the code and look for these parts:
Beetle builder procedure A procedure that creates beetle parts (body, head, legs, antennae) using basic 3D shapes and positions them correctly. This keeps the code tidy and avoids repeating the same blocks over and over.
Dice roll logic A random number block is used to simulate rolling a dice. The result decides which beetle part should be added next.
Lists of parts Lists are used to: – keep track of beetle parts – store which parts are already visible – control the order parts are added This is how the game knows what can be added next.
Turn system Variables track: – whose turn it is – which player is active – when to switch turns This makes the game work properly for two players.
Win condition The code checks when all required beetle parts have been added. When a beetle is complete, the game shows a winner message.
Remix ideas
Try extending the project with your own ideas:
Change the beetle colours so each player has a different look.
Add sound effects when the dice is rolled or a part appears.
Add a short animation when a beetle part is added.
Show a scoreboard with how many parts each player has.
Change the rules (for example, you must roll a specific number to start).
Turn it into a single-player challenge against the computer.
A similar project you could create
Create your own build-a-creature game: – Replace the beetle with a robot, monster, or vehicle. – Use dice to decide which parts appear. – Build the creature piece by piece using basic shapes.
This same structure could also be used for: – a space ship builder – a snowman builder – a fantasy creature creator