Petit Computer Wiki
Petit Computer Wiki
VCLR
HEADSTART:
GOTO SETUP
SETUPRETURN:
OBJCT.SET[1,0;0,0]
OBJCT.SET[0,0;0,0]
OBJCT.MOV[0,X;Y]

MAINLOOP:
WHEN BUT[]=1 DO{
MATH Y=Y-5
}
WHEN BUT[]=2 DO{
MATH Y=Y+5
}
WHEN BUT[]=16 DO{
STOP
}
OBJCT.SIZ[0,2]
OBJCT.SIZ[1,2]
OBJCT.MOV[0,X;Y]
MATH x=x-S
WHEN VAR[x]<2
WHEN VAR[Y]=y DO{
GOTO DEATH
}
WHEN VAR[x]<2 DO{
SETV VAR[x]=255
RAND PUSH(NULL) MAX[017]=y
MATH y=y*5
MATH y=y+3
MATH S=S+1
}
OBJCT.MOV[1,x;y]
SLP[0.2]
GOTO MAINLOOP

SETUP:
SETV VAR[5]=10
SETV VAR[2]=20
SETV VAR[X]=20
SETV VAR[Y]=95
SETV VAR[S]=4
SETV VAR[1]=1
SETV VAR[3]=5
GOTO SETUPRETURN

DEATH:
OCLR
OUT<"Game over!\n"
OUT<"Play again? (Y/N)\n"
IN> STR[A]
SETV STR[Y]=Y
SETV STR[N]=N
WHEN STR[A]=Y DO{
GOTO HEADSTART
}
WHEN STR[A]=N DO{
STOP
ELSE{
TCLR
GOTO DEATH
}}