x as integer // getting started with box2d // set a virtual resolution SetVirtualResolution ( 1024, 768 ) // display a background CreateSprite ( LoadImage ( "background3.jpg" ) ) // load an image LoadImage ( 1, "A1.png",1 ) /* // create 5 sprites for d = 1 to 80 CreateSprite ( d, 1 ) SetSpriteShape(d,1) SetSpritePhysicsOn ( d, 2 ) SetSpritePosition ( d, Random(10,800),Random(1,40) ) next d */ sprites_wanted = 8 gosub makesprites LoadImage ( 100, "sivleft.png",1 ) CreateSprite ( 100, 100 ) SetSpriteShape(100,3) SetSpritePhysicsOn ( 100, 1 ) LoadImage ( 99, "sivright.png",1 ) CreateSprite ( 99, 99 ) SetSpriteShape(99,3) SetSpritePosition ( 99, 480, 0 ) SetSpritePhysicsOn ( 99, 1 ) ` main loop do for xx = 1 to 80 SetSpriteAngle(xx,360) next xx // update the screen Sync ( ) loop makesprites: loadimage (1,"A1.png",1) loadimage (2,"B2.png",1) loadimage (3,"C3.png",1) loadimage (4,"D4.png",1) loadimage (5,"E5.png",1) loadimage (6,"F6.png",1) loadimage (7,"G7.png",1) loadimage (8,"H8.png",1) loadimage (9,"I9.png",1) loadimage (10,"J10.png",1) loadimage (11,"K11.png",1) loadimage (12,"L12.png",1) loadimage (13,"M13.png",1) loadimage (14,"N14.png",1) loadimage (15,"O15.png",1) loadimage (16,"P16.png",1) loadimage (17,"Q17.png",1) loadimage (18,"R18.png",1) loadimage (19,"S19.png",1) loadimage (20,"T20.png",1) loadimage (21,"U21.png",1) loadimage (22,"V22.png",1) loadimage (23,"W23.png",1) loadimage (24,"X24.png",1) loadimage (25,"Y25.png",1) loadimage (26,"Z26.png",1) `_______________________________________________________________ sp = 1 for spx = 1 to sprites_wanted x = random( 1, 112) sp = sp + 1 if x < 9 then createsprite (sp, 26) : goto endof else if x < 12 then createsprite (sp, 25) : goto endof if x < 16 then createsprite (sp, 24) : goto endof if x < 23 then createsprite (sp, 23) : goto endof if x < 54 then createsprite (sp, 22) : goto endof if x < 105 then createsprite (sp, 21) : goto endof if x < 148 then createsprite (sp, 20) : goto endof if x < 166 then createsprite (sp, 19) : goto endof if x < 168 then createsprite (sp, 18) : goto endof if x < 187 then createsprite (sp, 17) : goto endof if x < 214 then createsprite (sp, 16) : goto endof if x < 240 then createsprite (sp, 15) : goto endof if x < 251 then createsprite (sp, 14) : goto endof if x < 273 then createsprite (sp, 13) : goto endof if x < 334 then createsprite (sp, 12) : goto endof if x < 382 then createsprite (sp, 11) : goto endof if x < 407 then createsprite (sp, 10) : goto endof if x < 505 then createsprite (sp, 9) : goto endof if x < 628 then createsprite (sp, 8) : goto endof if x < 651 then createsprite (sp, 7) : goto endof if x < 723 then createsprite (sp, 6) : goto endof if x < 757 then createsprite (sp, 5) : goto endof if x < 764 then createsprite (sp, 4) : goto endof if x < 804 then createsprite (sp, 3) : goto endof if x < 928 then createsprite (sp, 2) : goto endof if x < 1250 then createsprite (sp, 1) endof: SetSpriteShape(sp,1) SetSpritePhysicsOn ( sp, 2 ) SetSpritePosition ( sp, Random(10,800),Random(1,40) ) next spx return