Hi guys At thegamecreators, i need your help!
i have a few things
1. recoil, ill give u my whole game code at the bottom, i dont think my fps is coded the way it should be, how can i make my gun look as if it were fireing!?
2.Gun Swaying, iv tried a few things that just dident work, and tutorials, i need it to look like the guy is running !
3. How Do I place Buildings In Certain Areas? Because I have A Bunker n Stuff N i just Dont know how to put it in the game where i want
4.Enemys, AI, i would like to put enemys in it, but have ai so that they dont see me from behind
5.Whats the code for not letting my guy go out of the play area?
heres my game code
`syncronise
sync on
sync rate 0
set camera range 1,99999999999
set display mode 1024,768,16
load music "loop.mp3",1
loop music 1
hide mouse
`create matrix
dim hmap(1)
make matrix 1,10000,10000,70,70
load image "land.bmp",1
prepare matrix texture 1,1,1,1
getheightbmp("desert.bmp")
for x=1 to 70
for z=1 to 70
set matrix height 1,x,z,hmap(x,z)*20
next x
next z
update matrix 1
`normalise matrix
for z=1 to 69
for x=1 to 69
h8#=get matrix height(1,x,z-1)
h4#=get matrix height(1,x-1,z)
h#=get matrix height(1,x,z)
h2#=get matrix height(1,x,z)
x1#=(x-1)*25.0 : y1#=h#
x2#=(x+0)*25.0 : y2#=h4#
dx#=x2#-x1#
dy#=y2#-y1#
ax#=atanfull(dx#,dy#)
ax#=wrapvalue(90-ax#)
z1#=(z-1)*25.0 : y1#=h2#
z2#=(z+0)*25.0 : y2#=h8#
dz#=z2#-z1#
dy#=y2#-y1#
az#=atanfull(dz#,dy#)
az#=wrapvalue(90-az#)
nx#=sin(ax#)
ny#=cos(ax#)
nz#=sin(az#)
nox#=nx#*1000
noy#=ny#*9000
noz#=nz#*25000
set matrix normal 1,x,z,nox#,noy#,noz#
next x
next z
set matrix 1,1,1,1,1,1,1,1
update matrix 1
`skysphere
load object "sky/sky28.x",2
scale object 2,600000,600000,600000
position object 2,5000,700,5000
set object 2,1,1,1,1,0,0,1
xrotate object 2,0
fix object pivot 2
`load gun
load object "AK47-model-hold.X",1
color limb 1,1,rgb(50,50,50)
color limb 1,2,rgb(70,70,70)
color limb 1,3,rgb(20,20,20)
color limb 1,4,rgb(30,30,30)
color limb 1,5,rgb(230,165,106)
color limb 1,6,rgb(230,165,106)
scale object 1,1000,1000,1000
yrotate object 1,90
zrotate object 1,355
fix object pivot 1
set object rotation zyx 1
disable object zdepth 1
`bullet
make object sphere 3,2
hide object 3
`variables
recoil=0
rt=3
rts=50
`main loop
do
`control camera
cx#=wrapvalue(cx#-mousemovey())
cy#=wrapvalue(cy#+mousemovex())
cz#=wrapvalue(cz#+mousemovez())
rotate camera cx#,cy#,cz#
gx#=cx#
gy#=cy#
rotate object 1,gx#,gy#,0
`Simple movement
if keystate(17) then x#=newxvalue(x#,cy#,5) : z#=newzvalue(z#,cy#,5)
if keystate(31) then x#=newxvalue(x#,cy#,-5) : z#=newzvalue(z#,cy#,-5)
if keystate(30) then x#=newxvalue(x#,wrapvalue(cy#-90),5) : z#=newzvalue(z#,wrapvalue(cy#-90),5)
if keystate(32) then x#=newxvalue(x#,wrapvalue(cy#-90),-5) : z#=newzvalue(z#,wrapvalue(cy#-90),-5)
y#=get ground height(1,x#,z#)+50
position camera x#,y#,z#
position object 1,x#,y#,z#
rotate object 1,cx#,cy#,0
rotate object 1,acamx#,acamy#,0
`player positions
x#=camera position x()
z#=camera position z()
y#=get ground height(1,x#,z#)+50
position camera x#,y#,z#
gx#=camera angle x()
gy#=camera angle y()
rotate object 1,gx#,gy#,0
`end loop
sync
loop
`get the heightmap
function getheightbmp(file$)
`open file
open to read 1,file$
`--------------------
`decode
read byte 1,notusefull
read byte 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
`--------------------
`Get Bitmap Width
read long 1,BmpWidth
`Get Bitmap Height
read long 1,BmpHeight
`--------------------
read word 1,notusefull
`--------------------
`Get BitDepth
read word 1,BitDepth
`--------------------
`The info contained here is not usefull.
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
read long 1,notusefull
`--------------------
`error check only if bitdepth=24
if BitDepth=24
ypos=BmpHeight
`Calculate If bmp required Padding
bmpwidth#=bmpwidth
evenwidth1#=(BmpWidth#*3)/4
evenwidth2=(BmpWidth*3)/4
padlen=0
if evenwidth1#<>evenwidth2
evenwidth1#=evenwidth1#-evenwidth2
padlen=4-(evenwidth1#*4)
endif
`-------------------------------------------
`create the hmap array
dim hmap(bmpwidth,bmpheight)
`-------------------------------------------
`Get color info
For Ylp=1 to BmpHeight
for Xlp=1 to Bmpwidth
`Read color values
read byte 1,blue
read byte 1,Green
read byte 1,red
`enter color info into height array
hmap(xlp,ypos)=(blue+green+red)/3
next Xlp
dec Ypos
`Padding
if padlen<>0
for padlp=1 to padlen
read byte 1,padbyte
next padlp
endif
next Ylp
endif
`close the file
close file 1
`end current function
endfunction
I would really aprecciate all replys
thanks
dan
To truely Pwn, You have to pwn in all games