how to make an actor move up only IF there is space to move up

I'm designing a vertical shooting game, and I want the enemy actors to be grouped at the top and go down slowly (like in alien invaders) however if an enemy on the top of another enemy is destroyed, I want the enemy to go up instead until it reaches the next alien on top of it. I thought about using a collision condition but it doesnt work because the enemy is being collided in all 4 sides, not just the top, and I do not want to separate them. Anybody know how to do this?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited March 2014

    This can be done by storing and checking each actor's position in a table but it's pretty complex work.

    Another idea I had was to make each alien's actor twice as high as its image (so if the image is square, you would have a transparent square above that) and then have a rule that says IF alien collides with alien and in the ELSE section have a move up behavior.

    The alien actors would have to be stacked so they initially collide.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.