Ok listen to this. I already had a pretty good code for the gun, and it was fine and I liked it! But with your code, I know have my gun bobbing up and down, it looks better, and for some reason I just like it MUCH BETTER!!!! Thanks! Now, I am having some trouble positioning another object. I want to get my bullet to come out of my gun, and not come out of the aimer. I have tried positioning it to be at the same position as my gun, but it still comes out the middle of the screen from the aimer. I already have one big REM type of thing at the top with stuff in it, and you already are in it, along with RPG Gamer and that MrTaToad guy and IanM... Thanks for your help, guys! But, this is the code I have now, and all I would like to know is how I can get my bullet to come out of the gun.
`******************************************************************
`aLiEn CoMeBaCk *
`A ReBel Games non-commercial product *
`Help given from RPG Gamer, TheDarthster, MrTAToad, IanM and more!*
`website: www.hometown.aol.com/Hockeycow07/rebel.html *
`3D models from 3dcafe.com *
`Wasn't this REM just pointless?? :) *
`******************************************************************
sync on
sync rate 0
hide mouse
autocam off
Fog off
Fog distance 2000
Fog color RGB(130,130,130)
Color Backdrop RGB(130,130,130)
cls
center text 320,240,"ReBel Games presents to you: aLiEn CoMeBaCk -------- Loading..."
sync
load image "grass01.bmp", 1
load object "gun.x",1
rem Get it facing the right way
yrotate object 1,270
fix object pivot 1
rem Make it a better size
scale object 1,10,10,10
rem THIS IS WHERE THE GUN IS PLACED. CHANGE THESE TO MOVE THE GUN.
position object 1,20,-10,50
rem THIS COMMAND LOCKS AN OBJECT TO THE SCREEN. LOOK IT UP IN THE HELP
lock object on 1
sync
rem The bullet
make object sphere 2,1
position object 2,20,-10,50
hide object 2
make matrix 1,10000,10000,50,50
Prepare matrix texture 1,1,1,1
Fill Matrix 1,1,1
sync
do
dx#=dx#+mousemovey()/4
cy#=wrapvalue(cy#+mousemovex()/4)
if dx#>90 then dx#=90
if dx#<-90 then dx#=-90
cx#=wrapvalue(dx#)
set cursor 1,1
print screen fps()
rotate camera cx#,cy#,cz#
oldx#=x#
oldz#=z#
if upkey()=1 then x#=x#+sin(cy#)*15
if upkey()=1 then z#=z#+cos(cy#)*15
if downkey()=1 then x#=x#+sin(cy#+180)*10
if downkey()=1 then z#=z#+cos(cy#+180)*10
if leftkey()=1 then x#=x#+sin(cy#-90)*10
if leftkey()=1 then z#=z#+cos(cy#-90)*10
if rightkey()=1 then x#=x#+sin(cy#+90)*10
if rightkey()=1 then z#=z#+cos(cy#+90)*10
rem Some code to make the gun bob up and down when you move.
if oldx#<>x# or oldz#<>z#
abob#=wrapvalue(abob#+10)
endif
if oldx#=x# and oldz#=z#
abob#=curveangle(0,abob#,10)
endif
position object 1,20,-10+(sin(abob#)),50
position camera x#,200,z#
ink rgb(255,0,0),0
line 320,230,320,250
line 310,240,330,240
circle 320,240,7
Rem Make bullet
if Mouseclick()=1 and BulletLife=0
position object 2,20,-10,50
Set object to camera orientation 2
BulletLife =25
Show object 2
Endif
If BulletLife > 0
Dec BulletLife
Move object 2,20
If BulletLife = 0 then Hide object 2
Endif
sync
loop
Can one of you help? Thanks!
P.S. I am not trying to get you to do the whole thing for me. I already had different movement controls and stuff, but I am just using yours to keep everything orderly. Thanks!
AlamDV, NHL, NHL 2K3....... The best combination ever!