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 / 3D Pong Uber-Fail

Author
Message
the sky is hard
16
Years of Service
User Offline
Joined: 31st Oct 2008
Location:
Posted: 31st Oct 2008 18:14 Edited at: 1st Nov 2008 02:24
Hey Guys,

I've only literally just started with DBPro, I'm having to learn it for a group project at uni, so I thought I'd try a nice basic 3D Pong game, but for some reason I can't get the thing to work properly and it is really starting to give me a headache, can someone look over my code and give me some advice? It would be much appreciated.

My problems with this are:

1) I am trying to randomise the angle the ball moves along once it resets to the middle of the screen, but RND() doesnt seem to send it along more than 2 directions. Also, the speed seems to vary, something I cannot get my head around.

2) When moving the paddles, the ball angle is supposed to change if it contacts with the ball, I can't test this too well because the angles the ball moves along are right at the boundary of the paddle movement zone.

3) Again, an issue with RND(), but I am trying to point the ball at a random point on the screen during initialisation but this still goes to the same point everytime.

Once I ran into problems making it myself I did try to use the code from one of the popular 3D pong tutorials on the web (cannot remember who atm) but I still can't get it to work, it most likely is something really simple but once things go belly up I run out of ideas very fast, since I am still learning programming I haven't managed to work out how to best fix things like this once I hit a wall, I just get very agitated .


BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 1st Nov 2008 13:33
NewXangle() / NewYangle() are confusing. You actually need to swap newYangle() to newZangle(), and suddenly everything works nicely.

This system seem to be based on the Y-axis.

the sky is hard
16
Years of Service
User Offline
Joined: 31st Oct 2008
Location:
Posted: 1st Nov 2008 20:02
I was having trouble with the axes from the start... thanks, I really should have picked up on that

Now to fix me some decent collisions

Login to post a reply

Server time is: 2024-11-24 19:54:25
Your offset time is: 2024-11-24 19:54:25