Puzzle Bobble game - need advice
amaso83

Hello

 

I am trying to make a game like Puzzle Bobble (http://www.classicgamesarcade.com/game/21606/puzzle-bobble.html)

 

Do you think I must use Physics plug-in for Wade.js? 

 

If you can give me some advice how to compute collisions I would appreciate.

 

Thank you

1 Comment
Gio

Hi amaso

 

You don't have to use the physics plug-in, but if you do it's going to be easier because it will handle all the collisions for you. Having said that, it's mainly just circle vs circle and circle vs wall collisions, so the maths shouldn't be super-difficult if you wanted to do it yourself. On the other hand, the plug-in is less that $30 and it saves you time, so it's up to you.

 

The balls are laid out on a staggered grid like this:

 

O O O O O O

 O O O O O

O O O O O O

 O O O O O

 

and so on. They bounce off walls, and if they hit another ball, they snap to the nearest available position on that grid (and pop if there are 3 of the same color next to each other).

 

So if you were using the physics plug-in, all you would have to do is something like this (using preCollision events, that are covered in the physics tutorial):

ball.onPreCollision = function(eventData){    if (eventData.object.isBall)    {        // set new ball position on the grid    }};

The bouncing and collision detection will happen automatically, provided that your walls have been created as (static) physics objects.

Post a reply
Add Attachment
Submit Reply
Login to Reply