Jump to content



1

Trouble using player0pointerlo


No replies to this topic

#1 jrok OFFLINE  

jrok

    Stargunner

  • 1,108 posts

Posted Thu Sep 11, 2008 11:09 AM

Hi everyone.

I'm trying to program a player graphic that animates in 8 directional orientations using batariBasic and the multisprite kernel.

The human player controls the player0 sprite, which uses odd and even frames to display two
graphics, where one portion is the head and arms of a flying superhero and the other portion is his flowing red cape. The sprite is animated using temp1 to produce a value between 0 and 3 and jump to the correct frame of 4-frame animation.

I am attempting to use long sprites in my animation routine to account for the 5 possible orientations of the sprite (REFPO is used for left, left-up and left-down sprites.) I've been trying to use player0pointerlo to display the correct directional frame during the animation routine. Basically, I made a var called playerDir that changes when the player moves the joystick, and then have tried:

player0pointerlo = playerDir

... where playerDir is a integer of the first line of a graphic in the long sprite. But instead I've just been getting a garbage sprite where the cape should be, and I honestly have no clue what I'm doing wrong. I've posted my .BAS file with the above line commented out in the main loop, and when compiled it displays the correct sprite set.

If there is anyone out there who has created a similar sprite and could help me figure out what I'm doing wrong, I'd greatly appreciate it.

Thanks in advance!

Attached File  animated_8direction_sprite.bas   12.22K   38 downloads




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users