The following is an example of a simple arcade game: 

 

Game Play:

1. The game begins after a user inserts 3 coins to play (the system must store the number of coins inserted after power cycle).

2. Once the game begins, the user needs to try and press a button as many times as possible to obtain the high score (the system must store high score after power cycle). 

3. Throughout game play, the screen will display a countdown timer of the remaining time.

4. When the timer expires, the user is notified of their score and if they have achieved the high score.

5. After the game is over, the user is prompted to play again and insert more coins.

 

Below are two possible examples of how the Control.ini file may look:


Example 1:


1       !tm00:00!vmc1=0# Var1: 0 is pre-gameplay, 1 is gameplay, 2 is post-gameplay

2       !tm00:00!vcc1=1!vcc72=65535!vmc72=0#

3       !i1c!vmc71+1# Var 71: stores the number of coins

4       !vcc1=0!vcc71=0!mmd255:"Insert 3 Coins"#

5       !vcc1=0!vcc71=1!mmd255:"Insert 2 Coins"#

6       !vcc1=0!vcc71=2!mmd255:"Insert 1 Coins"#

7       !vcc1=0!vcc71=3!mmd255:"Lets Play!"#

8       !vcc71>2!vmc1=1# When at least 3 coins have been inserted, start game play

9       !vcc1=1!vmc71-3# Charge player 3 coins to play

10     !vcc1=0!vmc2=0# Zero out the score

11     !vcc1=0!vmc4=69#

12     !t&00:01!vmc4-1#

13     !vcc4=68!vcc1=1!mmd255:"Button Press Game!"#

14     !vcc4=66!vcc1=1!mmd255:"Ready?"#

15     !vcc4=64!vcc1=1!mmd255:"Set?"#

16     !vcc4=62!vcc1=1!mmd255:"Go!"#

17     !vcc4=60!vcc1=1!mmd255:"60 Seconds!"#

18     !vcc4=55!vcc1=1!mmd255:"55 Seconds!"#

19     !vcc4=50!vcc1=1!mmd255:"50 Seconds!"#

20     !vcc4=45!vcc1=1!mmd255:"45 Seconds!"#

21     !vcc4=40!vcc1=1!mmd255:"40 Seconds!"#

22     !vcc4=35!vcc1=1!mmd255:"35 Seconds!"#

23     !vcc4=30!vcc1=1!mmd255:"30 Seconds!"#

24     !vcc4=25!vcc1=1!mmd255:"25 Seconds!"#

25     !vcc4=20!vcc1=1!mmd255:"20 Seconds!"#

26     !vcc4=15!vcc1=1!mmd255:"15 Seconds!"#

27     !vcc4=10!vcc1=1!mmd255:"10 Seconds!"#

28     !vcc4=5!vcc1=1!mmd255:"05 Seconds!"#

29     !vcc4=1!vcc1=1!mmd250:"Time is Up!"#

30     !i2c!vcc1=1!vmc2+1#

31     !vcc4=1!vmc1=2# Post-gameplay mode

32     !vcc1=1!vmc5=16#

33     !t&00:01!vmc5-1#

34     !vcc5=15!vcc1=2!vcc2=0!mmd255:"Score: 0!"#

35     !vcc5=15!vcc1=2!vcc2=1!mmd255:"Score: 1!"#

36     !vcc5=15!vcc1=2!vcc2=2!mmd255:"Score: 2!"#

37     !vcc5=15!vcc1=2!vcc2=3!mmd255:"Score: 3!"#

38     !vcc5=15!vcc1=2!vcc2=4!mmd255:"Score: 4!"#

39     !vcc5=15!vcc1=2!vcc2=5!mmd255:"Score: 5!"#

40     !vcc5=15!vcc1=2!vcc2=6!mmd255:"Score: 6!"#

41     !vcc5=15!vcc1=2!vcc2=7!mmd255:"Score: 7!"#

42     !vcc5=15!vcc1=2!vcc2=8!mmd255:"Score: 8!"#

43     !vcc5=15!vcc1=2!vcc2=9!mmd255:"Score: 9!"#

44     !vcc5=15!vcc1=2!vcc2=10!mmd255:"Score: 10!"#

45     !vcc5=15!vcc1=2!vcc2=11!mmd255:"Score: 11!"#

46     !vcc5=15!vcc1=2!vcc2=12!mmd255:"Score: 12!"#

47     !vcc5=15!vcc1=2!vcc2=13!mmd255:"Score: 13!"#

48     !vcc5=15!vcc1=2!vcc2=14!mmd255:"Score: 14!"#

