Jump to content
IGNORED

animation pause command?


omf

Recommended Posts

to save having to try to deal with an animation for movement manually like what is done in the 'shootbang' example when the player is standiing still it would be useful to have an animation pause command of some description so the movement animation can be sopped on its current frame temporarily.

 

I cant see an option to change in the object list or a command that does this.

 

does such a thing exist by chance?

 

Link to comment
Share on other sites

At first I tried changing the animation frames to 0 and/or the animation speed to 0. Unfortunately these didnt work.

 

In the end, I just changed the animation frame speed to a really high number so there is a large delay between frames that the player wont notice.

 

Then change back to sensible number to carry on playing.

 

There might be a proper way, but that worked for me :)

Link to comment
Share on other sites

Set _curframe to 0

Set _maxframes to 0

Set _gfxbase to the frame you want

ok I have that bit working but re setting these variables does not start the animation playing again, is there some other things I need to set to continue the animation where it was left off.

 

the current frame counter appears to still be counting from 0 to 3 for the 4 frames regardless of the above settings

Link to comment
Share on other sites

of course if there is a right way to go about that type of thing i would be interested in how its should be done in a 'propper manner'

 

:)

 

Had a very quick look. Your worm is 32x32 and 16 colours, so its frame size (R_sprite_framesz) would be 32x32/2=512, so 512 is your offset to each consecutive frame of the animation from the base address.

 

Not sure what you were experimenting with adding 32 to your "framesz" variable.

 

Scrolling the worm along seemed to skip through each of the 4 frames in turn OK, but tapping it only seemed to want to show the 4th or 1st frames, maybe your plan was to show one of those always when stopped and that's what you expected.

 

Only thing I'd say now is junk all the debug stuff as it seems to have done its job, and get some decent pad management in to allow you to walk and jump at the same time, then it looks like you have the start of something :0)

Link to comment
Share on other sites

 

Had a very quick look. Your worm is 32x32 and 16 colours, so its frame size (R_sprite_framesz) would be 32x32/2=512, so 512 is your offset to each consecutive frame of the animation from the base address.

 

Not sure what you were experimenting with adding 32 to your "framesz" variable.

 

Scrolling the worm along seemed to skip through each of the 4 frames in turn OK, but tapping it only seemed to want to show the 4th or 1st frames, maybe your plan was to show one of those always when stopped and that's what you expected.

 

Only thing I'd say now is junk all the debug stuff as it seems to have done its job, and get some decent pad management in to allow you to walk and jump at the same time, then it looks like you have the start of something :0)

 

i was attempting to get it so that when you move left or right and then stop moving it captures that frame number and basically freeze the animation on that frame, then on continuation of moving left or right the animation continues

by setting the various raptor exposed variables, I had quite a bit of trouble getting this to happen, ranging from the sprite using frame 0 constantly after doing what CJ suggested to force the frame to stay on screen (which i got working on the correct frame i had stopped on) to tinkering with the framesz which produced rubbish on any value other than 512 as you say.

 

whether it was the state of my code by then or not (but probably was) the framesz variable was the only variable that seemed to change from moving and not moving, so i used that.

 

perhaps i will attempt a fresh implementation and see if i can get something useful to happen with only CJ's suggestion

 

if the framesz doesn't need to be touched I would prefer another option that works how the engine should be used.

Link to comment
Share on other sites

Auto-animating raptor sprites are handy when that's what you want from them. You don;t want that here, so it's best to avoid them altogether. To have a sprite animate only when it moves and stop on the current frame when no more input is offered, I'd include the graphic with all the frames and set it up as though there was only a single frame - no raptor auto-animation.

 

Your sprite frames are 32x32/2 in size. I'd set up a counter starting at 0 and resetting at number_of_frames-1, increment it each time the correct pad input is registered and set the gfxbase to gfxbase+(counter*sprite frame size). You've got the flipping sorted for left and right so that's no problem. You might want it to look differently when jumping or just stick to a certain frame while flying through the air, so you might want to handle that separately with either another counter and further frames or whatever makes sense depending on what you want to achieve.

Link to comment
Share on other sites

i was suspecting as much with the difficulty i was having :(

seems rather complicated just to achieve the same as temporarily stopping the _curframe and _animspd then re enable them when needed

 

i have been thinking about manual animation already when i started having issues. looks like i will need to write some more mess code to 'attempt to do this.

 

hopefully it will go better than my last venture lol....

 

 

 

also on another note, the object editor I have been working on is taking shape, its not finished yet but it will create working object lists as it is. the object and project database portions need work at the moment but as i do this for a job i dot envisage too many issues.

  • Like 1
Link to comment
Share on other sites

Raptor takes a lot of the boring grunt away from things, you just decided to begin with something it doesn't do and worked against it :0) Doing it manually you'll have a lot more control anyway.

 

The raptor list creator is something we'd all welcome and something that everyone who has had a play with either raptor or rb/+ feels the need for before too long. Good luck with it!

Link to comment
Share on other sites

Raptor takes a lot of the boring grunt away from things, you just decided to begin with something it doesn't do and worked against it :0) Doing it manually you'll have a lot more control anyway.

 

The raptor list creator is something we'd all welcome and something that everyone who has had a play with either raptor or rb/+ feels the need for before too long. Good luck with it!

:thumbsup: that's usually the way I work to be honest, cause myself the maximum amount of effort and battle through it and becoming stronger in that field by the end...

 

 

spoiler:

screen shot of object list editor with loaded dodge.bmp

this image was loaded and the width height and depth and calculation fields were retrieved and worked out for you

post-18126-0-16942800-1441743623_thumb.png

  • Like 2
Link to comment
Share on other sites

The vbi is exposed in the api. I don't know if rB+ allows a vbi routine to run though.

 

Two cooks making different parts of the cake!

 

This particular cook has almost no idea how raptor works, but I generally don't think it's a good idea to have the vbi execute user code (in basic no less!). If you want that flexibility just cut out the middle man and use raptor with assembly!

 

That said, I don't think it's a very hard problem to solve with some simple code in basic? Just don't turn auto animation on and make the main loop something like (warning, pseudo code ahead):

do
    vsync
    call scan_joypad
    if movement=1
        if joypad=left
            animframe=animframe-1
        if joypad=right
            animframe=animframe+1
        endif
        frame_address=sprite_base_frame_address+animframe*frame_length_in_bytes
        rsetobj(my_sprite,R_sprite_gfxbase,frame_address)
    endif
loop

(yes I left out the animframe wrapping, left for an exercise to the reader)

  • Like 3
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...