HaHaHaHa im a pain in the ass

Previous topic - Next topic

WAAAAAA

my explosions keep crashing the game heres the code

Code (glbasic) Select
FUNCTION Create_Explosion: x,y
LOCAL i
i=BOUNDS(ex[],0)
REDIM ex[i+1][3]
ex[i][0]=x
ex[i][1]=y
ex[i][2]=0
ENDFUNCTION

FUNCTION Update_Explosion:
LOCAL i
FOR i=0 TO BOUNDS(ex[],0)-1
INC ex[i][2],1
IF ex[i][2]>10
DIMDEL ex[],i
ENDIF
NEXT
ENDFUNCTION

FUNCTION Render_Explosion:
LOCAL i
IF BOUNDS(ex[],0)-1>=0
FOR i=0 TO BOUNDS(ex[],0)-1
//ALPHAMODE 0.5
SPRITE 5,RND(3)+ex[i][0]-1,RND(3)+ex[i][1]-1
NEXT
ENDIF
ENDFUNCTION
whats wrong?

WAAAAAA

lmao nvm it works now