Page 1 of 1

speed of rand

PostPosted: Sun Sep 02, 2007 2:23 pm
by arcreamer
hey guys in my game i have a ball bouncing off of an object at
x=rand(15);
y=rand(15);

so they do bounce off of things but they dont bounce off very fast they bounce off really slow sometimes and fast other times but i want them to bounce off of the objects very fast everytime
how do i do that?

Re: speed of rand

PostPosted: Mon Sep 03, 2007 12:23 am
by makslane
The rand(15) will returns values from 0 to 15.
You can put a min value, like this:

Code: Select all
x = rand(15) + 10;

Re: speed of rand

PostPosted: Mon Sep 03, 2007 12:56 am
by arcreamer
oooh alright thanks man!