Jump to content
IGNORED

anims : what is wrong ?


Recommended Posts

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 by Fredifredo
Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...