Hello, I am currently a High School student trying to learn the attributes of programming in DarkBasic Professional. I am usuing a previous demo called the LTType demo and I was wondering if anyone could help me with some problem solving.
I am trying to make gravity, but I am unsure if my matrix (the passing landscape) even has a true collision box.
[rem Create landscape
load image "U:\Projects\LTypeDemo\media\ground\desrt.bmp",1
make matrix 1,3000,1500,15,15
prepare matrix texture 1,1,1,1
position matrix 1,-750,-300,0
gosub _newmatrix
Is the current landscape. How would I give it a collision box?
My other question would be how to make gravity.
Rem Player Character
load object "U:\Projects\LTypeDemo\media\ship\monkey.x", 101
scale object 101,100,150,200
position object 101,150,100,0
make object collision box 101,-25,-35,-25,25,35,25,0
load image "U:\Projects\LTypeDemo\media\ship\monkey fur.jpg", 77
texture object 101,0, 77
That is the current main character and the actual mobility controls would be
if upkey()=1 and sx#<350.0 then iy#=6.0 :
if downkey()=1 then iy#=-6.0 : lift=2
if leftkey()=1 and sx#>-450.0 then ix#=-6.0
if rightkey()=1 and sx#<450.0 then ix#=6.0
if spacekey ()= 1 then p1y# = p1y# + mypower
ix#=ix#/1.2 : iy#=iy#/1.2
syx#=sx#+ix# : sy#=sy#+iy#
position object 101,p1x#,p1y#,500
So basically my main questions would be how to make a collision box for a randomly generated matrix and how to create gravity when I get this collision working (if possible).
To innovate the world.