Micro:Bit Games

Intro

The game we’re going to make is Split or Steal. It’s a game of cunning and trickery in which the play must decide whether to ‘Split’ the prize or ‘Steal’ from the opponent.

How To

As always, begin by making a new Micro:Bit Project at Micro:Bit MakeCode. Click on ‘New Project” to open up the editor. Name the project ‘Split Or Steal’:

Split Or Steal

Click ‘Create’. Firstly, get a ‘Show String’ block out and put it into the ‘On Start’ block:

Change the text to: < Split Steal > Now, let’s start making the game. Open the ‘Variables’ Menu and click ‘Create Menu’:

Then name the variable as ‘Random’:

Drag the ‘Set Random to’ block into the ‘Forever’ block. Next, go into the ‘Math’ menu and drag out a ‘Random’ block and put it into the ‘Set Variable’ block:

Now go into the ‘Input’ menu and drag out two ‘On Button Pressed’ blocks. change one of these blocks to B. It should look like this:

Put an ‘If, Else’ block into the ‘On Button Pressed’ blocks from the ‘Logic’ Menu. Open the ‘Logic’ menu again and put an ‘=’ block in each of the ‘If, Else’ blocks. It should look like this now:

Open the ‘Variables’ menu and drag a ‘Random’ block into the top of each ‘=’ block on the left. In the remaining space, change the ‘A’ block to 1 and the ‘B’ block to 2.

Now, put 4 ‘Show String’ blocks into the if/else blocks and fill them like so:

Click the ‘Download’ button and follow the instructions. You have finished the project!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.