hello i'm making a game for a private contest
the game is a survival and i've bought model pack 10 and zombie apocalyipse for make it
i've made a player but when i move the camera the gun model remain in same position but not turn with the camera
thi is the code:
Rem Project: Shooter for contest
Rem Created: Tuesday, March 09, 2010
Rem ***** Main Source File *****
remstart
Shooter creato per il primo Contest del forum www.Making-Videogames.net
remend
//aray / variabili progetto
Setting = 1
// variabili di posizione del Player
PosX# as float
PosY# as float
PosZ# as float
CamDist# as float //distanza camera della terza persona
dim Risoluzione(1) as string
dim Full(1) as string
M4 = 10
X#=camera position X(0)
Y#=camera position y(0)
Z#=camera position Z(0)
//*********************************************************\\
//pre progetto
set dir "C:"
load object "Media/Model/M4a4/Hud.x",M4
sync on : sync rate 66
make object cube 1,1
ghost object on 1,100
position object 1,X#,Y#,Z#
do
camera()
sync
loop
function console()
open as boolean = 0
if KEYSTATE(41)= 1 and open = 0
open console
endif
open = 1
if KEYSTATE(41)= 1 and open = 1
close console
endif
endfunction
function camera()
rotate camera camera angle x(0)+(mousemovey()/2.0),camera angle y(0)+(mousemovex()/2.0),0
if camera angle x(0) >60 then xrotate camera 60
if camera angle x(0) <-45 then xrotate camera -45
X#=camera position X(0)
if (KEYSTATE(17)= 1)
X#=newxvalue(X#,camera angle y(0),1)
loop object 10,50,79
endif
if (KEYSTATE(31)= 1)
X#=newxvalue(X#,camera angle y(0),-1)
loop object 10,50,79
endif
Z#=camera position Z(0)
if (KEYSTATE(30)= 1)
Z#=newzvalue(Z#,camera angle y(0),1)
endif
if (KEYSTATE(32)= 1)
Z#=newzvalue(Z#,camera angle y(0),-1)
endif
text 0,10, str$(X#)
text 0,20, str$(Z#)
Y#=camera position y(0)
arma()
endfunction
function arma()
position object 10,camera position x(0)+3,camera position y(0)-0.5,camera position z(0)+8
(object angle x(10)) = wrapvalue(camera angle y(0))
(object angle y(10)) = wrapvalue(camera angle x(0))
set object speed 10,15
if (KEYSTATE(17)= 1)
set object speed 10,35
rotate object 10,0,180,0
loop object 10 , 50 , 79
else
set object speed 10,20
rotate object 10,0,180,0
loop object 10, 20, 50
endif
if (KEYSTATE(31)= 1)
set object speed 10,35
rotate object 10,0,180,0
loop object 10 , 50 , 79
endif
if (KEYSTATE(30)= 1)
set object speed 10,35
rotate object 10,0,180,0
loop object 10 , 50 , 79
endif
if (KEYSTATE(32)= 1)
set object speed 10,35
rotate object 10,0,180,0
loop object 10 , 50 , 79
endif
if (mouseclick()= 1)
set object speed 10,20
loop object 10,83,89
endif
endfunction
please help me i've only 28 days for make the game
[excuse for bad english i use google translate]