This site requires JavaScript, please enable it in your browser!
Greenfoot back
Veeb
Veeb wrote ...

2018/11/12

Random Number

Veeb Veeb

2018/11/12

#
I am having a slight conundrum with that i don't know how it to get a random number from 50 to 180. Here's what i have
Actor Objects;
      if(isTouching(Objects.class))setRotation(Greenfoot.getRandomNumber(180));
       move(12);
    
danpost danpost

2018/11/12

#
Veeb wrote...
I am having a slight conundrum with that i don't know how it to get a random number from 50 to 180.
Your range is limited to 131 possibles values. Add 50 to a random (since 50 is the minimum).
Veeb Veeb

2018/11/12

#
so could you show me how to do this?
danpost danpost

2018/11/12

#
Veeb wrote...
so could you show me how to do this?
I basically just told you:
Add 50 to a random
ErnieBoi ErnieBoi

2018/11/15

#
danpost wrote...
Veeb wrote...
so could you show me how to do this?
I basically just told you:
Add 50 to a random

you tell him dan post :) i am ernie

Veeb Veeb

2018/11/19

#
You are Ernie, sorry dan im new to all this!
You need to login to post a reply.