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 / Now this is wierd @_@ (correct forum this time! XD)

Author
Message
deathbringer
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 1st Mar 2003 02:03
position object 1,100,100,0
position object 2,0,0,0

This produces objects which are in the same position, insanity-but true
so, how do i make the objects of my game position themselves properly, or how do i generate random numbers in the range -100 to 100?
andrew11
21
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 1st Mar 2003 03:34
To generate random numbers, use the RND() command.



The range value is the difference of the greatest number and the smallest number.

To generate a number from -100 to 100 use:



"All programmers are playwrights and all computers are lousy actors."
-Anon.
Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 1st Mar 2003 14:38
deathbringer - I'm not sure what you mean by producing 2 objects in the same location - because it certainly doesn't. It would be insanity if it was true, but it's not.

Look at the following code



If your statement was true you should see nothing but a cube (because it would eclipse the sphere). But you don't. Uncomment the position object command to see what I mean.

Are you sure you had the autocam off? If not it will follow the objects as they are created. Using "position object x,100..." is a VERY large area.. 100 3D units is quite some distance apart.. enough that you'd not see them both on-screen at the same time (depending on object size). Try smaller values or larger objects.

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
deathbringer
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 1st Mar 2003 15:05
I'll take a screenshot of it if you like, and of the exact code, and yes autocam is off..but first im gonna try the random number thingy XD

Richard Davey
Retired Moderator
22
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 1st Mar 2003 15:48
Never mind a screen shot, that won't show me anything - post the code here. It can't be that long?

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
deathbringer
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 1st Mar 2003 17:12
THAT problem is now sorted, but its created a new one which i REALLY dont understand, here is the ENTIRE code of the game:



The problem being the loop to move the ship becomes locked and doesnt work, ive tried subroutines (which you can see here), shifting the code around, putting it all in the same loop..i can only get one section to work at once!

Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 1st Mar 2003 17:30
The problem is you have the movement controls for the ship and the movement controls for the astroid in different loops, so only one works at the same time. Join them in the one loop, and before you try to create another asteroid when the current one is out of the screen, delete the current one.

Whatever I did I didn't do it!
deathbringer
21
Years of Service
User Offline
Joined: 27th Jan 2003
Location:
Posted: 1st Mar 2003 17:46
ahh, i knew i should be deleting something LOL /me idiot

Login to post a reply

Server time is: 2024-11-24 04:36:26
Your offset time is: 2024-11-24 04:36:26