Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Breakout Collision (Java Slick2d API)

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 stein102   Members   

556
Like
0Likes
Like

Posted 24 March 2013 - 09:37 PM

I am having a problem with my collision detection on my breakout game. Right now I have my ball, bricks and paddle as Rectangles and a Circle using Slick2d.

 

the code I've been using has just been

 

//Not actual code, just example

If(ball.intersects(brick)){
    ball.reverseVelocityY();
}

But I need to fix it so what when the ball collides with the brick from the side, it reacts accordingly. What should I do for this?






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.