Jump to content

  • Log In with Google      Sign In   
  • Create Account


Breakout style game questions


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
3 replies to this topic

#1 Russ[x2]   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 January 2000 - 10:06 AM

Hi all, I''m really just looking for some general info on the creation of a ''Breakout'' style game (you know, the one kinda like pong but with loads of blocks to destroy ). I''ll basically have my tile matrix ([num_tiles_x][num_tiles_y]) kinda thing, representing where the tiles are. But what would be the best collision detection type of routine to be used with such a game? Would it be best to keep track of where the ''ball'' is relative to the tile grid coordinates etc? That''s pretty much it to be honest If anyone has some info on a suitable collision detection approach, or any general tips for a game like this, the info would be appreciated Oh, and one more thing... What is supposed to change the velocities of the ball in these style games? From what I can figure out playing some of them, if the ball hits dead center of the ''racket'' it goes straight up, and any devience to the left or right alters the angle of the balls trajectory left/right respectively. But I''ve also noticed the ball speeding up whilst colliding with bricks etc. Anyway, like I said, any info appreciated, thanks, -- Russ

Sponsor:

#2 mason   Members   -  Reputation: 128

Like
Likes
Like

Posted 08 January 2000 - 12:42 PM

1) Make a function that returns the tile position for a given pixel (ball) position.

2) Every frame, check to make sure the ball isn''t somewhere it shouldn''t be. If it is, kill the tile that its at (using function you wrote in step 1), then deflect the ball''s x and y velocity. I believe TANSTAAFL posted the exact equation in another message a few months ago.

Mason McCuskey
Spin Studios - home of Quaternion, 2000 GDC Indie Games Fest Finalist!
www.spin-studios.com

#3 PoesRaven   Members   -  Reputation: 122

Like
Likes
Like

Posted 08 January 2000 - 03:38 PM

a really simple algorithm for changing ball speed is to invert the speed with
speedx = -speedx;
speedy = -speedy;

#4 SiCrane   Moderators   -  Reputation: 9490

Like
Likes
Like

Posted 08 January 2000 - 08:30 PM

Or if you''re feeling in an OOP mood, you can tell each of your objects its bounding box and then every frame do an intersection test of the ball against every brick. It''s a little computationally expensive, but breakout isn''t going to tax anyone''s system.




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.



PARTNERS