Bust a move type game ?

Blitz3D Forums/Blitz3D Programming/Bust a move type game ?

StOrM3(Posted 2004) [#1]
Does anyone have an example showing how to check whether 3 colored balls are touching each other and if they are, and have other balls hanging on them that are not attatched to any other balls to have them drop off ? Like either puzzle bobble or bust a move type game. I have been racking my brain trying to figure out how to make it work, and can not figure it out. Also how to calculate the correct angle and make the balls bounce off the walls and connect to each other correctly.

If anyone can help with code samples, I would greatly appreciate it.

Thanks


Tracer(Posted 2004) [#2]
Aargh.. now you made me want to play that!

Tracer


WolRon(Posted 2004) [#3]
Can't you just iterate through an array and at each element, check for similar colors in each direction?

Actual playing board:
X X X Y X X
 X X X Y X 
X Z X X Y X
 Z Z X X X [/CODE]could be compressed into an array aligned to the left (zero = invalid space):[code]
XXXYXX
XXXYX0
XZXXYX
ZZXXX0
Then just write code that looks at each element around the current one being checked (you will only ever be checking for elements touching the last one added).
Make sure that your code adjusts for short lines versus long lines. Meaning that if you are looking at the two adjoining spaces above, tehn you must check array elements that are one greater and the same (or one less and the same).

Or perhaps it would be easier to just create a full array that stores all of the empty (can never contain a 'ball') spaces in between.
Actual playing board:
X-X-X-Y-X-X
-X-X-X-Y-X-
X-Z-X-X-Y-X
-Z-Z-X-X-X-[/CODE]could be stored as an array where zeros = invalid spaces:[code]
X0X0X0Y0X0X
0X0X0X0Y0X0
X0Z0X0X0Y0X
0Z0Z0X0X0X0
And then always check 1 over in any direction from the current position. This might actually be easier.

I won't write any code, because by the time I did that, I could just as well make the game myself then :)


StOrM3(Posted 2004) [#4]
these are great to help visualize the problems... but I am not sure how to implement the checks in code.. Can anyone help out here please ?


soja(Posted 2004) [#5]
Maybe you should post what you have and then we can point you in the right direction. If you don't have much of anything, maybe you should start smaller.


Ice9(Posted 2004) [#6]
I was playing that on my palm today. palm gb emulator.