Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Help with flight simulator 3D radar

Author
Message
ichaelm
18
Years of Service
User Offline
Joined: 23rd Aug 2006
Location:
Posted: 25th Aug 2006 15:52
I am trying to make a space flight simulator that has a little indicator in a corner of the screen that tells you what directon you need to turn to face your target. I know I need to make an invisible object that is in the same position as your ship but points to your target. Then I need to compare the orientation of the pointer with the orientation of the ship (the camera). But, when I use the "camera angle y()" functon, some weird glitch happens.
[img]C:/Documents and Settings/Michael/Desktop/Temporary/diagram.gif[/img]

`create world
randomize timer()
autocam off
center text 320,240,"Loading, please wait...."
position mouse 320,240
hide mouse
sync on
sync
dim missilemove(10)
dim bullet#(100)
position camera 0,0,0
speed#=0
load bitmap "grass-3.bmp",1
get image 1,0,0,256,256
delete bitmap 1
load bitmap "bmp/target.bmp",2
get image 2,0,0,64,64
delete bitmap 2
load bitmap "bmp/meter.bmp",3
get image 3,0,0,16,128
delete bitmap 3
load bitmap "bmp/meterpointer.bmp",4
get image 4,0,0,16,16
delete bitmap 4
load bitmap "bmp/example2.bmp",5
get image 5,0,0,276,260
delete bitmap 5
make object sphere 2,50
make object cube 100,5
make object sphere 1,20
position object 2,-1000,2500,-1550
position object 100,0,0,500
position light 0,1000,2500,1000
set light range 0,15000
set ambient light 50
texture object 2,1
set camera range 1,6000
make object sphere 3,11
position object 3,-500,104,-500
color object 3,rgb(255,0,0)
color object 100,rgb(0,255,0)
make light 1
make light 2
make light 3
make light 4
make light 5
make light 6
position light 1,500,115.5,500
position light 2,500,-96.5,500
position light 3,511.5,104,500
position light 4,488.5,104,500
position light 5,500,104,511.5
position light 6,500,104,488.5
for x=4 to 19
make object sphere x,0.1
next x
position object 4,2,2,rnd(90)-40
position object 5,-2,2,rnd(90)-40
position object 6,2,-2,rnd(90)-40
position object 7,-2,-2,rnd(90)-40
position object 8,1,2.75,rnd(90)-40
position object 9,0,3.5,rnd(90)-40
position object 10,-1,2.75,rnd(90)-40
position object 11,1,-2.75,rnd(90)-40
position object 12,0,-3.25,rnd(90)-40
position object 13,-1,-2.75,rnd(90)-40
position object 14,2.75,-1,rnd(90)-40
position object 15,3.25,0,rnd(90)-40
position object 16,2.75,1,rnd(90)-40
position object 17,-2.75,1,rnd(90)-40
position object 18,-3.25,0,rnd(90)-40
position object 19,-2.75,-1,rnd(90)-40
xtarget=-1000
ytarget=2500
ztarget=-1550
earthlife=100
obj0life=200
health=128
color backdrop rgb(0,0,0)
DO
`pitch controls
if upkey()=1
pitch#=pitch#-0.1
endif
if downkey()=1
pitch#=pitch#+0.1
endif
`turn controls
if leftkey()=1
turn#=turn#-0.1
endif
if rightkey()=1
turn#=turn#+0.1
endif
`roll controls
if keystate(51)=1
roll#=roll#-0.1
endif
if keystate(52)=1
roll#=roll#+0.1
endif
`speed controls
if keystate(12)=1
speed#=speed#-0.01
endif
if keystate(13)=1
speed#=speed#+0.01
endif
`speed limits
if speed#<0 then speed#=0
if speed#>4 then speed#=4
if pitch#<-3 then pitch#=-3
if pitch#>3 then pitch#=3
if turn#<-3 then turn#=-3
if turn#>3 then turn#=3
if roll#<-3 then roll#=-3
if roll#>3 then roll#=3
`plane object
position object 1,xplane,yplane,zplane
set object to camera orientation 1
`move
move camera speed#
pitch camera up pitch#
turn camera right turn#
roll camera right roll#
`variables
xplane#=camera position x()
yplane#=camera position y()
zplane#=camera position z()
xangleplane#=camera angle x()
yangleplane#=camera angle y()
zangleplane#=camera angle z()
`fricton
if downkey()=0 and upkey()=0 and pitch#>0 then pitch#=pitch#-0.1
if downkey()=0 and upkey()=0 and pitch#<0 then pitch#=pitch#+0.1
if leftkey()=0 and rightkey()=0 and turn#>0 then turn#=turn#-0.1
if leftkey()=0 and rightkey()=0 and turn#<0 then turn#=turn#+0.1
if keystate(51)=0 and keystate(52)=0 and roll#>0 then roll#=roll#-0.1
if keystate(51)=0 and keystate(52)=0 and roll#<0 then roll#=roll#+0.1
if pitch#<0.1 and pitch#>-0.1 then pitch#=0
if turn#<0.1 and turn#>-0.1 then turn#=0
if roll#<0.1 and roll#>-0.1 then roll#=0
`parameters
if camera position x()>3000
position camera 3000,yplane,zplane
endif
if camera position x()<-3000
position camera -3000,yplane,zplane
endif
if camera position y()>3000
position camera xplane,3000,zplane
endif
if camera position y()<-3000
position camera xplane,-3000,zplane
endif
if camera position z()>3000
position camera xplane,yplane,3000
endif
if camera position z()<-3000
position camera xplane,yplane,-3000
endif
`dust
for dust=4 to 19
if object in screen(dust)=0
position object dust,xplane#+rnd(100)-50,yplane#+rnd(100)-50,zplane#+rnd(100)-50
endif
next dust
`destroy object if dead
if earthlife=0
delete object 2
earthlife=-1
endif
if obj0life=0
delete object 100
obj0life=-1
endif
`destroy you if dead
if health=0 then end
`timer
timer=timer+1
`print
set cursor 0,0
print "Scancode: ",scancode()
print "Speed: ",(speed#*25)
paste image 3,0,346
paste image 4,16,(480-(speed#*32)-14)
print "x angle: ",xangleplane#
print "y angle: ",yangleplane#
print "z angle: ",zangleplane#
`syncronize screen
sync
LOOP
ichaelm
18
Years of Service
User Offline
Joined: 23rd Aug 2006
Location:
Posted: 25th Aug 2006 18:43
I am trying to make a space flight simulator that has a little indicator in a corner of the screen that tells you what directon you need to turn to face your target. I know I need to make an invisible object that is in the same position as your ship but points to your target. Then I need to compare the orientation of the pointer with the orientation of the ship (the camera). But, when I use the "camera angle y()" functon, some weird glitch happens.
C:/Documents and Settings/Michael/Desktop/Temporary/diagram.gif

`create world
randomize timer()
autocam off
center text 320,240,"Loading, please wait...."
position mouse 320,240
hide mouse
sync on
sync
dim missilemove(10)
dim bullet#(100)
position camera 0,0,0
speed#=0
load bitmap "grass-3.bmp",1
get image 1,0,0,256,256
delete bitmap 1
load bitmap "bmp/target.bmp",2
get image 2,0,0,64,64
delete bitmap 2
load bitmap "bmp/meter.bmp",3
get image 3,0,0,16,128
delete bitmap 3
load bitmap "bmp/meterpointer.bmp",4
get image 4,0,0,16,16
delete bitmap 4
load bitmap "bmp/example2.bmp",5
get image 5,0,0,276,260
delete bitmap 5
make object sphere 2,50
make object cube 100,5
make object sphere 1,20
position object 2,-1000,2500,-1550
position object 100,0,0,500
position light 0,1000,2500,1000
set light range 0,15000
set ambient light 50
texture object 2,1
set camera range 1,6000
make object sphere 3,11
position object 3,-500,104,-500
color object 3,rgb(255,0,0)
color object 100,rgb(0,255,0)
make light 1
make light 2
make light 3
make light 4
make light 5
make light 6
position light 1,500,115.5,500
position light 2,500,-96.5,500
position light 3,511.5,104,500
position light 4,488.5,104,500
position light 5,500,104,511.5
position light 6,500,104,488.5
for x=4 to 19
make object sphere x,0.1
next x
position object 4,2,2,rnd(90)-40
position object 5,-2,2,rnd(90)-40
position object 6,2,-2,rnd(90)-40
position object 7,-2,-2,rnd(90)-40
position object 8,1,2.75,rnd(90)-40
position object 9,0,3.5,rnd(90)-40
position object 10,-1,2.75,rnd(90)-40
position object 11,1,-2.75,rnd(90)-40
position object 12,0,-3.25,rnd(90)-40
position object 13,-1,-2.75,rnd(90)-40
position object 14,2.75,-1,rnd(90)-40
position object 15,3.25,0,rnd(90)-40
position object 16,2.75,1,rnd(90)-40
position object 17,-2.75,1,rnd(90)-40
position object 18,-3.25,0,rnd(90)-40
position object 19,-2.75,-1,rnd(90)-40
xtarget=-1000
ytarget=2500
ztarget=-1550
earthlife=100
obj0life=200
health=128
color backdrop rgb(0,0,0)
DO
`pitch controls
if upkey()=1
pitch#=pitch#-0.1
endif
if downkey()=1
pitch#=pitch#+0.1
endif
`turn controls
if leftkey()=1
turn#=turn#-0.1
endif
if rightkey()=1
turn#=turn#+0.1
endif
`roll controls
if keystate(51)=1
roll#=roll#-0.1
endif
if keystate(52)=1
roll#=roll#+0.1
endif
`speed controls
if keystate(12)=1
speed#=speed#-0.01
endif
if keystate(13)=1
speed#=speed#+0.01
endif
`speed limits
if speed#<0 then speed#=0
if speed#>4 then speed#=4
if pitch#<-3 then pitch#=-3
if pitch#>3 then pitch#=3
if turn#<-3 then turn#=-3
if turn#>3 then turn#=3
if roll#<-3 then roll#=-3
if roll#>3 then roll#=3
`plane object
position object 1,xplane,yplane,zplane
set object to camera orientation 1
`move
move camera speed#
pitch camera up pitch#
turn camera right turn#
roll camera right roll#
`variables
xplane#=camera position x()
yplane#=camera position y()
zplane#=camera position z()
xangleplane#=camera angle x()
yangleplane#=camera angle y()
zangleplane#=camera angle z()
`fricton
if downkey()=0 and upkey()=0 and pitch#>0 then pitch#=pitch#-0.1
if downkey()=0 and upkey()=0 and pitch#<0 then pitch#=pitch#+0.1
if leftkey()=0 and rightkey()=0 and turn#>0 then turn#=turn#-0.1
if leftkey()=0 and rightkey()=0 and turn#<0 then turn#=turn#+0.1
if keystate(51)=0 and keystate(52)=0 and roll#>0 then roll#=roll#-0.1
if keystate(51)=0 and keystate(52)=0 and roll#<0 then roll#=roll#+0.1
if pitch#<0.1 and pitch#>-0.1 then pitch#=0
if turn#<0.1 and turn#>-0.1 then turn#=0
if roll#<0.1 and roll#>-0.1 then roll#=0
`parameters
if camera position x()>3000
position camera 3000,yplane,zplane
endif
if camera position x()<-3000
position camera -3000,yplane,zplane
endif
if camera position y()>3000
position camera xplane,3000,zplane
endif
if camera position y()<-3000
position camera xplane,-3000,zplane
endif
if camera position z()>3000
position camera xplane,yplane,3000
endif
if camera position z()<-3000
position camera xplane,yplane,-3000
endif
`dust
for dust=4 to 19
if object in screen(dust)=0
position object dust,xplane#+rnd(100)-50,yplane#+rnd(100)-50,zplane#+rnd(100)-50
endif
next dust
`destroy object if dead
if earthlife=0
delete object 2
earthlife=-1
endif
if obj0life=0
delete object 100
obj0life=-1
endif
`destroy you if dead
if health=0 then end
`timer
timer=timer+1
`print
set cursor 0,0
print "Scancode: ",scancode()
print "Speed: ",(speed#*25)
paste image 3,0,346
paste image 4,16,(480-(speed#*32)-14)
print "x angle: ",xangleplane#
print "y angle: ",yangleplane#
print "z angle: ",zangleplane#
`syncronize screen
sync
LOOP
ichaelm
18
Years of Service
User Offline
Joined: 23rd Aug 2006
Location:
Posted: 25th Aug 2006 18:43
I am trying to make a space flight simulator that has a little indicator in a corner of the screen that tells you what directon you need to turn to face your target. I know I need to make an invisible object that is in the same position as your ship but points to your target. Then I need to compare the orientation of the pointer with the orientation of the ship (the camera). But, when I use the "camera angle y()" functon, some weird glitch happens.
C:/Documents and Settings/Michael/Desktop/Temporary/diagram.gif

`create world
randomize timer()
autocam off
center text 320,240,"Loading, please wait...."
position mouse 320,240
hide mouse
sync on
sync
dim missilemove(10)
dim bullet#(100)
position camera 0,0,0
speed#=0
load bitmap "grass-3.bmp",1
get image 1,0,0,256,256
delete bitmap 1
load bitmap "bmp/target.bmp",2
get image 2,0,0,64,64
delete bitmap 2
load bitmap "bmp/meter.bmp",3
get image 3,0,0,16,128
delete bitmap 3
load bitmap "bmp/meterpointer.bmp",4
get image 4,0,0,16,16
delete bitmap 4
load bitmap "bmp/example2.bmp",5
get image 5,0,0,276,260
delete bitmap 5
make object sphere 2,50
make object cube 100,5
make object sphere 1,20
position object 2,-1000,2500,-1550
position object 100,0,0,500
position light 0,1000,2500,1000
set light range 0,15000
set ambient light 50
texture object 2,1
set camera range 1,6000
make object sphere 3,11
position object 3,-500,104,-500
color object 3,rgb(255,0,0)
color object 100,rgb(0,255,0)
make light 1
make light 2
make light 3
make light 4
make light 5
make light 6
position light 1,500,115.5,500
position light 2,500,-96.5,500
position light 3,511.5,104,500
position light 4,488.5,104,500
position light 5,500,104,511.5
position light 6,500,104,488.5
for x=4 to 19
make object sphere x,0.1
next x
position object 4,2,2,rnd(90)-40
position object 5,-2,2,rnd(90)-40
position object 6,2,-2,rnd(90)-40
position object 7,-2,-2,rnd(90)-40
position object 8,1,2.75,rnd(90)-40
position object 9,0,3.5,rnd(90)-40
position object 10,-1,2.75,rnd(90)-40
position object 11,1,-2.75,rnd(90)-40
position object 12,0,-3.25,rnd(90)-40
position object 13,-1,-2.75,rnd(90)-40
position object 14,2.75,-1,rnd(90)-40
position object 15,3.25,0,rnd(90)-40
position object 16,2.75,1,rnd(90)-40
position object 17,-2.75,1,rnd(90)-40
position object 18,-3.25,0,rnd(90)-40
position object 19,-2.75,-1,rnd(90)-40
xtarget=-1000
ytarget=2500
ztarget=-1550
earthlife=100
obj0life=200
health=128
color backdrop rgb(0,0,0)
DO
`pitch controls
if upkey()=1
pitch#=pitch#-0.1
endif
if downkey()=1
pitch#=pitch#+0.1
endif
`turn controls
if leftkey()=1
turn#=turn#-0.1
endif
if rightkey()=1
turn#=turn#+0.1
endif
`roll controls
if keystate(51)=1
roll#=roll#-0.1
endif
if keystate(52)=1
roll#=roll#+0.1
endif
`speed controls
if keystate(12)=1
speed#=speed#-0.01
endif
if keystate(13)=1
speed#=speed#+0.01
endif
`speed limits
if speed#<0 then speed#=0
if speed#>4 then speed#=4
if pitch#<-3 then pitch#=-3
if pitch#>3 then pitch#=3
if turn#<-3 then turn#=-3
if turn#>3 then turn#=3
if roll#<-3 then roll#=-3
if roll#>3 then roll#=3
`plane object
position object 1,xplane,yplane,zplane
set object to camera orientation 1
`move
move camera speed#
pitch camera up pitch#
turn camera right turn#
roll camera right roll#
`variables
xplane#=camera position x()
yplane#=camera position y()
zplane#=camera position z()
xangleplane#=camera angle x()
yangleplane#=camera angle y()
zangleplane#=camera angle z()
`fricton
if downkey()=0 and upkey()=0 and pitch#>0 then pitch#=pitch#-0.1
if downkey()=0 and upkey()=0 and pitch#<0 then pitch#=pitch#+0.1
if leftkey()=0 and rightkey()=0 and turn#>0 then turn#=turn#-0.1
if leftkey()=0 and rightkey()=0 and turn#<0 then turn#=turn#+0.1
if keystate(51)=0 and keystate(52)=0 and roll#>0 then roll#=roll#-0.1
if keystate(51)=0 and keystate(52)=0 and roll#<0 then roll#=roll#+0.1
if pitch#<0.1 and pitch#>-0.1 then pitch#=0
if turn#<0.1 and turn#>-0.1 then turn#=0
if roll#<0.1 and roll#>-0.1 then roll#=0
`parameters
if camera position x()>3000
position camera 3000,yplane,zplane
endif
if camera position x()<-3000
position camera -3000,yplane,zplane
endif
if camera position y()>3000
position camera xplane,3000,zplane
endif
if camera position y()<-3000
position camera xplane,-3000,zplane
endif
if camera position z()>3000
position camera xplane,yplane,3000
endif
if camera position z()<-3000
position camera xplane,yplane,-3000
endif
`dust
for dust=4 to 19
if object in screen(dust)=0
position object dust,xplane#+rnd(100)-50,yplane#+rnd(100)-50,zplane#+rnd(100)-50
endif
next dust
`destroy object if dead
if earthlife=0
delete object 2
earthlife=-1
endif
if obj0life=0
delete object 100
obj0life=-1
endif
`destroy you if dead
if health=0 then end
`timer
timer=timer+1
`print
set cursor 0,0
print "Scancode: ",scancode()
print "Speed: ",(speed#*25)
paste image 3,0,346
paste image 4,16,(480-(speed#*32)-14)
print "x angle: ",xangleplane#
print "y angle: ",yangleplane#
print "z angle: ",zangleplane#
`syncronize screen
sync
LOOP
ichaelm
18
Years of Service
User Offline
Joined: 23rd Aug 2006
Location:
Posted: 25th Aug 2006 18:43
I am trying to make a space flight simulator that has a little indicator in a corner of the screen that tells you what directon you need to turn to face your target. I know I need to make an invisible object that is in the same position as your ship but points to your target. Then I need to compare the orientation of the pointer with the orientation of the ship (the camera). But, when I use the "camera angle y()" functon, some weird glitch happens.
C:/Documents and Settings/Michael/Desktop/Temporary/diagram.gif

`create world
randomize timer()
autocam off
center text 320,240,"Loading, please wait...."
position mouse 320,240
hide mouse
sync on
sync
dim missilemove(10)
dim bullet#(100)
position camera 0,0,0
speed#=0
load bitmap "grass-3.bmp",1
get image 1,0,0,256,256
delete bitmap 1
load bitmap "bmp/target.bmp",2
get image 2,0,0,64,64
delete bitmap 2
load bitmap "bmp/meter.bmp",3
get image 3,0,0,16,128
delete bitmap 3
load bitmap "bmp/meterpointer.bmp",4
get image 4,0,0,16,16
delete bitmap 4
load bitmap "bmp/example2.bmp",5
get image 5,0,0,276,260
delete bitmap 5
make object sphere 2,50
make object cube 100,5
make object sphere 1,20
position object 2,-1000,2500,-1550
position object 100,0,0,500
position light 0,1000,2500,1000
set light range 0,15000
set ambient light 50
texture object 2,1
set camera range 1,6000
make object sphere 3,11
position object 3,-500,104,-500
color object 3,rgb(255,0,0)
color object 100,rgb(0,255,0)
make light 1
make light 2
make light 3
make light 4
make light 5
make light 6
position light 1,500,115.5,500
position light 2,500,-96.5,500
position light 3,511.5,104,500
position light 4,488.5,104,500
position light 5,500,104,511.5
position light 6,500,104,488.5
for x=4 to 19
make object sphere x,0.1
next x
position object 4,2,2,rnd(90)-40
position object 5,-2,2,rnd(90)-40
position object 6,2,-2,rnd(90)-40
position object 7,-2,-2,rnd(90)-40
position object 8,1,2.75,rnd(90)-40
position object 9,0,3.5,rnd(90)-40
position object 10,-1,2.75,rnd(90)-40
position object 11,1,-2.75,rnd(90)-40
position object 12,0,-3.25,rnd(90)-40
position object 13,-1,-2.75,rnd(90)-40
position object 14,2.75,-1,rnd(90)-40
position object 15,3.25,0,rnd(90)-40
position object 16,2.75,1,rnd(90)-40
position object 17,-2.75,1,rnd(90)-40
position object 18,-3.25,0,rnd(90)-40
position object 19,-2.75,-1,rnd(90)-40
xtarget=-1000
ytarget=2500
ztarget=-1550
earthlife=100
obj0life=200
health=128
color backdrop rgb(0,0,0)
DO
`pitch controls
if upkey()=1
pitch#=pitch#-0.1
endif
if downkey()=1
pitch#=pitch#+0.1
endif
`turn controls
if leftkey()=1
turn#=turn#-0.1
endif
if rightkey()=1
turn#=turn#+0.1
endif
`roll controls
if keystate(51)=1
roll#=roll#-0.1
endif
if keystate(52)=1
roll#=roll#+0.1
endif
`speed controls
if keystate(12)=1
speed#=speed#-0.01
endif
if keystate(13)=1
speed#=speed#+0.01
endif
`speed limits
if speed#<0 then speed#=0
if speed#>4 then speed#=4
if pitch#<-3 then pitch#=-3
if pitch#>3 then pitch#=3
if turn#<-3 then turn#=-3
if turn#>3 then turn#=3
if roll#<-3 then roll#=-3
if roll#>3 then roll#=3
`plane object
position object 1,xplane,yplane,zplane
set object to camera orientation 1
`move
move camera speed#
pitch camera up pitch#
turn camera right turn#
roll camera right roll#
`variables
xplane#=camera position x()
yplane#=camera position y()
zplane#=camera position z()
xangleplane#=camera angle x()
yangleplane#=camera angle y()
zangleplane#=camera angle z()
`fricton
if downkey()=0 and upkey()=0 and pitch#>0 then pitch#=pitch#-0.1
if downkey()=0 and upkey()=0 and pitch#<0 then pitch#=pitch#+0.1
if leftkey()=0 and rightkey()=0 and turn#>0 then turn#=turn#-0.1
if leftkey()=0 and rightkey()=0 and turn#<0 then turn#=turn#+0.1
if keystate(51)=0 and keystate(52)=0 and roll#>0 then roll#=roll#-0.1
if keystate(51)=0 and keystate(52)=0 and roll#<0 then roll#=roll#+0.1
if pitch#<0.1 and pitch#>-0.1 then pitch#=0
if turn#<0.1 and turn#>-0.1 then turn#=0
if roll#<0.1 and roll#>-0.1 then roll#=0
`parameters
if camera position x()>3000
position camera 3000,yplane,zplane
endif
if camera position x()<-3000
position camera -3000,yplane,zplane
endif
if camera position y()>3000
position camera xplane,3000,zplane
endif
if camera position y()<-3000
position camera xplane,-3000,zplane
endif
if camera position z()>3000
position camera xplane,yplane,3000
endif
if camera position z()<-3000
position camera xplane,yplane,-3000
endif
`dust
for dust=4 to 19
if object in screen(dust)=0
position object dust,xplane#+rnd(100)-50,yplane#+rnd(100)-50,zplane#+rnd(100)-50
endif
next dust
`destroy object if dead
if earthlife=0
delete object 2
earthlife=-1
endif
if obj0life=0
delete object 100
obj0life=-1
endif
`destroy you if dead
if health=0 then end
`timer
timer=timer+1
`print
set cursor 0,0
print "Scancode: ",scancode()
print "Speed: ",(speed#*25)
paste image 3,0,346
paste image 4,16,(480-(speed#*32)-14)
print "x angle: ",xangleplane#
print "y angle: ",yangleplane#
print "z angle: ",zangleplane#
`syncronize screen
sync
LOOP
Sven B
20
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 25th Aug 2006 23:04 Edited at: 25th Aug 2006 23:04
I have heard of double posts, but triple?

It's the programmer's life:
Have a problem, solve the problem, and have a new problem to solve.
Gamedesign er20
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: The one place you would never look...
Posted: 25th Aug 2006 23:25
Actually it was 4 times

Cocacola and Pepsi aren't that differnt. Deal with it.
Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 26th Aug 2006 07:00 Edited at: 19th Sep 2006 07:12
EDIT:

Uncle Sam
Nvidia Geforce 7600 GS 256MB PCIEx, 2.66 GHZ Pentium 4 proccessor, 768MB RAM
Need particles? Click here!
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Aug 2006 08:11 Edited at: 26th Aug 2006 08:30
@ichaelm

I like your starfield and the ship movement. Looks like you got a pretty good start. I don't have your media so I had to manage without bitmaps or images.

To find the direction of your enemy, you don't necessarily have to use a hidden object. Every object has a position in terms of x,y and z. You don't have to be pointing at another object to determine one position from another. If you are facing +z, then +y is above you, and +x is to your right. By subtracting your positional ordinates from the enemy's, you can tell where the enemy is in relation to you. If you calculate the slope and take the arctangent of that, you will actually have a direction and an angle.
If you calculate the distance, and the angle, you could decide whether or not that distance falls within a set radar range and whether it shows up at all.

For example, you are facing +z and +y is above you. Your enemy is somewhere to your left (but you don't know that - you want the computer to show you).
If enemyx# < yourx# you know he is to your left.
If enemyy# > youry# you know he is above you.
if enemyz# < yourz# you know he is behind you

This basic info can help you plot where the enemy may be. You'll have to compensate for your orientation though. If you were facing -z then if enemyz# was < yourz#, he'd be ahead of you.

Some things to note when posting a message. If you want to include code, you can highlight the whole block and press the CODE button at the top. That will change

Print "hello world"

to



Makes things easier for everyone to read. Also, if you find you've made a mistake in your post and you've already sent it, instead of rewriting the post, you can edit it. The word Edit is highlighted in the same column as your name near the bottom of your message.

Enjoy your day.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 27th Aug 2006 05:48
The last 3 posts were posted in the same minute, but the first was 3 hours earlier!? I don't know what happened there...

Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 27th Aug 2006 06:07
Maybe he used a proxy.

ichaelm
18
Years of Service
User Offline
Joined: 23rd Aug 2006
Location:
Posted: 27th Aug 2006 17:17
Sorry about the 4 posts, it must've been some error. I'm pretty new. Thanks, latch. That'll really help.
The Wilderbeast
19
Years of Service
User Offline
Joined: 14th Nov 2005
Location: UK
Posted: 4th Sep 2006 21:40

Login to post a reply

Server time is: 2025-05-25 22:40:37
Your offset time is: 2025-05-25 22:40:37