Using a dropship

Blitz3D Forums/Blitz3D Programming/Using a dropship

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Does this help get you going? The shortcuts for the purposes of demonstration are commented, you should be able to see the main cost (multiple updateworld's) immediately...

Slide-response Blitz collision against a rising mesh on an increasing angle.
Graphics3D 640,480,0,3
SetBuffer BackBuffer()



level=CreateCube()
cam=CreateCamera()
PositionEntity cam,0,5,-5;10
light=CreateLight()
PositionEntity light,10,10,0

player=CreateCube()
ScaleEntity player,.1,.1,.1
EntityRadius player,.1
PositionEntity player,1,10,0


EntityType player,1
EntityType level,2
Collisions 1,2,2,2

While Not KeyDown(1)

;apply gravity to the player
TranslateEntity player,0,-.1,0

;update the world
UpdateWorld


;did player collide with level
;if so then make player child of level
If CountCollisions(player)>0; you would normally check which entity but we KNOW it's the level here
	RotateEntity player,EntityPitch(level,True),EntityYaw(level,True),EntityRoll(level,True),True;should get level normals instead and apply appropriately
	EntityParent player,level 	
EndIf

;move level
TranslateEntity level,.005,0.005,0
If EntityRoll(level)<5 Then TurnEntity level,0,0,.02

;free player from parent
EntityParent player,0

;updateworld
UpdateWorld
;render
RenderWorld



Flip True
Wend