Stopping an entity at a certain point of rotation?

Blitz3D Forums/Blitz3D Beginners Area/Stopping an entity at a certain point of rotation?

po(Posted 2004) [#1]
I am making a slot machine game (3D) using textured cylinders as the spinning things. It first starts off with the cylinders spinning and you have to press space to stop each one, but what I need to do is so when you press space it stops on a certain part of the texture(instead of it stopping in between a 7 and a BAR or some other place). Each texture part is 90 degrees apart and there are 4 parts so I would need to make it stop within one of 4 90 degree areas. Ermm... I hope I explained it well enough.

Heres some code:
Graphics3D 800,600,32,2

cam=CreateCamera()
PositionEntity cam,0,0,-3

light=CreateLight()

slot=CreateCylinder()
PositionEntity slot,0,0,0
RotateEntity slot,0,0,90

turning=True

While Not KeyHit(1)

	If turning=True Then 
	
		TurnEntity slot,0,7,0
	
	EndIf
	
	If KeyDown(57) Then 
		
		turning=False
		
	EndIf
	
	UpdateWorld
	RenderWorld
	Flip

Wend



WolRon(Posted 2004) [#2]
If you prefer to use TurnEntity then you can use the EntityPitch, or EntityYaw, or EntityRoll commands to find out the current state of the entity.

Or you could just use the RotateEntity command and then you would automatically know what rotation the entity is at since you are the one setting it.