File: paddle.kbs

package info (click to toggle)
basic256 0.9.6.69a-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 26,304 kB
  • sloc: cpp: 7,778; yacc: 926; lex: 575; sh: 21; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
print "Use the J and K keys to move the paddle"

fastgraphics

x = 30
y = 280
xinc = 5

loop1:
  a = key
  if a = 75 then x = x + 30
  if a = 74 then x = x - 30
  if x < 0 then x = 0
  if x > 200 then x = 200
  gosub drawpaddle
  goto loop1

drawpaddle:
  color gray
  rect 0,0,300,300
  color darkblue
  rect x,y,100,10
  color blue
  rect x+1,y+1,98,8
  refresh
  return