Circumvent tweening for some objects???

Blitz3D Forums/Blitz3D Programming/Circumvent tweening for some objects???

Skitchy(Posted 2004) [#1]
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?


SabataRH(Posted 2004) [#2]
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




Rob(Posted 2004) [#3]
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.


martonic(Posted 2004) [#4]
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!


Zethrax(Posted 2004) [#5]
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.


Lerc(Posted 2004) [#6]
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.


poopla(Posted 2004) [#7]
You're updating your alpha in the wrong place of the loop.


Michael Reitzenstein(Posted 2004) [#8]
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.