CHAPTER 7 – Script Example
OMRON
Page 134
Revision 2.0
The page script initiated at intervals of 100 milliseconds provides the main configuration of the game,
reacting to user input and moving the balloon accordingly. This page script is as follows:
IF burner AND alt > 400.0 THEN
burner = FALSE
ENDIF
IF burner THEN
fuel = fuel - rate
IF fuel < 0.0 THEN
fuel = 0.0
burner = FALSE
ENDIF
ENDIF
IF burner AND fuel > 0.0 AND rate > 0.0 THEN
lift = lift + rate/5.0
ELSE
IF alt > 140.0 THEN
lift = lift - 0.2
ENDIF
ENDIF
IF lift < -10.0 THEN
lift = -10.0
ENDIF
alt = alt + lift
IF alt <= 140.0 THEN
IF distance>630.0 AND distance<660.0 AND lift>=-3.0 THEN
winner = TRUE
burner = FALSE
ENDIF
IF lift < -3.0 then
crash = TRUE
burner = FALSE
ENDIF
lift = 0.0
ENDIF
speed = (alt-140.0 )/100.0
IF speed < 0.0 then
speed = 0.0
ENDIF
distance = di speed
The following paragraphs describe the above script on a line by line basis.
IF burner AND alt > 400.0 THEN
burner = FALSE
ENDIF
Summary of Contents for CX-SUPERVISOR - SCRIPT REFERENCE REV2.0
Page 2: ...CX Supervisor Script Language Software Revision 2 0...
Page 3: ......
Page 5: ...CX Supervisor Script Language OMRON Page ii Revision 2 0...
Page 7: ...CX Supervisor Script Language OMRON Page iv Revision 2 0...
Page 9: ...CX Supervisor Script Language OMRON Page vi Revision 2 0...
Page 13: ......
Page 15: ...CHAPTER 1 Introduction OMRON Page 2 Revision 2 0...
Page 19: ...CHAPTER 2 Expressions OMRON Page 6 Revision 2 0...
Page 21: ...CHAPTER 3 Scripts OMRON Page 8 Revision 2 0...
Page 151: ...CHAPTER 8 Colour Palette OMRON Page 138 Revision 2 0...