Alright. I know making these posts, of which many say it is my fault, isnt the best, but oh well. This is not my fault! It cant be! I copied the code from www.darkbasic.co.uk and it doesnt work.. Ok, so this is the code I have so far. My gun shows up, but the bullet just appears for less than a second and the disappears forever.
Rem Project: Gun Game
Rem Created: 12/21/2002 7:34:05 PM
Rem ***** Main Source File *****
SYNC ON
SYNC RATE 0
HIDE MOUSE
Backdrop on
Set camera range 1,5000
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
Rem : Global Collision
Set Global Collision ON
load object "gun.x",1
position object 1,50,150,500
YROTATE OBJECT 1, 270
MOVE OBJECT DOWN 1, 310
MOVE OBJECT LEFT 1, 60
MOVE OBJECT UP 1, 40
LOCK OBJECT ON 1
SYNC
Rem Make bullet
Make Object Sphere 2,2
Position Object 2,50,150,500
Hide Object 2
SYNC
if Mouseclick()=1 and BulletLife=0
Position object 2,X#,Y#+43,Z#
Set object to camera orientation 2
BulletLife =25
Show object 2
Endif
If BulletLife > 0
Dec BulletLife
Move object 3,20
If BulletLife = 0 then Hide object 2
Endif
Rem update screen
sync
SYNC
Rem make matrix
Make matrix 1,15000,15000,175,175
Rem texture matrix
Load image "grass01.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
Rem : Global Collision
Set Global Collision ON
SYNC
Rem : Controls
do
Rem check for key presses and control movement
Rem forward and backward movement
if upkey()=1 then x#=newxvalue(x#,a#,20):z#=newzvalue(z#,a#,20)
if downkey()=1 then x#=newxvalue(x#,a#,-20):z#=newzvalue(z#,a#,-20)
Rem sidesteps
if leftkey()=1 then x#=newxvalue(x#,wrapvalue(a#+90),-20):z#=newzvalue(z#,wrapvalue(a#+90),-20)
if rightkey()=1 then x#=newxvalue(x#,wrapvalue(a#-90),-20):z#=newzvalue(z#,wrapvalue(a#-90),-20)
Rem turning and camera movement using mouse
a#=wrapvalue(a#+mousemovex()/4)
a2#=wrapvalue(a2#+mousemovey()/4)
Rem limit vertical camera movement
if a2#>=60 and a2#200 then a2#=300
Rem find ground height and position camera relative to it
y#=get ground height(1,x#,z#)+150
Rem position camera
position camera x#,y#,z#
yrotate camera a#
xrotate camera a2#
Rem update screen and loop
sync
loop
Is it that I put the code in the wrong place? If it is, please tell me because I am very new at this. Will someone test out that code for me, and tell me if it works for them? Or if you dont even need to test it, and you can just see something is wrong with it, please point it out to me for me to fix. All help will be appreciated greatly!
AlamDV, NHL, NHL 2K3....... The best combination ever!