Hi guys. I have recently thought of the idea of making a game like Bubble poke, but I need your guys' help. When someone clicks on a color group, I was wondering how the code could check to see if any other colors are touching the bubble that was poked. Thanks for any good suggestions! Personally, I was thinking of a "check snake", where the code just scans the entire matrix like a snake for any touching bubbles. The problem with that is that it would take forever. I was seeing if you guys had any better suggestions. Thanks!
My idea is, when the player picks a bubble, check the 4 adjacent bubbles, and then if any of those are the same color, check the 3 adjacent ones that are around it, and so on and so forth. That way, you aren't checking the entire board.
Pieman7373 wrote:
My idea is, when the player picks a bubble, check the 4 adjacent bubbles, and then if any of those are the same color, check the 3 adjacent ones that are around it, and so on and so forth. That way, you aren't checking the entire board.
That is a good idea. I will try that. Thank you! And if anyone else has any more suggestions then feel free to share your idea!
“Life has no meaning. Each of us has meaning and we bring it to life. It is a waste to be asking the question when you are the answer.”
Check out my youtube channel! https://www.youtube.com/channel/UCyLLc9cff7zmkc0j5rC6-7g
Check out my youtube channel! https://www.youtube.com/channel/UCyLLc9cff7zmkc0j5rC6-7g
c4ooo wrote:
Yea you basically need to implement a flood fill.
Is that what I described? If so, cool, because I didnt know that I knew how to flood fill 😂
I was able to implement a flood fill! The ti-84 plus does it kinda slow, but it works! I am sure that when I translate this source code to C for the CE calculator, it will run much much faster. Here is the flood fill code:
Code:
Code:
If G=105
Then
0→R
Output(8,12,"LOAD.
1→M
[A](K,J)→L
0→[A](K,J)
For(D,1,10
Output(6,13,"
Output(6,12,D
M+R→R
If M>0
Then
0→M
For(A,max(1,K-D),min(8,K+D)
Output(6,15,A
For(B,max(1,J-D),min(10,J+D
Output(7,13,"
Output(7,12,B
If A+1<9
Then
If [A](A+1,B)=0 and [A](A,B)=L
Then
0→[A](A,B)
M+1→M
End
End
If A-1>0
Then
If [A](A-1,B)=0 and [A](A,B)=L
Then
0→[A](A,B)
M+1→M
End
End
If B+1<11
Then
If [A](A,B+1)=0 and [A](A,B)=L
Then
0→[A](A,B
M+1→M
End
End
If B-1>0
Then
If [A](A,B-1)=0 and [A](A,B)=L
Then
0→[A](A,B
M+1→M
End
End
End
End
End
End
“Life has no meaning. Each of us has meaning and we bring it to life. It is a waste to be asking the question when you are the answer.”
Check out my youtube channel! https://www.youtube.com/channel/UCyLLc9cff7zmkc0j5rC6-7g
Check out my youtube channel! https://www.youtube.com/channel/UCyLLc9cff7zmkc0j5rC6-7g
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement