2. I'm with you now. My code only needs slight modification for that, replacing the y movement with the z movement. See the modified code below.
nX# = 0.0
nY# = 0.0
nZ# = 0.0
make object cube 1,2
position object 1,nX#,nY#,nZ#
position camera 0,5,-5
point camera 0,0,0
do
if upkey()
nZ# = nZ# + 0.1
position object 1,nX#,nY#,nZ#
wait 10
endif
if downkey()
nZ# = nZ# - 0.1
position object 1,nX#,nY#,nZ#
wait 10
endif
if leftkey()
nX# = nX# - 0.1
position object 1,nX#,nY#,nZ#
wait 10
endif
if rightkey()
nX# = nX# + 0.1
position object 1,nX#,nY#,nZ#
wait 10
endif
loop
As for jumping, I imagine there would be a number of ways of achieving that. The code below modifies my existing code to show an example. If works by flipping a jump boolean when you hit the spacebar and then if that boolean (bJump) is set to true, the program handles some automatic movement on the y axis until the jump is complete.
#constant MAXHEIGHT 1
bJump as boolean = 0
bUp as boolean = 1
nX# = 0.0
nY# = 0.0
nZ# = 0.0
make object cube 1,2
position object 1,nX#,nY#,nZ#
position camera 0,5,-5
point camera 0,0,0
do
if upkey()
nZ# = nZ# + 0.1
position object 1,nX#,nY#,nZ#
endif
if downkey()
nZ# = nZ# - 0.1
position object 1,nX#,nY#,nZ#
endif
if leftkey()
nX# = nX# - 0.1
position object 1,nX#,nY#,nZ#
endif
if rightkey()
nX# = nX# + 0.1
position object 1,nX#,nY#,nZ#
endif
if spacekey()
if bUp
bJump = 1
endif
endif
if bJump
if bUp
if nY# < MAXHEIGHT
nY# = nY# + 0.1
else
bUp = 0
endif
else
if nY# > 0
nY# = nY# - 0.1
else
bJump = 0
bUp = 1
endif
endif
position object 1,nX#,nY#,nZ#
endif
wait 10
loop
3. If that doesn't work, there are a number of solutions. I tend to use this rather heavy weight text over sprite algorithm but you should only really use this for one of bits of text like printing loading to the screen. Otherwise it will slow you down a lot. Code below.
TextOverSprite(1,screen width() / 2,(screen height() / 4) * 3,"Loading...")
wait key
end
function TextOverSprite(nSpriteNumber,nX,nY,sText$)
create bitmap 1,screen width(),screen height()
text 0,0,sText$
get image nSpriteNumber,0,0,text width(sText$) + 1,text height(sText$) + 1,1
delete bitmap 1
sprite nSpriteNumber,nX,nY,nSpriteNumber
offset sprite nSpriteNumber,sprite width(nSpriteNumber) / 2,sprite height(nSpriteNumber) / 2
sprite nSpriteNumber,nX,nY,nSpriteNumber
set sprite priority nSpriteNumber,5
show sprite nSpriteNumber
endfunction
4. Still not really sure about this but I think that you probably can't use them unless they generate dbp code which you could copy into the ide or something..
5. Yes. The commands are object position x, object position y and object position z. This example shows how you could use these in the example above.
#constant MAXHEIGHT 1
bJump as boolean = 0
bUp as boolean = 1
nX# = 0.0
nY# = 0.0
nZ# = 0.0
sync on
make object cube 1,2
position object 1,nX#,nY#,nZ#
position camera 0,5,-5
point camera 0,0,0
do
if upkey()
nZ# = nZ# + 0.1
position object 1,nX#,nY#,nZ#
endif
if downkey()
nZ# = nZ# - 0.1
position object 1,nX#,nY#,nZ#
endif
if leftkey()
nX# = nX# - 0.1
position object 1,nX#,nY#,nZ#
endif
if rightkey()
nX# = nX# + 0.1
position object 1,nX#,nY#,nZ#
endif
if spacekey()
if bUp
bJump = 1
endif
endif
if bJump
if bUp
if nY# < MAXHEIGHT
nY# = nY# + 0.1
else
bUp = 0
endif
else
if nY# > 0
nY# = nY# - 0.1
else
bJump = 0
bUp = 1
endif
endif
position object 1,nX#,nY#,nZ#
endif
text 0,0,str$(object position x(1)) + "," + str$(object position y(1)) + "," + str$(object position z(1))
sync
wait 10
loop
Note the line
text 0,0,str$(object position x(1)) + "," + str$(object position y(1)) + "," + str$(object position z(1))
Hope this help. Keep posting if it is still unclear.