|
nomainwin global scale scale = 100 UpperLeftX=1 UpperLeftY=1 WindowWidth= DisplayWidth WindowHeight= DisplayHeight open "Test - move your mouse, look for sprite hit, click left mouse for scale+, right for scale-" for graphics as #main #main, "trapclose quit" #main, "down; fill black; color red; backcolor green" #main, "place 0 25; boxfilled 25 50" #main, "getbmp sprite 0 0 25 50" #main, "getbmp tester 0 0 1 1" #main, "addsprite sprite sprite" #main, "addsprite tester tester" #main, "spritescale sprite ";scale #main, "spritevisible tester off" #main, "spritexy sprite 50 50" #main, "cls; flush" #main, "drawsprites" #main, "when mouseMove test" #main, "when leftButtonDown scalePlus" #main, "when rightButtonDown scaleMinus" wait sub quit h$ unloadbmp "sprite" unloadbmp "tester" close #h$ end end sub sub test h$, x, y #h$, "spritexy tester "; x; " "; y #h$, "spritecollides tester s$" #h$, "place 10 10" #h$, "\SpriteScale "; using("####",scale); " Size ";25*scale/100;" " #h$, "\pos "; using("####",x);using("####",y);" " if s$ <> "" then #h$, "\sprite hit" else #h$, "\ " end sub sub redraw h$, a$ #h$, "drawsprites" end sub sub scalePlus h$, x, y scale=scale*2 #h$, "spritescale sprite ";scale call redraw h$, a$ call test h$, x, y end sub sub scaleMinus h$, x, y scale=int(scale/2) #h$, "spritescale sprite ";scale call redraw h$, a$ call test h$, x, y end sub
|