Page 1 of 1

Bug in collision + keydown combo?

PostPosted: Sun May 28, 2006 8:21 am
by irblinx
I'm pulling my hair out of this one.

I'm creating a vertical scrolling shoot-em-up and to try and cure a problem with my player ship not destroying properly I added a bounding if statement to the collision event a power-up actor.

Having done this my ship now flies off in the direction of the keypress when the collision takes place, I've tried just taking the if statement back out but it makes no difference. Is there some bug at work here or am I missing something obvious?

The only event which the power-up actor has is a script editor one;

MissilePU Actor - Collision with ship actor event
Code: Select all
if (canshipcollide ==1){
 
  missiles = missiles +10;
  if (missiles > 10){
      missiles = 10;
  }

 missileHUD.textNumber = missiles;
 DestroyActor("Event Actor");

}


canshipcollide is a global variable set by the ship on creation and only set to 0 when the ship's animation is changed to explode.

The ship's movement is controlled by cursor keys (currently only left and right)

ship actor key down (right) event
Code: Select all
if (x < rightside){
    x=x+shipspeed;
           }

PostPosted: Sun May 28, 2006 2:12 pm
by irblinx
I seem to have fixed this by switching the collision event onto the ship actor instead, so it seems like a bug to me

PostPosted: Sun May 28, 2006 2:15 pm
by makslane
Where are you destroying the ship?

PostPosted: Sun May 28, 2006 2:29 pm
by irblinx
It isn't destroying the ship, it's power-up's, i.e. upgrade weapons, , add missiles etc

The collision event was on the power-up actor but I have now changed it to the ship actor.