49     !vcc5=15!vcc1=2!vcc2=15!mmd255:"Score: 15!"#

50     !vcc5=15!vcc1=2!vcc2=16!mmd255:"Score: 16!"#

51     !vcc5=15!vcc1=2!vcc2=17!mmd255:"Score: 17!"#

52     !vcc5=15!vcc1=2!vcc2=18!mmd255:"Score: 18!"#

53     !vcc5=15!vcc1=2!vcc2=19!mmd255:"Score: 19!"#

54     !vcc5=15!vcc1=2!vcc2=20!mmd255:"Score: 20!"#

55     !vcc5=15!vcc1=2!vcc2=21!mmd255:"Score: 21!"#

56     !vcc5=15!vcc1=2!vcc2=22!mmd255:"Score: 22!"#

57     !vcc5=15!vcc1=2!vcc2=23!mmd255:"Score: 23!"#

58     !vcc5=15!vcc1=2!vcc2=24!mmd255:"Score: 24!"#

59     !vcc5=15!vcc1=2!vcc2=25!mmd255:"Score: 25!"#

60     !vcc5=15!vcc1=2!vcc2=26!mmd255:"Score: 26!"#

61     !vcc5=15!vcc1=2!vcc2=27!mmd255:"Score: 27!"#

62     !vcc5=15!vcc1=2!vcc2=28!mmd255:"Score: 28!"#

63     !vcc5=15!vcc1=2!vcc2=29!mmd255:"Score: 29!"#

64     !vcc5=15!vcc1=2!vcc2=30!mmd255:"Score: 30!"#

65     !vcc5=15!vcc1=2!vcc2=31!mmd255:"Score: 31!"#

66     !vcc5=15!vcc1=2!vcc2=32!mmd255:"Score: 32!"#

67     !vcc5=15!vcc1=2!vcc2=33!mmd255:"Score: 33!"#

68     !vcc5=15!vcc1=2!vcc2=34!mmd255:"Score: 34!"#

69     !vcc5=15!vcc1=2!vcc2=35!mmd255:"Score: 35!"#

70     !vcc5=15!vcc1=2!vcc2=36!mmd255:"Score: 36!"#

71     !vcc5=15!vcc1=2!vcc2=37!mmd255:"Score: 37!"#

72     !vcc5=15!vcc1=2!vcc2=38!mmd255:"Score: 38!"#

73     !vcc5=15!vcc1=2!vcc2=39!mmd255:"Score: 39!"#

74     !vcc5=15!vcc1=2!vcc2=40!mmd255:"Score: 40!"#

75     !vcc5=15!vcc1=2!vcc2=41!mmd255:"Score: 41!"#

76     !vcc5=15!vcc1=2!vcc2=42!mmd255:"Score: 42!"#

77     !vcc5=15!vcc1=2!vcc2=43!mmd255:"Score: 43!"#

78     !vcc5=15!vcc1=2!vcc2=44!mmd255:"Score: 44!"#

79     !vcc5=15!vcc1=2!vcc2=45!mmd255:"Score: 45!"#

80     !vcc5=15!vcc1=2!vcc2=46!mmd255:"Score: 46!"#

81     !vcc5=15!vcc1=2!vcc2=47!mmd255:"Score: 47!"#

82     !vcc5=15!vcc1=2!vcc2=48!mmd255:"Score: 48!"#

83     !vcc5=15!vcc1=2!vcc2=49!mmd255:"Score: 49!"#

84     !vcc5=15!vcc1=2!vcc2=50!mmd255:"Score: 50!"#

85     !vcc5=15!vcc1=2!vcc2=51!mmd255:"Score: 51!"#

86     !vcc5=15!vcc1=2!vcc2=52!mmd255:"Score: 52!"#

87     !vcc5=15!vcc1=2!vcc2=53!mmd255:"Score: 53!"#

88     !vcc5=15!vcc1=2!vcc2=54!mmd255:"Score: 54!"#

89     !vcc5=15!vcc1=2!vcc2=55!mmd255:"Score: 55!"#

90     !vcc5=15!vcc1=2!vcc2=56!mmd255:"Score: 56!"#

91     !vcc5=15!vcc1=2!vcc2=57!mmd255:"Score: 57!"#

92     !vcc5=15!vcc1=2!vcc2=58!mmd255:"Score: 58!"#

93     !vcc5=15!vcc1=2!vcc2=59!mmd255:"Score: 59!"#

94     !vcc5=15!vcc1=2!vcc2=60!mmd255:"Score: 60!"#

