Advertisement

collision

Started by January 07, 2017 11:51 PM
77 comments, last by jpetrie 7 years, 8 months ago

well I have a very simple question.I am making a breakout kind of game. I just need another person's perspective on how to tackle the forthcoming problem. Well I can get the ball to strike a lower brick and turn off that brick and then move the ball off of the top of the screen. What I want is the ball to strike a middle brick and turn off that brick and then move off of the top of the screen. Then I want the same thing to happen to the upper row of bricks.

Im not entirely sure what you are asking.

Perhaps it would be better explained with a diagram? Whenever ive played breakout or a clone, destroying a brick makes the ball bounce back (reflect) in the opposite direction?

Advertisement

well first of all I am using opengl and c++. also I am making a space invaders/breakout game. I am unsure of how to make a diagram on this editor. (Sorry).

Could you describe the problem more clearly?

What exactly do you want to happen, and what is happening instead? Have you not implemented bouncing for the ball yet? As is, your description doesn't make a lot of sense.

If you want to draw a diagram, use graphics software such as MS Paint and attach the image to your post.

- Jason Astle-Adams

ok well I will try to draw a diagram using ms paint

In general, just think of the ball as a separate behaviour and then determine the state of the various bricks relative to the position of the ball. Then it won't matter whether you have the ball bounce back, continue through, teleport elsewhere, or whatever. Because the ball holds the parent behaviour that dictates the brick's. To relocate a brick you just stop rendering the brick in location A and start rendering it in location B. If you want it to animate, just add that animation(s) as an intermission between the de-render and render events.

I'm no expert though, so I'm probably wrong.

- Awl you're base are belong me! -

- I don't know, I'm just a noob -

Advertisement

well I have tried to upload a diagram but I cant seem to figure it out, can you please help me.

well I get the following error. You have exceeded your allotted disk space for attachments.

You can upload your image to an image hosting site and use the img tags to put it into the reply?

can you recommend an image hosting site?

This topic is closed to new replies.

Advertisement