Well; here is the beginnings of a movement engine, W&S to go forward and back, mouse to look around and manoeuvre. You will need the maincharacter.x that can be found here:
http://forum.thegamecreators.com/xt/xt_apollo_download.php?i=1071739
I really hope people will add to this; I just coded it because I'm totally new to DarkBASIC; I'm currently a C++ programmer and just wanted to delve right in, so this is what I came up with. The mouse camera movement function is from the codebase, because I couldn't work out how to do that myself.
I really hope people will add to it, would be kinda cool to see the game actually take shape; and would be a great learning tool for me.
`Grand Theft Sphere
`A community project from the idea of "wickedly kick it"
`Contributors:
`SirRoss - Movement control
`Early config
Global Variables
Global hAngle# As Integer
Global vAngle# As Integer
Position Camera x,y,z
Hide Mouse
GoSub _createworld
Sync On
_createworld:
`Creating the floor plane
Make Matrix 1,1000,1000,10,10
`Colour the matrix green
Cls RGB(10,244,10)
Ink RGB(60,185,10),0
For a=1 to 6000
Dot Rnd(100),Rnd(100)
Next a
Get Image 1,0,0,100,100
Cls RGB(0,0,0)
Prepare Matrix Texture 1,1,16,16
`Update the Matrix
Update Matrix 1
`Create main character
Load Object "maincharacter.x", 1
GoSub _ballcontrol
Return
`Controls
_ballcontrol:
Do
`-Control Camera-
`PARAMETERS:
`Your Characters X Position, Char Y Position, Char Z Position, How far outwards the camera should be,
`how high the camera should be (what the mouses Y is), how fast the cam moves around (how much the user moves their mouse), which camera
if Keystate(17)=1 then Move Object 1,4
if Keystate(31)=1 then Move Object 1,-4
if Keystate(28)=1 then Position Object 1,x,y,z
MouseLook(Object Position X(1), Object Position Y(1), Object Position Z(1), 150.0, MouseMoveY(), MouseMoveX())
Sync
Loop
Return
Function MouseLook(xTarget, yTarget, zTarget, hDist#, vDist#, Speed#)
`Continue from where we last were
hAngle# = hAngle# + Speed#
vAngle# = vAngle# + vDist#
`Tricky part: Make a 'circular' camera movement
zPos# = zTarget + cos(hAngle#) * hDist#
yPos# = yTarget + vAngle#
xPos# = xTarget + sin(hAngle#) * hDist#
`Position Camera in it's new place and point it at our main character
Position Camera xPos#, yPos#, zPos#
Point Camera xTarget, yTarget, zTarget
`Usually you'll want the camera just a tad higher then the char, so do that now
Position Camera xPos#, yPos# + 10, zPos#
`Point our Main Character in the same direction as our camera
Rotate Object 1, Object Angle X(1), Camera Angle Y(), Object Angle Z(1)
EndFunction
EDIT: I'll be adding in control over a rough surface later today.
The Microsoft Motto: Hey! It compiles! Ship it!