Fredifredo #1 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 Share this post Link to post Share on other sites
+CyranoJ #2 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 Share this post Link to post Share on other sites
Fredifredo #3 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 Share this post Link to post Share on other sites