Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbRnd PROBEM :((

Author
Message
Herman Burser
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: caloocan city
Posted: 19th Jan 2012 11:49
i've got a problem on how do i use dbRnd in my 2d game...i was creating a target game ... using 2 image... i want the first object moving horizontaly at RANDOM speed and RANDOM Y axis...that was the target,,, and the 2nd image was only moving upward,,, to ht the target that move randomly.. how do i code that.



this is my code.. how do i code that the balloon was on its random Y axis and random velocity?? it creat random after the if statement granted.
vitinho444
14
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 19th Jan 2012 14:32
The dbRnd() function works like: dbRnd(MAX_SEED);

It will generate a value from 0 to MAX_SEED..

Now use it as you want

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)
Fatal Berserker
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 20th Jan 2012 20:58
if you want to do like -15 to 15 then you do dbRND(30) - 15

vitinho444
14
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 20th Jan 2012 23:50
@fatalberserker
thanks i didn't know that

C++ Medium 3.5/5
www.oryzhon.com <-- My company's website (W.I.P)

Login to post a reply

Server time is: 2024-11-19 04:35:17
Your offset time is: 2024-11-19 04:35:17