Hi, i am in the process of making a game right now. I need some guidance as i have run into a problem. Here is my code
sync
hide mouse
` Load The Gun
load object "m16.x", 1
load image "C:Documents and SettingsKennyDesktopM16mflash.bmp", 1
lock object on 1
position object 1,1,-1,4
rotate object 1,90,0,0
`(was used to test the right position) wait
`Setup the view of the gun
`Matrix
Make matrix 1, 400, 200, 100, 100
`muzzle flash
make object plain 2,12,12
texture object 2, 1
ghost object on 2
lock object on 2
set alpha mapping on 2,30
position object 2,1.5,-2,15
scale object 2,60,60,60
rotate object 1,90,275,270
`jumping variables
JUMPING#=0
`Main Loop
do
`movement
IF KEYSTATE(17)=1 THEN MOVE OBJECT 1,.5
IF KEYSTATE(31)=1 THEN MOVE OBJECT 1,-.5
IF KEYSTATE(30)=1 THEN MOVE OBJECT LEFT 1,.3
IF KEYSTATE(32)=1 THEN MOVE OBJECT RIGHT 1,.3
`camera (lock on screen)
POSITION CAMERA OBJECT POSITION X(1),OBJECT POSITION Y(1)+4,OBJECT POSITION Z(1)
`muzzle flash
if mouseclick()=1 then Fire = 1 else Fire = 0
if fire = 1 then show object 2
if fire = 0 then hide object 2
`Movement
CAMY#=CAMY#+MOUSEMOVEX()*.1
CAMX#=CAMX#+MOUSEMOVEY()*.1
IF CAMX#>90 AND CAMX#<135 THEN CAMX#=90
IF CAMX#>270 AND CAMX#<225 THEN CAMX#=90
YROTATE CAMERA CAMY#
XROTATE CAMERA CAMX#
`Jumping process
`Space key Controls
IF SPACEKEY()=1 AND JUMPING#=0 THEN JUMP#=1
`JUMP Variable Definition
IF JUMP#=1
GROUND#=OBJECT POSITION Y(1)
JUMP_SPEED#=.5
JUMPING#=1
JUMP#=0
ENDIF
`Jumping
IF JUMPING#=1
DEC JUMP_SPEED#,.05
POSITION OBJECT 1,OBJECT POSITION X(1),OBJECT POSITION Y(1)+JUMP_SPEED#, OBJECT POSITION Z(1)
IF OBJECT POSITION Y(1)<=GROUND# THEN JUMPING#=0
ENDIF
sync
loop
Now that my code is there the problem is that whenever i move my gun with the camera attatched the gun moves WAY faster then the camera does. there is also alot of other problems, but this is my main focused problem. (i cant reply fast as i havent posted on the forums. I am using some of ruccus's fps tutorial code in here, i dont know if its because o mixed in his with mine or maybe i just completely screwed up.)
i added the m16 but i dont have java so i couldnt upload the muzzle flash but you can take that part out of the code.( its object 2)
what is left behind is left behind, but what is ahead might make a difference to whats left behind.