You need to think through what happens each time you go through the loop, it often helps you find problems if you try running through your code on paper.
In this case once the mouse has been clicked and the bullet has been created you have the first problem, that the bullet wont appear to move as each time the loop executes your repositioning the bullet at the players location.
Quote: "position object a, object position X(1), object position Y(1), Object position Z(1)"
This can be solved by changing the if statment where you create the bullet.
IF mouseclick()=1
make object sphere a, 10
position object a, object position X(1), object position(1), Object position Z(1)
inc a
ENDIF
move object a, 50
However there is still the problem, that each time the loop executes its going to try and move the bullet, what if you haven't clicked the mouse? There wont be a bullet to move. This can be solved by first checking that the object your trying to move exists. (There is also the problem that you increased a so a no longer corresponds to your bullet, see final code for a possible soloution to that).
IF OBJECT EXISTS(a) THEN MOVE OBJECT a, 50
You also need to keep track of the objects you have created, Once you have created one bullet your incrementing a so it no longer coresponds to the first bullet. How you do this depends on how you want shooting to work and how you are managing objects you create. One way is to say that from a set number (for example 2) up, there will be no other objects except bullets created. This way you can keep track each time you create a bullet of how many you have and then loop through them moving them each frame. The final code would be somthing like:
REM ------------------------------------------------------------------------
REM OUR FIRST GROUP PROJECT
REM ------------------------------------------------------------------------
REM AIRPLANE
REM ------------------------------------------------------------------------
REM hide mouse
hide mouse
REM Define variables to keep track of bullets
constant bulletStart =2
noOfBullets = 0
REM make needed variables
REM make matrix
MAKE MATRIX 1, 20000, 20000, 50, 50
RANDOMIZE MATRIX 1, 200
LOAD BITMAP "floor1.bmp", 1
GET IMAGE 1, 0, 0, 100, 100
DELETE BITMAP 1
PREPARE MATRIX TEXTURE 1, 1, 2, 2
REM light and it's settings
MAKE LIGHT 1
SET DIRECTIONAL LIGHT 1, 0, -.5, 0
SET LIGHT RANGE 1, 99999
COLOR LIGHT 1, 500, 250, 75
SET AMBIENT LIGHT 1
REM make fog and backdrop
backdrop on
color backdrop rgb(0, 100, 700)
fog on
fog color rgb(0, 100, 600)
fog distance 3000
REM make camera not follow new objects and follow plane
position camera 5000, 200, -50
AUTOCAM OFF
REM load glider
LOAD OBJECT "AIRPL013.x", 1
position object 1, 5000, 200, 0
REM start loop
DO
REM set object movement paramters
sync on
IF upkey()=1 THEN pitch object down 1, -5
IF downkey()=1 THEN pitch object up 1, -5
IF leftkey()=1 THEN roll object left 1, -10
IF rightkey()=1 THEN roll object right 1, -10
IF spacekey()=1
move object 1, -70
ELSE
move object 1, -30
ENDIF
IF mouseclick()=1
REM increase noOfBullets and then add it to bulletStart to get the number that the new bullet should be
inc noOfBullets
a = bulletStart + noOfBullets
make object sphere a,10
position object a, object position X(1), object position Y(1), Object position Z(1)
ENDIF
FOR i = bulletStart to (bulletStart + noOfBullets)
IF OBJECT EXIST(i) THEN move object i, 50
NEXT i
xpos= object position x(1)
zpos= object position z(1)
REM make camera follow
position camera object position x(1), object position y(1), object position z(1)-30
REM refresh screen
sync
REM end loop
LOOP
[EDIT] Cripes, hope i've edited out all the mistakes now, I seem to be having a bad day
- For having the bullet disappear after a while you could simply have it delete the object once its moved a set amount.
Hope this helps.