Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual page 147

Script language
Table of Contents

Advertisement

CHAPTER 7 – Script Example
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 = distance + speed
The following paragraphs describe the above script on a line by line basis.
IF burner AND alt > 400.0 THEN
burner = FALSE
ENDIF
Page 134
OMRON
Revision 2.0

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents