b trouble
Author |
Message |
upthescale
|
Posted: Fri May 26, 2006 10:26 pm Post subject: b trouble |
|
|
I am attempting a bubble trouble and i have the hit detection done, but the ball do4esnt split in to 2, how can i make it so when i hit the ball it divides in to to smaller balls? |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
NikG
|
Posted: Fri May 26, 2006 11:47 pm Post subject: (No subject) |
|
|
Split into two??
Umm... isn't bubble trouble the game where you shoot bubbles from the bottom of the screen and if you get 3+ together above, they disappear (or fall off the screen)?
What do you mean split into two? |
|
|
|
|
 |
TheOneTrueGod

|
Posted: Sat May 27, 2006 1:10 am Post subject: (No subject) |
|
|
Thats bubble bobble Bubble trouble is a pretty rare (At least I had a hard time finding it back in the day) SNES game where you play as a little guy with a gun, and you have to shoot falling bubbles. They start off like twice your size, and split into smaller and smaller ones as you hit them.
Allright, on to helping you. In order to do that, you would need a parallel array (Or a part of a record, or even have it within a class if you decide to try and learn em) that will keep track of how big the corresponding bubble is, and draw the bubble relative to that size. Then, whenever you hit a bubble, create two new bubbles around that bubbles location. This would be extremly easy with classes, but its up to you, you could just initialize all the elements of the parallel array / record. Be sure to do a check to make sure that the ball isn't too small before creating a new one, and be sure to decrease the size of the new ones. |
|
|
|
|
 |
Cervantes

|
Posted: Sat May 27, 2006 7:38 am Post subject: (No subject) |
|
|
The array needs to be of a dynamic size, since the number of bubbles is constantly changing.
For that, you need to use a Flexible Array. You could also do it with a Linked List.
Whatever you do, I strongly urge you to avoid parallel arrays. |
|
|
|
|
 |
|
|