Circumvent tweening for some objects???
Blitz3D Forums/Blitz3D Programming/Circumvent tweening for some objects???
I'm using the standard tweening code from the castle demo. It works fine - but that's the problem ;)
See, what I want to do is have an object jump *instantly* from one point to another. With tweening, you often get a nasty 'in between' frame where the object appears for a split second (1 frame) to be somewhere between the 2 positions. Is there an easy way to do this that I'm overlooking?
Try this Captureworld() free tween func() from Vb:
Const UPS=60
period=1000/UPS
time=MilliSecs()-period
Repeat
Repeat
elapsed=MilliSecs()-time
Until elapsed
ticks=elapsed/period
tween#=Float(elapsed Mod period)/Float(period)
For k=1 To ticks
time=time+period
UpdateWorld
Next
RenderWorld tween
Flip
Until Keydown(1)=True
You should be able to queue up moves to a list (types or something), then move the lot, then perform a quick captureworld...
Not sure if it'll work but it is better than constant captureworlds which will throw off tweening on other objects.
HI! I'm still new to this stuff, but I think it will help to hide the object, move it, then show it again. Good luck!
We really need a 'CaptureTweenEntity' or 'ResetTweenEntity' command to do for tweening what 'ResetEntity' does for collisions (re-primes the state data).
But I'm all done with feature requests.
I've been having similar issues. The first time I had a problem with this was when I made something with an alpha of zero and faded it in. The object had a default alpha of 1 so the tween caused a brief flicker as it jumped down to zero. I submitted a report about that specific instance then.
Now I'm finding the same basic problem turning up in numerous places. It does appear necessary to have a CaptureEntity command to fix this. It shouldn't be hard to implement either.
You're updating your alpha in the wrong place of the loop.
No he isn't. The default captured alpha of an entity is 1.0, so until CaptureWorld is called after the creation of the entity, the system will tween from 1.0.