speed of rand

Non-platform specific questions.

speed of rand

Postby arcreamer » Sun Sep 02, 2007 2:23 pm

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?
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score

Re: speed of rand

Postby makslane » Mon Sep 03, 2007 12:23 am

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;
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: speed of rand

Postby arcreamer » Mon Sep 03, 2007 12:56 am

oooh alright thanks man!
arcreamer
 
Posts: 398
Joined: Tue Jul 03, 2007 4:08 pm
Score: 9 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest