Sprite System Update Released

BlitzMax Forums/BlitzMax Programming/Sprite System Update Released

sswift(Posted 2008) [#1]
If you've purchased the system, you should get an email with the update in it shortly.

Here are the issues that have been corrected:



1. Fog was brightening objects instead of fogging them.


2. Animations were ending one frame too early, and triggering one or two frames too early.


This was due to updating the animation to set the sprite's parameters to the first of the two values. Doing this triggered the animation, or reduced the trigger time. Then, at the end of the frame, when you update the sprites, the animations were updated, which added additional time to the animation which should have just begun and positioned it at the new position, or added time to the trigger time, which had already had the requisite amount of time added for the current frame.


Now, there is a separate function which sets a sprite's parameters given a tween value, so I call that instead to set up the sprite, and let the actual triggering of the animation occur when you actually call the sprite update function.




It is possible that these changes will result in issues with your code. Read the updates section of the comments for details on how to get the same effect you were getting if you were using the broken fogging code. Hopefully the new corrected animation timing won't cause any problems for you. The only issue I can see is that now before you call the sprite update function, checking to see if an animation has been triggered for an animation you have just created which has a trigger time of 0, will return false, as it is now not triggered until you call that function. I don't see any obvious reason why this would cause an issue though, and it does not seem to have caused any problems in my own game.