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;
}