moving entity with mouse()

Blitz3D Forums/Blitz3D Programming/moving entity with mouse()

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.

Sorry for not replying sooner lol but try this joker

u will need a bitmap for the ground

Graphics3D 800,600,16,1
SetBuffer BackBuffer()

light=CreateLight()

Collisions 3,2,2,2

Global pointer = CreateSphere()
ScaleEntity pointer,.5,.5,.5
EntityColor pointer,0,256,0
EntityType pointer,2

Global cube=CreateCube()
EntityRadius cube,2,2
EntityType cube,3

Global cam=CreateCamera(pointer)
CameraRange cam,.1,1000
TurnEntity cam,0,0,0
RotateEntity cam,45,0,0
EntityType cam,2
PositionEntity cam,0,80,-80

pl=CreatePlane()
tex=LoadTexture("grass3.bmp")
ScaleTexture tex,64,64
EntityTexture pl,tex
EntityOrder pl,1
EntityFX pl,1
EntityType pl,1
EntityPickMode pl,2
ScaleEntity pl,1,1,1

While Not KeyDown(1)



If MouseDown(1)=True

picked=CameraPick(cam,MouseX(),MouseY())

PositionEntity pointer,PickedX(),0,PickedZ()

MoveEntity cube,0,0,pz+1


EndIf

movebloke()

UpdateWorld
RenderWorld


Flip

Wend

End

Function movebloke()

mx#=MouseXSpeed()*0.2
my#=-MouseYSpeed()*0.2

MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
MoveEntity pointer,mx,0,my

PointEntity cube,pointer

End Function

Oh and if any of u code wizards can improve this pls post it back in this thread

Thanks

GIMPY :)