omf Posted September 6, 2015 Share Posted September 6, 2015 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? Quote Link to comment Share on other sites More sharing options...
Sporadic Posted September 6, 2015 Share Posted September 6, 2015 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 Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted September 6, 2015 Share Posted September 6, 2015 Set _curframe to 0 Set _maxframes to 0 Set _gfxbase to the frame you want Quote Link to comment Share on other sites More sharing options...
omf Posted September 6, 2015 Author Share Posted September 6, 2015 ok ill have a go tomorrow when I get home from work ill probably mess it up, we will see! 1 Quote Link to comment Share on other sites More sharing options...
omf Posted September 7, 2015 Author Share Posted September 7, 2015 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 Quote Link to comment Share on other sites More sharing options...
omf Posted September 7, 2015 Author Share Posted September 7, 2015 ok I have made some progress, _framesz is the key Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted September 8, 2015 Share Posted September 8, 2015 ok I have made some progress, _framesz is the key If changing that is your 'solution' I've got NFI what you've done. Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted September 8, 2015 Share Posted September 8, 2015 If changing that is your 'solution' I've got NFI what you've done. Maybe he's manually changing the gfx frame used as in the shootbang example, and using that for the frame offsets? Quote Link to comment Share on other sites More sharing options...
omf Posted September 8, 2015 Author Share Posted September 8, 2015 well i couldnt see a way of doint what i needed to do easily so i dumped all variables to the screen (which killed fps) and that was the only variable that changedso it seems to work. current mess code is attached its all over the place due to trying many many things to get it working platform.rar Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted September 8, 2015 Share Posted September 8, 2015 Well, it works, so it must be ok 2 Quote Link to comment Share on other sites More sharing options...
omf Posted September 8, 2015 Author Share Posted September 8, 2015 Well, it works, so it must be ok 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' Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted September 8, 2015 Share Posted September 8, 2015 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) Quote Link to comment Share on other sites More sharing options...
omf Posted September 8, 2015 Author Share Posted September 8, 2015 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. Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted September 8, 2015 Share Posted September 8, 2015 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. Quote Link to comment Share on other sites More sharing options...
omf Posted September 8, 2015 Author Share Posted September 8, 2015 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. 1 Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted September 8, 2015 Share Posted September 8, 2015 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! Quote Link to comment Share on other sites More sharing options...
omf Posted September 8, 2015 Author Share Posted September 8, 2015 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! 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 2 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 9, 2015 Share Posted September 9, 2015 Can you choose to jump to a subroutine every vblank? That way you could handle the animations and such for the main game and switch to another, more simple subroutine for just displaying a blinking "PAUSE" text. Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted September 9, 2015 Share Posted September 9, 2015 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! 1 Quote Link to comment Share on other sites More sharing options...
omf Posted September 9, 2015 Author Share Posted September 9, 2015 the user object variables are exposed to rb+ though I tested that today after finding it referenced in raptor.h Quote Link to comment Share on other sites More sharing options...
ggn Posted September 10, 2015 Share Posted September 10, 2015 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) 3 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.