95     !vcc5=15!vcc1=2!vcc2=61!mmd255:"Score: 61!"#

96     !vcc5=15!vcc1=2!vcc2=62!mmd255:"Score: 62!"#

97     !vcc5=15!vcc1=2!vcc2=63!mmd255:"Score: 63!"#

98     !vcc5=15!vcc1=2!vcc2=64!mmd255:"Score: 64!"#

99     !vcc5=15!vcc1=2!vcc2=65!mmd255:"Score: 65!"#

100   !vcc5=15!vcc1=2!vcc2=66!mmd255:"Score: 66!"#

101   !vcc5=15!vcc1=2!vcc2=67!mmd255:"Score: 67!"#

102   !vcc5=15!vcc1=2!vcc2=68!mmd255:"Score: 68!"#

103   !vcc5=15!vcc1=2!vcc2=69!mmd255:"Score: 69!"#

104   !vcc5=15!vcc1=2!vcc2=70!mmd255:"Score: 70!"#

105   !vcc5=15!vcc1=2!vcc2=71!mmd255:"Score: 71!"#

106   !vcc5=15!vcc1=2!vcc2=72!mmd255:"Score: 72!"#

107   !vcc5=15!vcc1=2!vcc2=73!mmd255:"Score: 73!"#

108   !vcc5=15!vcc1=2!vcc2=74!mmd255:"Score: 74!"#

109   !vcc5=15!vcc1=2!vcc2=75!mmd255:"Score: 75!"#

110   !vcc5=15!vcc1=2!vcc2=76!mmd255:"Score: 76!"#

111   !vcc5=15!vcc1=2!vcc2=77!mmd255:"Score: 77!"#

112   !vcc5=15!vcc1=2!vcc2=78!mmd255:"Score: 78!"#

113   !vcc5=15!vcc1=2!vcc2=79!mmd255:"Score: 79!"#

114   !vcc5=15!vcc1=2!vcc2=80!mmd255:"Score: 80!"#

115   !vcc5=15!vcc1=2!vcc2=81!mmd255:"Score: 81!"#

116   !vcc5=15!vcc1=2!vcc2=82!mmd255:"Score: 82!"#

117   !vcc5=15!vcc1=2!vcc2=83!mmd255:"Score: 83!"#

118   !vcc5=15!vcc1=2!vcc2=84!mmd255:"Score: 84!"#

119   !vcc5=15!vcc1=2!vcc2=85!mmd255:"Score: 85!"#

120   !vcc5=15!vcc1=2!vcc2=86!mmd255:"Score: 86!"#

121   !vcc5=15!vcc1=2!vcc2=87!mmd255:"Score: 87!"#

122   !vcc5=15!vcc1=2!vcc2=88!mmd255:"Score: 88!"#

123   !vcc5=15!vcc1=2!vcc2=89!mmd255:"Score: 89!"#

124   !vcc5=15!vcc1=2!vcc2=90!mmd255:"Score: 90!"#

125   !vcc5=15!vcc1=2!vcc2=91!mmd255:"Score: 91!"#

126   !vcc5=15!vcc1=2!vcc2=92!mmd255:"Score: 92!"#

127   !vcc5=15!vcc1=2!vcc2=93!mmd255:"Score: 93!"#

128   !vcc5=15!vcc1=2!vcc2=94!mmd255:"Score: 94!"#

129   !vcc5=15!vcc1=2!vcc2=95!mmd255:"Score: 95!"#

130   !vcc5=15!vcc1=2!vcc2=96!mmd255:"Score: 96!"#

131   !vcc5=15!vcc1=2!vcc2=97!mmd255:"Score: 97!"#

132   !vcc5=15!vcc1=2!vcc2=98!mmd255:"Score: 98!"#

133   !vcc5=15!vcc1=2!vcc2=99!mmd255:"Score: 99!"#

134   !vcc5=15!vcc1=2!vcc2=100!mmd255:"Score: 100!"#

135   !vcc5=15!vcc1=2!vcc2=101!mmd255:"Score: 101!"#

136   !vcc5=15!vcc1=2!vcc2=102!mmd255:"Score: 102!"#

137   !vcc5=15!vcc1=2!vcc2=103!mmd255:"Score: 103!"#

138   !vcc5=15!vcc1=2!vcc2=104!mmd255:"Score: 104!"#

139   !vcc5=15!vcc1=2!vcc2=105!mmd255:"Score: 105!"#

140   !vcc5=15!vcc1=2!vcc2=106!mmd255:"Score: 106!"#

