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.

DarkBASIC Discussion / Collision Problem

Author
Message
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 25th Sep 2009 04:35 Edited at: 25th Sep 2009 05:00
I'm making a Breakout games. Inspired by DarkNoobs . I had the collision working previously, but then deleted the program thinking I would take the project no further. Then I decided to get back into it again and tried the collision again. It works sometimes, but then other times, it will go straight through the brick. Any help is appreciated.

Use the arrows keys to change the speed and direction of the ball.

Download the file and here is the code with a screenshot just incase anyone can't download.

EDIT:

Figured it out nevermind.
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Sep 2009 12:47
Halo pictionaryjr...I`d like to help you...but no code to see...please try again to load it. Cheers

oh my god
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 25th Sep 2009 16:44
He said he figured it out

New Site! Check it out \/
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 28th Sep 2009 05:44
Are you not going to tell us what you did?

TGC Forum - converting error messages into sarcasm since 2002.
pictionaryjr
15
Years of Service
User Offline
Joined: 12th Mar 2009
Location:
Posted: 29th Sep 2009 03:03
Oh. Didn't know anyone cared .

I split the collision into two things. One for checking collision on the top or bottom sides of the ball and another for checking collision on the left and right sides of the ball. I would then determine which direction the ball was going (up or down/left or right) and whatever direction it was going I would check that side of the ball for collision. So if the ball were moving up and to the right. I would check the top and right sides of the ball for collision.

Login to post a reply

Server time is: 2024-05-01 21:04:40
Your offset time is: 2024-05-01 21:04:40