File: spritetest3.kbs

package info (click to toggle)
basic256 2.0.99.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,888 kB
  • sloc: cpp: 17,185; yacc: 4,025; lex: 1,466; java: 1,091; sh: 39; xml: 33; makefile: 20
file content (32 lines) | stat: -rw-r--r-- 585 bytes parent folder | download | duplicates (4)
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
27
28
29
30
31
32
# spritetext3.kbs = use mouse to move a sprite around
# 2010-06-13 j.m.reneau
# 2011-11-03 j.m.reneau rewrite to showcase sprite rotation and scaling

color green
rect 0,0,300,300

spritedim 2

fixed = 1
mobile = 0
r = 0
dr = .01 # change in rotation
s = 1
ds = .01 # change in scale


spriteload fixed, "help.png"
spriteplace fixed, 150,150
spriteshow fixed

spriteload mobile, "help.png"
spriteplace mobile, 0,0
spriteshow mobile

while true
r = r +.001
s = s + ds
if s > 3 or s < .25 then ds = ds * -1
   spriteplace mobile, mousex, mousey,s,r
   print spritecollide(0,1)
end while