It works wonderfully. Much appreciated.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote
if (draw_grid() == 100) {
grid_active = false;
Display("GAME OVER");
}
Quote from: Bearstonaut on Sat 28/05/2011 18:13:24
Hi experts.
I'm at the finish line for a 6-month 40-room project, and one of my final puzzles will be a recreation of the classic game "Think-A-Dot". I was very excited at how well it was going, but hit an outcome I cannot explain and need a fresh set of eyes.
To see what Think-A-Dot looks like, check out this recreation here:
http://scratch.mit.edu/projects/kevin_and_abe/48878
or
http://www.webster.edu/~lovedo/thinkadot/think_a_dot.html
The premise is simple enough. Think-a-Dot has an upright frame with three openings at the top, into which you can drop a marble. The marble travels through and drops out the bottom. There are eight dots on the front of the frame, in rows of three, two, and three, and they are yellow or blue. They indicate the state of a flip-flop gate inside the frame. If a marble reaches a gate, it is deflected either left or right depending on the state of the gate, and as the marble passes, the gate will flip over to the other state.
In my game, the gates are marked A1, A2, A3 in the first row. B1 and B2 in the second row. C1, C2 and C3 in the third row. The marble drop positions are labelled Drop1, Drop2 and Drop3 respectively.
If the gate is colored BLUE or Graphic 443, the marble is to go left.
If the gate is colored YELLOW or Graphic 444, the marble is to go right.
Now I started to code the possible outcomes for a marble being dropped in the first slot position as follows...
function Drop1_Interact()
{
if (A1.Graphic==443){
A1.Graphic=444;
if (C1.Graphic==443){
C1.Graphic=444;}
else if (C1.Graphic==444){
C1.Graphic=443;}
}
else if (A1.Graphic==444){
A1.Graphic=443;
if (B1.Graphic==443){
B1.Graphic=444;
if (C1.Graphic==443){
C1.Graphic=444;}
else if (C1.Graphic==444){
C1.Graphic=443;}
}
else if (B1.Graphic==444){
B1.Graphic=443;
if (C2.Graphic==443){
C2.Graphic=444;}
else if (C2.Graphic==444){
C2.Graphic=443;}
}
}
}
The game initializes with all of the buttons BLUE. Now, I would have thought that dropping the marble in Drop1 would have an outcome of A1 and C1 turning YELLOW. In practice, however, which this code, A1 and C1 stay BLUE and B1 turns yellow.
I am wracking my brain to see where this code goes wrong. Do any of you have any bright ideas? If any of this is unclear, let me know and I'll try to provide more information.
Thank you, in advance.
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.068 seconds with 14 queries.