Yo. What's happenin'.
So I have a class in bgt which is for a cannonball. The cannonball has values of x, y, and facing. I have all this set up with a cannon, and it works. My problem, however, is this.
Note that the quotes replace brackets Because I was getting a forum error when atempting to paste the original code.
if(facing_cannonballs"i".x<=0)
{
p.play_2d("cannonballwall.ogg",me.x,me.y,facing_cannonballs"i".x,facing_cannonballs"i".y,false);
facing_cannonballs.remove_at(i);
}
else if(facing_cannonballs"i".x>=max)
{
p.play_2d("cannonballwall.ogg",me.x,me.y,facing_cannonballs"i".x,facing_cannonballs"i".y,false);
facing_cannonballs.remove_at(i);
}
I also have it do damage and it all works. All but the lines above. When it reaches a boundry, being either 0, or the max coordinates, it runtimes. I'm not sure why. I will paste the runtime text here, in case it some how sheds some light on the situation.
Call stack size: 3
File: H:\game\includes\facing_cannonball.bgt
Line: 46 (1)
Function: void facing_cannonballloop()
File: H:\game\game.bgt
Line: 61 (1)
Function: void game()
File: H:\game\game.bgt
Line: 52 (1)
Function: void main()
That's all it says. If someone could either explain why it runtimes, or paste the fixed code here, that'd be great. Also let me know if I should paste the class for the cannonball. I could do that as well.
Thanks for any help in advance
"There is beauty in simplicity."