Need help with coding a mini game!

So I want to create a mini game to one of my story chapters but when I tried doing it, it didn’t work like I planned it to. Can someone tell me how to do a mini game? I really want to have one :slight_smile: Thanks in advance!

Edit:
Here’s pictures of my script. And the problem with it is that when you choose a wrong path and I put goto and then the label name, the characters won’t go to to the same place where they were at the beginning of the mini-game. So if someone could help with that I would be greatful. :smiling_face_with_three_hearts:

1 Like

You’ll have to use a lot of

  • goto
  • redo
  • if, elif, else

And you need to know how to do choices.

Can you give me a rough idea of what the mini-game is about?

Yeah it’s basically a mini game where you need to run away from someone. I wanted there to be a first choice where you either go left or right and then which ever you choose you need to choose again which way to go and then if you choose wrongly you start over.

1 Like

So it would ( probably ) look like something like this

label do_again ( or whatever you want to call it )

MC (animation here)
(Which way do I go?)

choice
Go left {
goto do_again
} Go right {
Rest of script here

What type of mini game are you looking for? I’ve created a rotation puzzle for mine and helped another user with hers.

I’m working on others
Simon say (following a pattern) and a quiz

This is the video of my rotation puzzle

3 Likes

It’s basically a mini game where you need to run away from someone. I wanted there to be a first choice where you either go left or right and then which ever you choose you need to choose again which way to go and then if you choose wrongly you start over.

I’m absolutely blown away by that!!! the coding must’ve been so intensive!

1 Like

So because of branching, every time there’s a choice, it multiplies the pathways you have to code.

So for instance you have the choice of going left or right, going left or right, going left or right, the combinations are: ‘left left left left’ ‘left left left right’ left left right right… etc with 16 different choices to code.

You’re doing it with a choice/label method. But really the challenge there is keeping all your brackets in order and making sure every path has content. If the label isn’t working, it might be because there’s an error? Or else because the whole minigame is already in a choice? (Labels don’t work if they’re within a choice, which is DUMB)

Check your sidebar, does it say something like this:
image

No it doesn’t have any errors on it and the label is before the brackets.

And it has these paths: ‘left left’, ‘left right’, right left’ and ‘right right’ And one of those paths is the correct one. But I just don’t get why when you choose a wrong path and then I put goto label_name and then I expected the characters go to the same positions and to the correct room, where the game started but they just stay at the same place and then the game starts again but it’s in a wrong room. I hope you get what I mean with this. I wish I could put a video of how it works in a wring way but I for some reason can’t. :frowning:

Oh! I can solve that one for you :slight_smile: It’s because your label isn’t where the scene change is. So before you write ‘label get_out_game’ you need to have coding like
‘SCENE NAME (whatever background you’re using)
@CHARACTER stands here
@CHARACTER stands here’

With any overlays you use.
In the previewer, go to where your label is, click ‘spot directing’, then ‘copy stage’ and paste that under your label

Ohhh its that simple? Thanks for the help!

1 Like

Thank you Xx
It took a while but I think that’s mainly because I’m still newish to the coding :slight_smile:

1 Like