Yab2Cpp/yab-IDE/Programs/Examples/Pong.yab
2015-04-13 13:40:27 -07:00

23 lines
458 B
Plaintext
Executable File

#!yab
# mimetype "application/x-vnd.Pong.yab"
doc See Ping.yab for more information.
window open 400,100 to 600,300, "Pong", "Pong"
dim msg$(1)
while(not finished)
n = token(message$, msg$(), ":|")
for i = 1 to n
if(instr(msg$(i), "Quit")) finished = true
if(instr(msg$(i), "_Scripting") and n>=i+2) then
x = val(msg$(i+1)) - 200
y = val(msg$(i+2))
draw flush "Pong"
draw circle x,y, 8, "Pong"
endif
next i
wend
window close "Pong"