
-----------------------------------
Weapon X
Wed Apr 27, 2005 11:53 am

Array Subscript Is Out Of Range?
-----------------------------------

setscreen ("offscreenonly")
var score1, score2, ballx, ballx2, bally, bally2, xmod, xmod2, ymod, ymod2 : int
var chars : array char of boolean
var chars2 : array char of boolean
var slimex, slimey, slimex2, slimey2, vy, vy2 : real
slimex := maxx / 2
slimey := 20
slimex2 := maxx / 2
slimey := 20
vy := 0
vy2 := 2
const jumpVelocity := 5
const speedX := 2  %speed of horizontal movement
const gravity := 0.15
var inAir := false
const jumpVelocity2 := 5
const speedX2 := 2  %speed of horizontal movement
const gravity2 := 0.15
var inAir2 := false
ballx := 320
bally := 0
xmod := 1
ymod := 1
xmod2 := 1
ymod2 := 1
score1 := 0
score2 := 0

loop
    Input.KeyDown (chars)
    if chars (KEY_UP_ARROW) and not inAir then
        vy := jumpVelocity
        inAir := true
    end if
    if inAir then 
        slimey += vy 
        vy -= gravity 
        if slimey 