alias soccer window -pkodCfB @s 1 1 400 200 | %ballx = 202 | %bally = 100 | %balls = 0 | scr alias scr { var %dd drawdot -n @s | var %dline drawline -n @s | var %drect drawrect -n @s | var %dc drawrect -en @s | drawfill -n @s 3 1 0 0 | %dline 0 2 200 0 200 200 | %drect 0 2 0 0 400 200 | %dd 12 6 28 100 | %dd 4 6 374 100 %dc 0 2 160 59 80 80 | %drect 0 2 0 40 60 120 | %drect 0 2 340 40 60 120 | %drect 0 2 0 70 20 60 | %drect 0 2 380 70 20 60 | if (%ballx = 22) && (%bally >= 72) && (%bally <= 138) { $iif($input(You Won!,oid,Win), , ) %ballx = 202 | %bally = 100 } | elseif (%ballx = 378) && (%bally >= 72) && (%bally <= 138) { $iif($input(you Won!,oid,Win), , ) | %ballx = 202 | %bally = 100 } | %dd 15 4 %ballx %bally | %dd 0 2 $calc(%ballx -1) $calc(%bally -1) | drawdot @s } on *:KEYDOWN:@s:37,38,39,40: { if ($keyval == 37) { dec %ballx 2 } | elseif ($keyval == 38) { dec %bally 2 } | elseif ($keyval == 39) { inc %ballx 2 } | elseif ($keyval == 40) { inc %bally 2 } | scr }