Go Down

Topic: Simon Game programming (Read 1 time) previous topic - next topic

Vincent19

No..just arduino languages. So , win() will only be call once the for loop finish executing in void loop() ?

johncc


No..just arduino languages. So , win() will only be call once the for loop finish executing in void loop() ?


Yes, it will be called after y<WINSTATE becomes false.  WINSTATE is defined as 32 so it appears that the for-loop will loop 32 times.

Vincent19

I am very curious and dont understand for the part if(counter> RESPONSETIME)

How is that ? the counter will increase in every loop, so in every loop it is getting closer to exceed RESPONSETIME isnt ?

johncc

#13
Jan 23, 2013, 04:49 am Last Edit: Jan 23, 2013, 04:52 am by johncc Reason: 1

I am very curious and dont understand for the part if(counter> RESPONSETIME)

How is that ? the counter will increase in every loop, so in every loop it is getting closer to exceed RESPONSETIME isnt ?


Yes.  It looks like the player has something slightly over 3 seconds (RESPONSETIME=3000) to push the buttons in proper sequence, or else he fail().


Vincent19

slightly over 3s ? not less than 3s ?

Go Up