Hello,
As the title says, I need some help with some code for making a radar for my FPS game.
The code I have already (see below) works fine, except it causes the frame rate to drop by around 40 frames. I've narrowed the problem down to the 'get image' command, the larger the image captured, the larger the slow down.
Here's my code:
Radar:
`Copy Bitmap 2,1
set current bitmap RadarBitmap
cls
ink rgb(0,0,255),0
RPX# = (px#/MapSizeX)*100 `Set position as % of the get image below
RPZ# = 100 - (pz#/MapSizeZ)*100
circle RPX#, RPZ#, 1
for t=1 to NetMaxPlayers
if t<>LocalPlayer
ink rgb(255,0,0),0
RNPX# = (NetPlayerPosition#(t,1)/MapSizeX)*100 `Set position as % of the get image below
RNPZ# = 100 - (NetPlayerPosition#(t,3)/MapSizeZ)*100
circle RNPX#, RNPZ#, 1
endif
next t
get image RadarImage,0,0,100,100
set current bitmap 0
texture object RadarObject,RadarImage
ink rgb(240,240,240),rgb(0,0,0)
return
Is there something I've missed?
Is there a better way of doing this?
I've looked in the codebank and there's a very good radar code by Dmitry K called 3D radar but I don't understand it could anyone help with that?
Thanks for the help,
Broken_Code