Difference between revisions of "Penalty Shootout"
(Created page with "{| style="width: 1000px;" |- | ==Overview== 600px|center Make a double-player penalty shootout game machine, which can detect whether the bal...") |
|||
Line 45: | Line 45: | ||
==Programming== | ==Programming== | ||
===Required Program Blocks=== | ===Required Program Blocks=== | ||
− | *[[ | + | *[["If-do" program block]] |
− | *[[ | + | *[["Declare as", "variable assignment" program block]] |
− | *[[ | + | *[["Line finder" program block]] |
− | *[[ | + | *[["Println" program block]] |
− | *[[ | + | *[["Calculation" program block]] |
− | *[[ | + | *[["Text" program block]] |
Line 70: | Line 70: | ||
Declare a variable player2 for recording the state of goal 2. | Declare a variable player2 for recording the state of goal 2. | ||
<br> | <br> | ||
− | Display the scores of the two players on computer screen in the format of | + | Display the scores of the two players on computer screen in the format of "score1: score2". |
<br> | <br> | ||
[[File:mixly-ctrl-game ball-code.jpg|600px|center]] | [[File:mixly-ctrl-game ball-code.jpg|600px|center]] |
Latest revision as of 05:38, 8 November 2016
ContentsOverviewMake a double-player penalty shootout game machine, which can detect whether the ball has passed the goal and score.
Module BillModule
Other Equipment
Module SetupSetup
ProgrammingRequired Program Blocks
Programming ThoughtIf the goal 1 found the ball, and there hadn’t been a ball here in the last minute, that will be judged as score (record the score); if the goal 1 hasn’t found the ball, and there had been a ball here in the last minute, that will be judged as the ball passed (score and clear the record); goal 2 is in the same way. Start to Program1. Color LED prepare, and declare a variable and assign a value to it.
2. Judge that the goal 1 has been passed, and score
3. Judge goal 2 has been passed, and score.
Technical Specification
Related Case
FAQ |