Jump to content
IGNORED

How to create animation?


mehguy

Recommended Posts


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
  • Like 1
Link to comment
Share on other sites

 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?

Link to comment
Share on other sites

  • 3 weeks later...

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?

Link to comment
Share on other sites

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.

 

 

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...