Problem with render tween

Blitz3D Forums/Blitz3D Programming/Problem with render tween

Eric Draven(Posted 2004) [#1]
Hi,

I'm using the render tween method (Mark's "castle" demo) to limit the frame rate of my game. Well, the problem is that at some point I need to move a sprite from the left side of the screen (off screen) to the right side using the "PositionEntity" command. As the "RenderWorld tween#" command will render the screen at some state between the current state (my sprite positioned on the right side) and the "CaptureWorld" state (my sprite positioned on the left side) the sprite will blink in the middle of screen for a frame.

How could I avoid that?

PS: Sorry for my bad english.

Thanks.

Douglas Matoso


Jeremy Alessi(Posted 2004) [#2]
When you do that use RenderWorld(1) and it will happen instantly.


Damien Sturdy(Posted 2004) [#3]
i get around it by setting a flag for a frame, and when the system is next captured, go through reseting the flags...

The flag is used to hide an entity while it is moving :)


Eric Draven(Posted 2004) [#4]
Hi,

I found out that you can chage this code:
For k = 1 To ticks
        time = time + period
	If k = ticks
		CaptureWorld
	EndIf
		
	;Update your game
	UpdateGame()
	UpdateWorld
Next


for this:
For k = 1 To ticks
        time = time + period
	
        ;Update your game
	UpdateGame()
        
        If k = ticks
		CaptureWorld
	EndIf
	
	UpdateWorld
Next


The problem is solved.
I hope there's no side effecs for doing this.

Thanks!

Douglas


Damien Sturdy(Posted 2004) [#5]
Sideeffect would be that theres no point in using captureworld as youve already moved all your entities ;) sorry, Eric, thats no good :(