Essentially my program creates a skybox and within it is my custom made .x model ship, and a spinning Earth. The ship can be rolled, yawed and pitched and the speed is variable using a 2D sprite for a speed bar which can be controlled with W and S.
I have no idea how to get the collision to work. Simple as.
Setup Function:
Function SetupObject()
AUTOCAM OFF
set global collision on
MAKE CAMERA 1
SET CURRENT CAMERA 1
LOAD OBJECT "Ship.x",3
`Create 2D Bars
`Start Speed Bar
LOAD IMAGE "sprites/spd.png", 100
LOAD IMAGE "sprites/back.png", 101
SPRITE 1, 10, 70, 100
SIZE SPRITE 1, 0, 25
SPRITE 2, 10, 70, 101
SIZE SPRITE 2, 100, 25
SET SPRITE 2, 0, 2
SET SPRITE PRIORITY 2, 1
`End Speed Bar
`Start Hull Bar
LOAD IMAGE "sprites/hul.png", 102
SPRITE 3, 10, 10, 102
SIZE SPRITE 3, 100, 25
SPRITE 4, 10, 10, 101
SIZE SPRITE 4, 100, 25
SET SPRITE 4, 0, 2
SET SPRITE PRIORITY 4, 2
`End Hull Bar
`Start Shield Bar
LOAD IMAGE "sprites/she.png", 103
SPRITE 5, 10, 40, 103
SIZE SPRITE 5, 100, 25
SPRITE 6, 10, 40, 101
SIZE SPRITE 6, 100, 25
SET SPRITE 6, 0, 2
SET SPRITE PRIORITY 6, 3
`End Shield Bar
LOAD OBJECT "sky/Spc/spc.X", 1
SCALE OBJECT 1, 10000, 10000, 10000
POSITION OBJECT 3, 200,0,0
POSITION CAMERA 1, 205, 4, 0
make object collision box 1, -5,-5,-5,5,5,5,0
SCALE OBJECT 3, 2,2,2
LOAD IMAGE "earth.jpg", 1
MAKE OBJECT SPHERE 2, 100
SCALE OBJECT 2, 400,400,400
TEXTURE OBJECT 2, 1
ENDFUNCTION
Rem Speed
Function UpdateSpeed()
IF SCANCODE() = 17 AND SPRITE WIDTH(1) < 100 then
SIZE SPRITE 1, SPRITE WIDTH(1)+1 , 25
IF SCANCODE() = 31 AND SPRITE WIDTH(1) > 0 then
SIZE SPRITE 1, SPRITE WIDTH(1)-1 , 25
ENDFUNCTION
And "Collision" function:
Function CollisionDetect()
set object collision on 1
set object collision on 3
set object collision on 2
set object collision to polygons 3
set object collision to spheres 2
IF OBJECT HIT(3,0) then SIZE SPRITE 3, SPRITE WIDTH(3)-1, 25
ENDFUNCTION
Intel Core i5 3.2 GHz, 4 GB RAM, NVIDIA GeForce 9800 GT
Endangered City. An Endangered Species