Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 12th Dec 2002 19:11
hi i make a gun for my game but i can't get the bullet to line up with the gun so when u shoot the bullet doesn't come out of the gun and i can't get it sorted please help here are my codes:

sync on
sync rate 60
set emulation off
set camera range 1,500000
hide mouse

rem make level 1
load bitmap "level1/ground.bmp",1
get image 1,0,0,256,256
delete bitmap 1

rem Make a matrix
make matrix 1,10000,10000,70,70

rem Prepare matrix with a texture cut into a 2x2 texture grid
prepare matrix texture 1,1,2,2

rem Set matrix to use a mipmap
set matrix texture 1,0,1

rem Fill matrix with first texture tile
fill matrix 1,200.0,2

` set matrix tile 1,x,5,3
` set matrix tile 1,5,y,3

`update matrix 1

rem make gun
`Make object cylinder 123,2
load object "h-mp5-static.3ds",5
XRotate Object 5,90
Fix object pivot 5
`Scale object 5,100,100,500
Scale object 5,5000,2500,7500
`position object 5,0,-7,15
position object 5,5,-10,10
Lock object on 5

Rem Make bullet
Make Object Sphere 6,2
Hide Object 6

rem make walls for level
make object box 1,25,150,1500
position object 1,-10,275,750

load image "wall4.bmp",3
load image "ceil2.bmp",4

make object box 2,25,150,1300
position object 2,200,275,650

make object box 3,195,10,1500
position object 3,90,350,750

make object box 4,190,150,25
position object 4,90,275,1500

texture object 1,3
texture object 2,3
texture object 3,4
texture object 4,3

`make object box 5,25,100,1280
`position object 5,200,287,640
`make object box 6,235,15,1500
`position object 6,100,350,750
`make object box 7,230,210,10
`position object 7,100,250,1500
`make object box 8,190,145,10
`position object 8,95,273,5

`make object box 10,190,145,10
`position object 10,95,273,5
`make object box 11,190,145,10
`position object 11,95,273,5
`make object box 12,190,145,10
`position object 12,95,273,5
`make object box 13,190,145,10
`position object 13,95,273,5

`load image "door.bmp",2
`texture object 8,2

`texture object 1,3
`texture object 2,3
`texture object 3,3
`texture object 4,3
`texture object 5,3

`texture object 6,4
`texture object 7,3

rem main loop
`do
main:

do
set cursor 0,0
print x#
print y#
print z#

oldcAY# = cAY#
oldcAX# = cAX#

oldX#=X#
oldY#=Y#
oldZ#=Z#

cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)
caZ# = Camera angle Z()

Rem Control input for camera
If Upkey()=1
XTest# = Newxvalue(X#,cAY#,15)
ZTest# = Newzvalue(Z#,cAY#,15)
If XTest#>0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest#0 and XTest#0 and ZTest# 0
Dec BulletLife
Move object 6,20
if BulletLife = 0 then Hide object 6
Endif

Rem Rotate camera
cTestX#=WrapValue(cAX#-180)
if cTestX# > 225 then cAX#=45
if cTestX#
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 14th Dec 2002 13:59
please help me i made a small mistack up above when i fire the gun it doesn't come out of the gun and i don't know how to get it to come out of the gun.

please help
cloud
cloud
21
Years of Service
User Offline
Joined: 27th Oct 2002
Location:
Posted: 15th Dec 2002 14:01
sorry my mistake i just had to position the bullet at the shame position of the camera and the codes above arent all of then for some reason but thanks any how

cloud

Login to post a reply

Server time is: 2024-04-23 17:15:08
Your offset time is: 2024-04-23 17:15:08