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.

Newcomers DBPro Corner / creating random movement

Author
Message
rudie dudie
20
Years of Service
User Offline
Joined: 5th Mar 2004
Location: uk,blighty,middle earth, you choose
Posted: 11th Apr 2004 22:00
i am trying to make my firis game is a space type shootemup im haveing a great deal of truble getting the ships ive created to move independently they all move dut come to a halt at the edge of the 3d space ive used can anyone help,i was hopeing to have it finshed for ayoung friends birthday and would hate to let him down and being a first timer i think ive bitten off a bit more than i can chew me and my big mouth any help wuold be great

its life jim but not as we know it ?
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 12th Apr 2004 14:20
It would help to see the code. When creating random movement, what i do is pick a random position to move the object to, then move it from its current position to the new (random) position, when it gets there, i pick a new random position for it to go to...

In the beginning, the universe was created...
This made alot of people very angry and it has been widely regarded as a bad idea...
Visit http://redeye.dbspot.com
muscles
20
Years of Service
User Offline
Joined: 12th Apr 2004
Location:
Posted: 14th Apr 2004 01:05
another option is to move the object a set amount of distance, randomly rotate it on all 3 axes, and move it again.
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 14th Apr 2004 01:23
Using the relative turning and movement commands in DBP would make muscles's method pretty easy to implement. And, it would work for 2D games as well if you only rotated on one axis.
--
TAZ

Mr Monkey Man
20
Years of Service
User Offline
Joined: 22nd Feb 2004
Location: UK
Posted: 15th Apr 2004 12:39
Just thought you might want to know that if you are going to be using the rnd() command that you will get the same result everytime you run the game, so you might want to use the randomize() command as well as the rnd() command to make the random movement more random. Read the manual for more information.

*For every problem you come across you gain something from correcting it, I hope.

Login to post a reply

Server time is: 2024-11-26 12:24:29
Your offset time is: 2024-11-26 12:24:29