How to Adjust Random Sprite Rotation with Up and Down Buttons in FlowLab

I’m making a FlowLab game where an electric sprite randomly spins around like a compass needle using random numbers and rotation. I have a working code to do that. However, I want to add two buttons (Up and Down) that can influence the needle’s behavior. When the “Up” button is clicked, the needle should spin to 90 degrees for about 1 second and then return to its randomized rotation, with this 90-degree spin happening less randomly. Conversely, clicking the “Down” button should increase the frequency of the 90-degree spins, making it happen more often. Essentially, the “Up” button makes the 90-degree spin less random, while the “Down” button increases its occurrence. How can I implement this?

Screenshot 2024-07-15 201948

1 Like

create 2 sprites in the user interface. when the up or down button is clicked, or if the user presses up or down. message the compass needle. and the mailbox in compass needle should have two inputs; up and down. up should turn 90 degrees. the other turns -90 degrees.
the one mistake in the “mouse click” does not refer to the keypad. they are totally different.
when you are finished. I want to play on yours please

Yeah I’m using FlowLab for normal Applications and video games for my KC Applications business I’m wanting to start. But I can try and make this app public for you to test.

1 Like

thanks! :slight_smile: cant wait to see it

Hehehe yeah. Also thanks for the help but what I meant was I’m wanting two buttons that adjust how frequently the sprite will rotate 90 degrees. Up meaning not as frequent rotation and Down meaning more frequent.

then instead of -90 degrees, is the 180 or something like that instead

1 Like

Okay I will test it out and see what I can do…

you can get number into add. where if you press up, it will get number in rotation

So each time down is clicked it should make the randomized 90-degree rotation play more often. So maybe it could be an increment of 1, which is what I was thinking. Also, is this code correct? Cause it still won’t randomly rotate the needle…
Screenshot 2024-07-15 214712

it looks like you are putting outputs into “set” but should be into add instead. if you put it to set. it will be put in that specific rotation the number you input it

Yeah, I’m putting it into set and then testing the adjustment thing but it still doesn’t randomly rotate.

have you used random. it should be in logic and math

Okay, do you mean like this? Cause that doesn’t work either.

remove the top random. and the number below 90

Okay so like this then?
Screenshot 2024-07-15 221726

when it is more sensitive, it gets random number positive and add. when you want it less sensitive, get random negative numbers and add

Okay that helps but I’m a little confused on how to do that… Heres my game BTW if you want to check it out. Click Edit on the green thunderbolt to see the code… Flowlab Game Creator - ITC Tools Collection

wait. just cant upload it

The screenshot doesn’t load…

ik. i am trying to insert the picture in