Fredifredo Posted March 19, 2016 Share Posted March 19, 2016 (edited) Here the simple code in a loop : " 'DEPLACEMENT VERTICAL DU SPRITE AVEC LE PAD1'' pad1=GETPAD(1) IF pad1 BAND PAD_UP THEN LA=LA-2 ' VITESSE de DEPLACEMENT VERS LE HAUT RSETOBJ(6,R_sprite_active,R_is_inactive) RSETOBJ(23,R_sprite_active,R_is_active) RSETOBJ(23,R_sprite_y,LA<<16) RSETOBJ(23,R_sprite_x,BA<<16) ENDIF IF pad1 BAND PAD_DOWN THEN LA=LA+2 ' VITESSE de DEPLACEMENT VERS LE BAS RSETOBJ(6,R_sprite_active,R_is_inactive) RSETOBJ(23,R_sprite_active,R_is_active) RSETOBJ(23,R_sprite_y,LA<<16) RSETOBJ(23,R_sprite_x,BA<<16) ENDIF IF pad1 BAND PAD_LEFT THEN RSETOBJ(23,R_sprite_active,R_is_inactive) BA=BA-2 ' VITESSE de DEPLACEMENT VERS La GAUCHE RSETOBJ(6,R_sprite_active,R_is_active) RSETOBJ(6,R_sprite_x,BA<<16) RSETOBJ(6,R_sprite_y,LA<<16) ENDIF IF pad1 BAND PAD_RIGHT THEN RSETOBJ(23,R_sprite_active,R_is_inactive) BA=BA+2 ' VITESSE de DEPLACEMENT VERS LA DROITE RSETOBJ(6,R_sprite_active,R_is_active) RSETOBJ(6,R_sprite_x,BA<<16) RSETOBJ(6,R_sprite_y,LA<<16) ENDIF " hockey.abs Edited March 19, 2016 by Fredifredo Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted March 19, 2016 Share Posted March 19, 2016 Inactive doesn't remove the sprite, it just stops it from processing. You still have to move it off the screen. Why do you have 2 objects, one for left/right and one for up/down? You can do the same thing with one sprite and change gfx_base for which animation chain you want to use. 2 Quote Link to comment Share on other sites More sharing options...
Fredifredo Posted March 19, 2016 Author Share Posted March 19, 2016 Ok thank you the best way is to use 1 object In the Shootbang demo it used gfx_base but only for 1 frame ( left ; center ; right ) ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.