; LoadSprite Example ; ------------------ Graphics3D 640,480,0,2 SetBuffer BackBuffer() camera=CreateCamera() PositionEntity camera,0,1,-5 light=CreateLight() RotateEntity light,45,45,0 ground=CreatePlane() EntityTexture ground,LoadTexture("media/MossyGround.BMP") ; LoadSprite creates a sprite and textures it in one call - here a ; floating logo pickup for our game world logo=LoadSprite("media/b3dlogo.jpg") ScaleSprite logo,1,0.5 PositionEntity logo,0,1.5,0 bob#=0 While Not KeyDown(1) ; Bob the pickup up and down so the scene feels alive bob=bob+2 PositionEntity logo,0,1.5+Sin(bob)*0.3,0 ; Arrow keys move the camera If KeyDown(200) Then MoveEntity camera,0,0,0.1 If KeyDown(208) Then MoveEntity camera,0,0,-0.1 If KeyDown(203) Then TurnEntity camera,0,1,0 If KeyDown(205) Then TurnEntity camera,0,-1,0 RenderWorld Text 0,0,"Arrows: move camera Esc: exit" Text 0,20,"LoadSprite loaded a textured sprite - orbit it: it always faces you" Flip Wend End