saboteur Posted March 8, 2022 Share Posted March 8, 2022 Managed to stuff my back over the weekend so am sat at home twiddling my thumbs so i thought i'd get back to JagStudio. I have a sprite (24 x 24 px ) which has 3 frames of animation, so the image is 24 x 72 ( verticaly stacked ) I've been able to display my sprite and move it around no problem - but as soon as i try to change the frame I get a jumbled mess. Is this code correct ? pframe = 1 pgfx_loc=sprite[player].gfxbase pgfx_size=sprite[player].framesz sprite[player].gfxbase = pgfx_loc+(pgfx_size*pframe) The rapinit looks correct and there is nothing in there that i can see where you specify the number of frames. Thanks for any advice. Quote Link to comment https://forums.atariage.com/topic/332349-changing-sprite-frame/ Share on other sites More sharing options...
Sporadic Posted March 8, 2022 Share Posted March 8, 2022 My initial thought is, you are changing gfxbase. Therefore on the next change, you have altered the starting address. Perhaps store the initial gfxbase on game start, then always adjust the "live" gfxbase from that. Quote Link to comment https://forums.atariage.com/topic/332349-changing-sprite-frame/#findComment-5017664 Share on other sites More sharing options...
saboteur Posted March 8, 2022 Author Share Posted March 8, 2022 yeah, sorry pgfx_loc=sprite[player].gfxbase pgfx_size=sprite[player].framesz is called at the start and outside the loop I think my code is correct, i may have my rapinit wrong somewhere, think i'll see if OMF's tool gives me the same settings for this image Quote Link to comment https://forums.atariage.com/topic/332349-changing-sprite-frame/#findComment-5017670 Share on other sites More sharing options...
saboteur Posted March 8, 2022 Author Share Posted March 8, 2022 Well that's a bust - OMF's tool only allows images that are 16 or 32 pixels wide, perhaps that's my problem here. Quote Link to comment https://forums.atariage.com/topic/332349-changing-sprite-frame/#findComment-5017671 Share on other sites More sharing options...
saboteur Posted March 8, 2022 Author Share Posted March 8, 2022 Nah, never mind... Helps if you asset file is pointing at the right image in the first place DOH! 1 1 1 Quote Link to comment https://forums.atariage.com/topic/332349-changing-sprite-frame/#findComment-5017672 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.