Omron CX-Supervisor Reference Manual page 124

Script language reference
Hide thumbs Also See for CX-Supervisor:
Table of Contents

Advertisement

Balloon Script
IF alt > 140.0 THEN
lift = lift - 0.2
ENDIF
ENDIF
If the fuel burner is on, and there is still fuel left, and the rate of ascent exceeds
0 (the balloon has taken off) then point 'lift' is incremented by the rate of ascent
divided by 5 to allow the balloon to climb. Otherwise the balloon must be
descending and point 'lift' is decremented by 0.2.
IF lift < -10.0 THEN
lift = -10.0
ENDIF
Once point 'lift' reaches -10, it is not allowed to go lower.
alt = alt + lift
The altitude of the balloon is incremented by point '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 the balloon has hit the ground (point 'alt' equals 140), then provided it is on
the plateaux (the position of the balloon in pixels defined by point 'distance' is
between 630 and 660) and the rate of descent is not too fast (defined by point
'lift'), then the game is won.
IF lift < -3.0 then
crash = TRUE
burner = FALSE
ENDIF
If the balloon has hit the ground (point 'alt' equals 140), then if the rate of
descent is not too fast (defined by point 'lift'), then the game is lost.
lift = 0.0
ENDIF
Point 'lift' is reset.
speed = (alt-140.0 )/100.0
IF speed < 0.0 then
speed = 0.0
ENDIF
Point 'speed' is calculated based on the altitude.
distance = distance + speed
Point 'distance' is calculated based on the speed.
SECTION 7 Script Example
123

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cx-supervisor 3.1

Table of Contents