GRRR....
Ok, I am making a horizontal shooter, but there are some array problems that don't make any sense.
emstart
-------------------------------------------------------------------
Program name: Laser Assault 3
-------------------------------------------------------------------
Written by: UFO
Date: 2/1/06
-------------------------------------------------------------------
Arrays: PlayerBullet(50,4) 1-exists 2-x 3-y 4-z angle
Images: 1-Player 1000-Background 1001-PlayerBullet
Plains: 1-Player 500-550-PlayerBullets 1000-Background
-------------------------------------------------------------------
remend
`WHOLE GAME VARIABLES
`(Variables used the whole game and does not change)
Dim AmountLevels(0)
Dim Level(0)
Dim MPB(0) `<<<<<<<<<<<
MPB(0) = 49 `<<<<<<<<<<<
Dim PlayerBullet(MPB(0),4) `<<<<<<<<<<<
Dim Shoot_Status(0)
AmountLevels(0) = 1
Level(0) = 1
Shoot_Status(0) = 1
`GAME SETUP
Sync on
sync rate 0
hide mouse
autocam off
Set camera view 0,90,640,390
Position camera 0,0,-38
Point camera 0,0,1
cls
Load_Player
Load_Player_Bullets
`LEVEL VARIABLES
`(Variables that will change, and is only used for the level,
`and will need to be reset at the begining of each level)
`LEVEL SETUP
Load_Background(level(0))
Player_Intro
Do
control_player
Player_Shoot `<<<<<<<<
Move_Player_Bullets `<<<<<<<
Text 2,100,str$(object position x(1))
Text 2,115,str$(object position y(1))
sync
Loop
Function Load_Background(level)
Load image "media/backgrounds/"+str$(level)+".png",1000
If object exist(1000) = 1 then delete object 1000
Make object plain 1000,64,50
Texture object 1000,1000
endfunction
Function Load_Player()
Load image "media/Player.png",1
Make object plain 1,5,3
Texture object 1,1
Set object 1,1,0,1
endfunction
Function Player_Intro()
Position object 1,-60,0,-1
For x = -60 to -20
Position object 1,x,object position y(1),object position z(1)
sync
sleep 10
Next x
endfunction
Function Control_Player()
If upkey() = 1 and object position y(1) < 21 then position object 1,object position x(1),object position y(1)+0.5,object position z(1)
If downkey() = 1 and object position y(1) > -21 then position object 1,object position x(1),object position y(1)-0.5,object position z(1)
If leftkey() = 1 and object position x(1) > -27 then position object 1,object position x(1)-0.5,object position y(1),object position z(1)
If rightkey() = 1 and object position x(1) < 27 then position object 1,object position x(1)+0.5,object position y(1),object position z(1)
endfunction
Function Player_Shoot()
If controlkey() = 1
If shoot_status(0) = 1
For I = 1 to MPB(0)
If PlayerBullet(I,0) = 0
PShoot(I,Object position x(1),object position y(1),90)
goto exitthisfornextloop
endif
Next I
exitthisfornextloop:
endif
endif
Endfunction
Function PShoot(Num,Bulletx#,Bullety#,angle) `<<<<<<<<<<<
PlayerBullet(Num,0) = 1
PlayerBullet(Num,1) = Bulletx#
PlayerBullet(Num,2) = Bullety#
PlayerBullet(Num,3) = angle
Endfunction
Function Load_Player_Bullets
Load image "media/Bullet.bmp",1001
For I = 500 to 500+MPB(0)
Make object plain I,2,1
Texture object I,1001
next I
Endfunction
Function Move_Player_Bullets()
For I = 1 to MPB(0)
If PlayerBullet(I,0) = 1
PlayerBullet(I,1) = PlayerBullet(I,1) + 1
Position object 499+I,PlayerBullet(I,1),PlayerBullet(I,2),-1
zrotate object I,PlayerBullet(I,3)
endif
next I
Endfunction
Ok, the things that are related to the problem are marked with <<<<<<s. The problem is is that almost everywhere PlayerBullet(I,3) is located, it says array is accessed out of bounds. I know I don't want you to have to go through all of it, so here are the things that might need looking at:
*The Dim section at the top.
*The functions: Move_Player_Bullets, PShoot, and Player_Shoot.
Please help

. It would be GREATLY appreciated.

Hippopotomonstrosesquippedaliophobia-Fear of long words