loadbmp "smiley1", "sprites\smiley1.bmp" loadbmp "smiley2", "sprites\smiley2.bmp" loadbmp "smiley3", "sprites\smiley3.bmp" loadbmp "smiley4", "sprites\smiley4.bmp" loadbmp "landscape", "sprites\bg1.bmp" WindowHeight = 300 WindowWidth = 400 'graphicbox #wg, 0, 0, 400, 300 open "sprite test" for graphics_nf_nsb as #wg print #wg, "background landscape"; print #wg, "addsprite smiley smiley1 smiley2 smiley3 smiley4"; print #wg, "addsprite smiler smiley1 smiley2 smiley3 smiley4"; print #wg, "addsprite smiled smiley1 smiley2 smiley3 smiley4"; print #wg, "addsprite smiles smiley1 smiley2 smiley3 smiley4"; print #wg, "cyclesprite smiley 1 once" print #wg, "cyclesprite smiler 1" print #wg, "cyclesprite smiled 1" print #wg, "cyclesprite smiles 1" for x = 1 to 100 step 2 print #wg, "spritexy smiley "; x; " "; x print #wg, "spritexy smiler "; 100-x; " "; x print #wg, "spritexy smiled "; 100-x; " "; 100-x print #wg, "spritexy smiles "; x; " "; 100-x print #wg, "drawsprites"; print #wg, "spritecollides smiley list$" if list$ > "" then print #wg, "cyclesprite smiley 1 once" next x input a$
'Simple cycle sprite and sprite collide example nomainwin loadbmp "smiley1", "sprites\smiley1.bmp" loadbmp "smiley2", "sprites\smiley2.bmp" loadbmp "smiley3", "sprites\smiley3.bmp" loadbmp "smiley4", "sprites\smiley4.bmp" loadbmp "landscape", "sprites\bg1.bmp" WindowHeight = 300 WindowWidth = 400 'graphicbox #wg, 0, 0, 400, 300 open "sprite test" for graphics_nf_nsb as #wg #wg "trapclose [quit]" #wg "background landscape"; #wg "addsprite smiley smiley1 smiley2 smiley3 smiley4"; #wg "addsprite smiler smiley1 smiley2 smiley3 smiley4"; #wg "addsprite smiled smiley1 smiley2 smiley3 smiley4"; #wg "addsprite smiles smiley1 smiley2 smiley3 smiley4"; #wg "cyclesprite smiley 1 once" #wg "cyclesprite smiler 1" #wg "cyclesprite smiled 1" #wg "cyclesprite smiles 1" timer 60, [draw] [draw] #wg "spritexy smiley "; x; " "; x #wg "spritexy smiler "; 100-x; " "; x #wg "spritexy smiled "; 100-x; " "; 100-x #wg "spritexy smiles "; x; " "; 100-x #wg "drawsprites"; #wg "spritecollides smiley list$" if list$ > "" then #wg "cyclesprite smiley 1 once" x=x+1 if x=100 then [quit] wait [quit] timer 0 close #wg end
|
|