[24 May 2006] Re: Creating Menu and reacting on action
Posted: Sat Jun 13, 2020 5:31 pm
Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 24 May 2006 07:54:45 +0200
shidtable[0] saves the id of the bullet-sprite
enemytab[k][0] saves the id of the enemy-sprite
if the values are <> 0 there are sprites that might collide,
which is checked
but Collision shouldn't be called when shidtable[0] = 0,
so when collision is detected enemy and bullet are removed and tableentry is set to 0. and it is really impossible that a bullet collides with more than one enemy.
Next strange thing is that it works when starting game with the function p_Game()
instead of starting the script with p_CreateMenu().
I guess that the ActionListener in that function does influence more things than it should do. And disabling it within p_Game() doesn't do the trick.
Okay, I was using it because in a previous attempt of the statusbar I made use of functions only allowed with layersenabled() which worked with ExitOnError(False).
From a quick look at your p_CollisionCheck() function I would argue that it happens when a collision is detected, i.e. collisionfound becomes TRUE. In that case, you set shidtable[0] to 0, but you do not break out of the "For k=0 To enemytabvar" loop. Thus, in the next iteration of that loop, Collision() is called with shidtable[0] being 0 which raises an error.
shidtable[0] saves the id of the bullet-sprite
enemytab[k][0] saves the id of the enemy-sprite
if the values are <> 0 there are sprites that might collide,
which is checked
but Collision shouldn't be called when shidtable[0] = 0,
so when collision is detected enemy and bullet are removed and tableentry is set to 0. and it is really impossible that a bullet collides with more than one enemy.
Next strange thing is that it works when starting game with the function p_Game()
instead of starting the script with p_CreateMenu().
I guess that the ActionListener in that function does influence more things than it should do. And disabling it within p_Game() doesn't do the trick.
On another note, I see your whole script runs with ExitOnError set to FALSE. You should really remove that because when ExitOnError is FALSE, Hollywood will never exit and you won't notice any errors that have happened.
Okay, I was using it because in a previous attempt of the statusbar I made use of functions only allowed with layersenabled() which worked with ExitOnError(False).