2D with Blitz3D

Blitz3D Forums/Blitz3D Programming/2D with Blitz3D

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

same example without errors:
Graphics3D 640,480
AutoMidHandle True
light=CreateLight() 
RotateEntity light,90,0,0 

Global p_alpha#=.5

type_ground=1 
type_character=2
type_charactershield=4 
 
type_scenery=3 

p_pivot=CreatePivot()
EntityRadius p_pivot,2.4
PositionEntity p_pivot,0,4,0
plane=CreatePlane()
EntityColor plane,200,100,0

cube = CreateCube(p_pivot)
EntityRadius cube,2.4 

sphere = CreateSphere(16,p_pivot)
EntityRadius sphere,2 
ScaleEntity sphere,2,2,2
EntityAlpha sphere,p_alpha#
PositionEntity sphere,0,0,0
PositionEntity cube,0,0,0
cam = CreateCamera(p_pivot)
PositionEntity cam,0,1,10
PointEntity cam,cube

EntityType sphere,type_charactershield
EntityType cube,type_character
EntityType plane,type_ground
EntityType p_pivot,type_character



 
 shieldsgone=True   

Global red=CreateCube()
EntityType red,type_scenery

background()

;Collisions type_character,type_scenery,method,response 
Collisions type_character,type_scenery,2,2 
Collisions type_character,type_ground,2,1 
Collisions type_charactershield,type_ground,2,1 

While Not KeyHit(1)
	TurnEntity sphere,5,5,0
	If KeyDown(200) TranslateEntity p_pivot,0,.5,0
	If KeyDown(208) TranslateEntity p_pivot,0,-.5,0
	If KeyDown(203) TranslateEntity p_pivot,.5,0,0
	If KeyDown(205) TranslateEntity p_pivot,-.5,0,0
	
	If KeyDown(30) TurnEntity cam,0,.5,0
	If KeyDown(32) TurnEntity cam,0,-.5,0
	If KeyDown(17) TurnEntity cam,.5,0,0
	If KeyDown(31) TurnEntity cam,-.5,0,0
	
	If EntityCollided (p_pivot,type_ground) Then
		p_alpha#=p_alpha#-.001
		EntityAlpha sphere,p_alpha#
	EndIf 
	
	If KeyHit(57) Then
	    
		p_alpha#=.5 
		EntityAlpha sphere,p_alpha#
	EndIf 
	
	RenderWorld()
	UpdateWorld()
	Flip


Wend
End

Function background()
	ScaleEntity red,10,10,1
	RotateEntity red,0,90,0
	EntityColor red,200,10,10
	PositionEntity red,4,0,-7
End Function