141   !vcc5=15!vcc1=2!vcc2=107!mmd255:"Score: 107!"#

142   !vcc5=15!vcc1=2!vcc2=108!mmd255:"Score: 108!"#

143   !vcc5=15!vcc1=2!vcc2=109!mmd255:"Score: 109!"#

144   !vcc5=15!vcc1=2!vcc2=110!mmd255:"Score: 110!"#

145   !vcc5=15!vcc1=2!vcc2=111!mmd255:"Score: 111!"#

146   !vcc5=15!vcc1=2!vcc2=112!mmd255:"Score: 112!"#

147   !vcc5=15!vcc1=2!vcc2=113!mmd255:"Score: 113!"#

148   !vcc5=15!vcc1=2!vcc2=114!mmd255:"Score: 114!"#

150   !vcc5=15!vcc1=2!vcc2=115!mmd255:"Score: 115!"#

151   !vcc5=15!vcc1=2!vcc2=116!mmd255:"Score: 116!"#

152   !vcc5=15!vcc1=2!vcc2=117!mmd255:"Score: 117!"#

153   !vcc5=15!vcc1=2!vcc2=118!mmd255:"Score: 118!"#

154   !vcc5=15!vcc1=2!vcc2=119!mmd255:"Score: 119!"#

155   !vcc5=15!vcc1=2!vcc2=120!mmd255:"Score: 120!"#

156   !vcc5=15!vcc1=2!vcc2=121!mmd255:"Score: 121!"#

157   !vcc5=15!vcc1=2!vcc2=122!mmd255:"Score: 122!"#

158   !vcc5=15!vcc1=2!vcc2=123!mmd255:"Score: 123!"#

159   !vcc5=15!vcc1=2!vcc2=124!mmd255:"Score: 124!"#

160   !vcc5=15!vcc1=2!vcc2>124!mmd255:"Above Score Display!"#

161   !vcc5=10!vcc1=2!vcv72<2!mmd255:"High Score! Congrats!"#

162   !vcc5=10!vcc1=2!vcv72<2!vmv72=2#

163   !vcc5=5!vcc1=2!mmd255:"Play again?"#

164   !vcc5=5!vcc1=2!vmc1=0#


Line 1: On startup variable 1 is initialized to zero. Variable 1 is used to control the modes of game play with 1 being 'Pre-Game Play' mode (coin insert prompt), 2 is the actual 'Game Play' (countdown timer and button listener) and 3 is the 'Post-Game Play' mode (score display).


Line 2: On startup variables 71-100 are EEPROM variables that can be used to save values even after a power cycle. The default value for an EEPROM variable is 65535. In this example, variable 72 is set to 0 as to not be mistaken for the high score.


Line 3: When input 1 is closed (!i1c) a coin has been inserted. The total number of coins inserted is stored in variable 71.


Line 4: Zero coins have been inserted, the user will need to insert 3 coins to play.


Line 5: One coin have been inserted, the user will need to insert 2 coins to play.


Line 6: Two coins have been inserted, the user will need to insert 1 coin to play.


Line 7: Three coins have been inserted and the game can begin.


Line 8: When at least three coins have been inserted, the program switches to 'Game Play' mode. 


Line 9: The player is charged 3 coins to play.


Line 10: The starting score is set to zero.


Line 11: Variable 4 will be used as a counter to regulate the screen display with a starting value of 69.


Line 12: Once every second, the counter decrements by one (variable 4).


Line 13: When variable 4 equals 68, display "Button Press Game".


Line 14: When variable 4 equals 66, display "Ready?".


Line 15: When variable 4 equals 64, display "Set?".


Line 16: When variable 4 equals 62, display "Go!".


Line 17: When variable 4 equals 60, display "60 Seconds".


Line 18: When variable 4 equals 55, display "55 Seconds".


Line 19: When variable 4 equals 50, display "50 Seconds".


Line 20: When variable 4 equals 45, display "45 Seconds".


Line 21: When variable 4 equals 40, display "40 Seconds".


Line 22: When variable 4 equals 35, display "35 Seconds".


Line 23: When variable 4 equals 30, display "30 Seconds".


Line 24: When variable 4 equals 25, display "25 Seconds".


Line 25: When variable 4 equals 20, display "20 Seconds".


Line 26: When variable 4 equals 15, display "15 Seconds".


Line 27: When variable 4 equals 10, display "10 Seconds".


Line 28: When variable 4 equals 5, display "05 Seconds".


Line 29: When variable 4 equals 0, display "Time is Up!".


