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 / Newvalue commands, driving me nuts!!!

Author
Message
Starsu
21
Years of Service
User Offline
Joined: 13th Dec 2002
Location:
Posted: 8th Feb 2003 02:43
Okey, would someone please explain, in great detail, how the newvalue commands work? Im working on a game similar to Galaxian, and I want the ships to explode into pieces, and the pieces fly in random directions. However, as it is now, they only fly in TWO different directions, however at random speeds (?). Im trying to use the newvalue commands to move them, but Im not entirely sure of how they work, and the manual doesnt explain them too well. Help! Before my head explodes!
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 8th Feb 2003 03:40
I use newvalue codes to move players around.. I dont think there is a way to do it with more than two ways because it is newvalue x and newvalue y, going left and right... Or up and down...

AlamDV, NHL, NHL 2K3....... The best combination ever!
Outcast
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location:
Posted: 8th Feb 2003 04:03
I'm still pretty new, but if you are talking about the newxvalue, newzvalue, newyvalue commands, I think they work like this

given
newxvalue xpos, angle, dist

it gives you a new X position that is rotated about the original x pos at the given distance. In the tutorials, it is used for camera rotations about a 3rd person player object.

Outcast

Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 8th Feb 2003 21:40
Here's an example of how to use new*values
Scorpyo
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 8th Feb 2003 21:41
I think you will be better off by randomizing the objects (or pieces)rotations( xrotation,zrotation and yrotation)and applying a simple move object command afterwards.
The Darthster
22
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 9th Feb 2003 00:40
You use newxvalue to tell you the new x position of the object, and newyvalue to tell you the new y position. These are based on angles and speeds, so for each fragment you want a random angle and a random speed.

Here's an example using an explosion of 10 pixels. I've put the x and y positions, and the angles and speeds into an array.



Note I'm using newzvalue, because it seems to work better for these kind of things.

Once I was but the learner,
now, I am the Master.

Login to post a reply

Server time is: 2024-11-24 01:48:59
Your offset time is: 2024-11-24 01:48:59