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 / ball bouncing

Author
Message
the madkiller
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 18th Jan 2009 20:22
can anyone point me in the direction of how to make a ball just bounce around the screen.
any code with actual descriptions of what code does what.
im starting to get annoyed .
ive had all kinds of results but the dbpro manual and tutorials dont even cover any of this except loading a bsp world and shooting alien jelly fish.
thanks for any help.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Jan 2009 00:31
Check this out and see if you can figure out how it works. The best way to learn DBPro is to take any simple game codes you can find and change little things until you figure out what does what.



the madkiller
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 19th Jan 2009 10:41
thanks mate
could you break this down into the actual meanings for me.

offset sprite 1,sprite width(1)/2,sprite height(1)/2

i take it the /2 means half,so its setting up the sprite to be half way up and half way across.

so how could i change this to move a 3d ball.
ie object sphere.
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 19th Jan 2009 15:55
Quote: "i take it the /2 means half,so its setting up the sprite to be half way up and half way across."


Yep. Remember that if you have any questions about a specific command, you can click on it and press F1 to see its helpfile.

Here's a version of the 2D one with more comments:



In 3D, it's slightly easier because 3D primitive objects are already positioned at their center. However, you have a new direction to worry about - z, which is the depth of the world.

Here's a 3D example in all 3 dimensions:



the madkiller
16
Years of Service
User Offline
Joined: 22nd May 2008
Location:
Posted: 19th Jan 2009 23:18
ahhh
i think im starting to see it.
thanks bmaczero,this has been a real help.

Login to post a reply

Server time is: 2024-09-28 00:21:31
Your offset time is: 2024-09-28 00:21:31