mehguy Posted August 13, 2014 Share Posted August 13, 2014 How would i go about making animation for sprites? Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted August 13, 2014 Share Posted August 13, 2014 set smartbranching on set romsize 4k rem /** Use the first variable as a counter **/ dim counter = a init rem /** Draw a sprite with slight differences **/ rem /** between sides that will look animated **/ rem /** when sprite is reflected **/ player0: %00100100 %00011000 %00111100 %01011010 %01111110 %00111100 %10111100 %01011011 %00111100 %11111110 %00011001 %00111100 %01111111 %10111100 %00011000 end rem /** Center the player0 sprite **/ player0x = 77 : player0y = 77 rem /** Make the background white **/ rem /** Since we never change the foreground **/ rem /** color everything else is black **/ COLUBK = $0E main rem /** Increment the counter variable by one **/ counter = counter + 1 rem /** if the fourth bit in counter is 1 then **/ rem /** reflect the player0 sprite **/ if counter{4} then REFP0 = 8 rem /** Draw the screen and loop around to the **/ rem /** beginning of main **/ drawscreen goto main 1 Quote Link to comment Share on other sites More sharing options...
mehguy Posted August 13, 2014 Author Share Posted August 13, 2014 set smartbranching on set romsize 4k rem /** Use the first variable as a counter **/ dim counter = a init rem /** Draw a sprite with slight differences **/ rem /** between sides that will look animated **/ rem /** when sprite is reflected **/ player0: %00100100 %00011000 %00111100 %01011010 %01111110 %00111100 %10111100 %01011011 %00111100 %11111110 %00011001 %00111100 %01111111 %10111100 %00011000 end rem /** Center the player0 sprite **/ player0x = 77 : player0y = 77 rem /** Make the background white **/ rem /** Since we never change the foreground **/ rem /** color everything else is black **/ COLUBK = $0E main rem /** Increment the counter variable by one **/ counter = counter + 1 rem /** if the fourth bit in counter is 1 then **/ rem /** reflect the player0 sprite **/ if counter{4} then REFP0 = 8 rem /** Draw the screen and loop around to the **/ rem /** beginning of main **/ drawscreen goto main So I would replace the sprite with this or add this to the existing sprite i have? Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted August 13, 2014 Share Posted August 13, 2014 That's just one technique to animate a sprite. Basically, you create your sprite so one side is different from the other so when you reflect it (REFP0 = 8 ) it looks animated. It saves space because it's the same sprite. Quote Link to comment Share on other sites More sharing options...
bogax Posted August 13, 2014 Share Posted August 13, 2014 here you can find an example of an animated sprite (warning: splash add to click through) http://basicplay.netau.net/ Quote Link to comment Share on other sites More sharing options...
Sprybug Posted August 15, 2014 Share Posted August 15, 2014 Also in Visual BB, there's a tool to take sprites that you've created and animate them frame by frame so to speak, to see if the animation is working. 2 Quote Link to comment Share on other sites More sharing options...
iesposta Posted September 3, 2014 Share Posted September 3, 2014 here you can find an example of an animated sprite (warning: splash add to click through) http://basicplay.netau.net/ bogax, This almost works in batari Basic DPC+ kernel. It works for a few beginning frames, then goes garbage. I also had to set height to 8 to show the bottom line. Thought: Maybe I have to set the fractional data fetchers before the drawscreen command, that might be corrupting things. Note: I can stack 2 shapes in one player define and player0pointerlo+15 to show just the second shape along with player0height = 15, so those still work. Can you do the same with player0color or do you need to define new colors based on which image you want? Quote Link to comment Share on other sites More sharing options...
bogax Posted September 3, 2014 Share Posted September 3, 2014 bogax, This almost works in batari Basic DPC+ kernel. It works for a few beginning frames, then goes garbage. I also had to set height to 8 to show the bottom line. Thought: Maybe I have to set the fractional data fetchers before the drawscreen command, that might be corrupting things. Note: I can stack 2 shapes in one player define and player0pointerlo+15 to show just the second shape along with player0height = 15, so those still work. Can you do the same with player0color or do you need to define new colors based on which image you want? I'm really not that familiar with the DPC+ kernel I think what you'd have to do is create a routine that sets up the data fetchers and then pushes the pointers where ever they need to go rather than just setting the pointers with an assignment. I'll look when I get a chance, maybe see if I can get something working. As to player colors I don't know, I'll have to look. But I think it would be similar to the sprite pointers. 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.