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.

3 Dimensional Chat / Arakanoid Modeled from Pong

Author
Message
Jetlag
21
Years of Service
User Offline
Joined: 17th Feb 2004
Location:
Posted: 19th Feb 2004 04:03
Im trying to do an Araknoid game after the Pong tutorial, but my ball keeps going through the paddle! As you can tell I'm a total newbie, so if you have any suggestions I'd be more than glad to take them.

Geeks will one day reign
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 19th Feb 2004 04:10
If Object Collision(Ball,Paddle) > 0
Bounce Code here
ENDIF


We need help! Email us! [email protected]
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th Feb 2004 12:31
I would'nt rely on the built in collision, you'd be better checking for collision through maths. All you need to do is check if the ball is within a bounding box around the bat - then check the last position of the ball to decide what axis to mirror the movement speed on.


Van-B


The nature of Monkey was irrepressible!.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 19th Feb 2004 18:46
Also, if you want to add 'english' to the paddle, you need to track where the ball strikes the paddle and the speed/direction of the paddle. This is what separates the reflex games from the skill games.
--
TAZ

Jetlag
21
Years of Service
User Offline
Joined: 17th Feb 2004
Location:
Posted: 21st Feb 2004 02:14
Heres my code below, its still not working, could you fix it and then ill know my mistake? just make it collide with the paddle and ill be fine, thanks!

Geeks will one day reign
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 21st Feb 2004 07:00 Edited at: 21st Feb 2004 07:07
Oh, there are several problems that will need attention. One of them is that a ball reflects the angle and doesn't turn 180 degrees.
You can use ball angles, but the logic becomes more tricky because you have mirror the angle rather than mutliply the ball's X or Y speed by -1.

I made some tweaks to get it more into a workable state and to keep the ball in motion.
--
TAZ



Jetlag
21
Years of Service
User Offline
Joined: 17th Feb 2004
Location:
Posted: 22nd Feb 2004 00:40
Thanks sooo much, that helped a lot. My next step now is to add collison to the walls, but with the code you gave me i think ill be fine (well i hope so)

If anyone has any info on backgrounds to that would be great. The one problem Im having is that the tutorial works fine, but when i try the command on my own it wont work, and i dont know how to load a file from say My Documents.

Geeks will one day reign
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 22nd Feb 2004 01:32
There are two file naming conventions you can use. Absolute paths and relative paths. With absolute paths you specify everthing from the driver letter on up. This is good for your machine, but paths can vary on other user machines. Relative paths are based on the directory where the program is launched from. They are good for subdirectories off of your install path.

You might be able to use an alias to get to "my documents", but I have not tried that. [Personal preference, I think "my documents" is a sloppy way of doing things.] Another method would be to create a file browser function that would allow the user to navigate the hard drive and find the folder/file.
--
TAZ

Login to post a reply

Server time is: 2025-06-28 23:03:26
Your offset time is: 2025-06-28 23:03:26