How to do a roulette?

Hi guys, We are from Germany and we are doing a project in our Informatic class, I need a little help on one part of our project :,)

We want to create a game where every player (3 players) chose a color (3 colors) of the roulette and the roulette spins, so at the end one of the color is given. So the roulette has basically 6 layers (2 layers for every color).

Which commands do I need for that? (And We also did not find out how we make the roulette spin)
We already have a designed roulette!

You can break this project up into four parts:

  1. User input and storing of choices
  2. Displaying a spinning roulette wheel
  3. Random selection of a number
  4. Checking if selection matches choices and notifying player(s)

It’s a lot to ask how to do all of this. Which parts have you completed and which ones do you need help with? Have you searched the forums, Google and YouTube for these topics? There are many examples of how to randomize choices.

It’s best to provide what you have made so far (screenshots or project link) and ask specific questions.

Thank you for your answer!!
We already have the wheel designed and the buttons. We do not know how to let it spin and stop after a random amount of time.
the question is how can we let a picture spin and give out random results.
we would be really thankfull for an anwser
greetings
informatics 101 from Berlin city

It’s not possible to rotate components yet.

There are no blocks to do that.

However you can try and use an iframe to load a html file with the spinner and the colors etc. And make it spin from there.

1 Like

If you have an overhead view of the roulette wheel and the sprite’s image is circular, then you can rotate the sprite a small amount (such as 1 degree) by setting the sprite’s direction to the sprite’s direction + 1. See these blocks:

And repeat that a random number of times. You’ll want to set a minimum and maximum number of times and you may have to adjust the angular velocity. For example, you wouldn’t want to turn the sprite 4 degrees (random set to 4, turn 1 degree) because it wouldn’t really be noticeable and it wouldn’t be a good visual effect. So maybe start with number >=360.

If you have an arrow or line or other indicator pointing to one part of the circle, then when the sprite stops turning, you determine which number on the roulette wheel was chosen based on what lines up with that arrow. And you calculate it by the starting point of the wheel/sprite and how many turns it made.

It’s sort of like this:

2 Likes

Here’s an example of a spinner that decelerates to a random position:

https://x.thunkable.com/copy/f938c606284c5e0ce868b0522ee6e57a

(See the first screen with your username.)

Here’s a GIF (so it won’t be random but you still can see how it looks):

ezgif-4-f047c7bc95

I actually modified the values a little for the GIF:

3 Likes

But you can program it.

Only sprites i didn’t think about that till tatiang brought it up😅

Or are components now possible to rotate aswel?
H as vent been on Thunkable much lately.

1 Like

Thunkable does not provide the transform property dynamically therefore only sprites can rotate.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.