Line 30: When input 2 is closed (!i2c) the button has been pressed. The total score is incremented by 1 and stored in Variable 2.


Line 31: When the timer expires, the program moves to 'Post-Game Play' mode.


Line 32: Variable 5 will be used as a counter to regulate the screen display with a starting value of 16.


Line 33: Once every second, the counter decrements by one (variable 5).

 

Lines 34-159: When variable 5 equals 15, display the score stored in variable 2.


Lines 160: If the score stored in variable 2 is greater than 124, display "Above Score Display!". 


Lines 161: If variable 2 (the user's score) is greater than variable 72, the user has achieved the high score.


Lines 162: If the user has achieved the high score, set the user's score as the new high score.


Lines 163: Ask the user if they would like to play again.


Lines 164: Set the game mode to 'Pre-Game Play'.


Example 2:


1     .:: High Score Game ::.

2     .:: Instructions ::.

3     Insert $0.75

4     Start the game.

5     Beat the high score.

6     .:: Pinout ::.

7     Pin 1 - Coin insert

8     Pin 2 - Counter Trigger

9     Pin 3 - Start Game

10   .:: Variables ::.

11   Var 1 Coin Count

12   Var 2 Game Status

13   Var 3 Timer

14   Var 4 Counter

15   Var 5 Former High Score

16   Var 6 Cheat Time. Limited to 10 cheats.

17   Var 75 High Score (EEPROM)

18   .:: Setup ::.

19   !tm00:01!vcc75=65535!vmc75=0#

20   !tm00:01!sip10.0.1.251#

21   !tm00:01!ssm255.255.0.0#

22   !tm00:01!sgi10.0.1.1#

23   !tm00:02!mmd255:"Play me! Add coins!"

24   .:: Inputs ::.

25   !i1c!vcc2=0!vcc1

26   !i1c!vcc2=0!vcc1

27   !i1c!vcc2=1!vcc3>5!vcc6

28   !i1c!vcc2=1!vcc3>4!vmc6+1#

29   !i1c!vcc2=1!vcc3>5!vcc6

30   !i2c!vcc1=3!vmc2=1#

31   !i2c!vcc1=3!vmc1=0#

32   !i3c!vcc2=1!vmc4+1#

33   !i1c!vcc2=0!vcc1=1!mmd255:"25 Cents"#

34   !i1c!vcc2=0!vcc1=2!mmd255:"50 Cents"#

35   !vcc1=3!mmd255:"Game Ready To Play"#

36   !vcc1=3!vmc4=0#

37   !vcc1=3!vmc3=0#

38   !t&00:01!vcc2=1!vmc3+1#

39   .:: Timing ::.

40   !vcc3=00!vcc2=1!mmd255:"60 Seconds Left"#

41   !vcc3=10!vcc2=1!mmd255:"50 Seconds Left"#

42   !vcc3=20!vcc2=1!mmd255:"40 Seconds Left"#

43   !vcc3=25!vcc2=1!mmd255:"35 Seconds Left"#

44   !vcc3=30!vcc2=1!mmd255:"30 Seconds Left"#

45   !vcc3=40!vcc2=1!mmd255:"20 Seconds Left"#

46   !vcc3=50!vcc2=1!mmd255:"10 Seconds Left"#

47   !vcc3=51!vcc2=1!mmd255:"9 Seconds Left"#

48   !vcc3=52!vcc2=1!mmd255:"8 Seconds Left"#

49   !vcc3=53!vcc2=1!mmd255:"7 Seconds Left"#

50   !vcc3=54!vcc2=1!mmd255:"6 Seconds Left"#

51   !vcc3=55!vcc2=1!mmd255:"5 Seconds Left"#

52   !vcc3=56!vcc2=1!mmd255:"4 Seconds Left"#

53   !vcc3=57!vcc2=1!mmd255:"3 Seconds Left"#

54   !vcc3=58!vcc2=1!mmd255:"2 Seconds Left"#

55   !vcc3=59!vcc2=1!mmd255:"1 Second Left"#

56   !vcc3=60!vcc2=1!mmd255"Game Over"#

57   !vcc3=60!vmc2=0#

58   !vcc3=60!vcc2=0!vmc6=0#

59   .:: High Score::.

60   !vcc3=60!vcc2=0!vcv4>75!vmv75=4#

61   !vcc3=60!vcc2=0!vcv4>75!mmd255:"New High Score!"#

62   !vcc3=60!vcc2=0!vcv4

63   !vcc3=60!vcc2=0!vmc3=0#


A special thank you to E. Boxer for submitting Example 2!