Graphics3D 600,600,32,2 SetBuffer BackBuffer() Const tbob=1 Const tcoin=2 Type coin Field entity Field colision End Type camera=CreateCamera() CameraClsColor camera,0,100,100 l=CreateLight() PositionEntity camera,5,5,-15 base_coin=CreateSphere() EntityColor base_coin,100,100,0 ScaleEntity base_coin,.1,.5,.5 EntityShininess base_coin,1 HideEntity base_coin bob=CreateSphere() PositionEntity bob,-3,0,0 EntityColor bob,0,100,100 EntityType bob,tbob Collisions tbob,tcoin,1,1 For x=0 To 5 For y=0 To 5 c.coin=New coin c\entity=CopyEntity(base_coin) PositionEntity c\entity,x*3,y*3,0 EntityType c\entity,tcoin Next Next While Not KeyHit(1) CollidedEntity=EntityCollided(bob,tcoin) If CollidedEntity<>0 Then For c.coin=Each coin If CollidedEntity=c\Entity Then ;c\colision=CountCollisions(bob) ;? ;If c\colision>0 FreeEntity c\entity Delete c collectball=collectball+1 ;EndIf End If Next End If If KeyDown(205) MoveEntity bob,.2,0,0 If KeyDown(203) MoveEntity bob,-.2,0,0 If KeyDown(200) MoveEntity bob,0,.2,0 If KeyDown(208) MoveEntity bob,0,-.2,0 For c.coin=Each coin TurnEntity c\entity,1,1,1 Next colidecount=CountCollisions(bob) RenderWorld UpdateWorld Text 0,0,"Use arrow keys to control Bob" Text 0,12,"colision count on Bob = "+colidecount Text 400,0,"Gold Coins Collected = "+collectball Flip Wend End