playMaker

Author Topic: Space Invaders Movment  (Read 2404 times)

Destide

  • Playmaker Newbie
  • *
  • Posts: 8
Space Invaders Movment
« on: March 15, 2012, 12:02:18 PM »
Hi,
Trying to get an invader style movement working with playmaker. I've managed it with itween but that's attached to every ship and is about as economical as a kerosene Hummer. I'm trying to attach all the ships to an empty object that will contain the FSM. When the empty object hits a trigger either side they drop and change direction. Being new to all this I can't quite figure out how to go about this.
Thanks in advance

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Space Invaders Movment
« Reply #1 on: March 16, 2012, 12:40:10 PM »
I would parent all of your ship prefabs to one empty game object and just translate that single object by itself, then they will all move the same way left/right down like in space invaders.

Each time the empty game object gets to the full left or right side of the playfield (float compare), it sends a "broadcast event" action saying "drop down" (or you can put in actual positions for left and right and use a itween move to - with ping pong set in the loop section).

create a "drop down" global transition on your bad guy prefab and add an action to translate -10 in Y each time.

So each time the empty line makes it way left and right once, then all ships drop down 10 units (or just drop the parent object 10 units down) either way.

« Last Edit: March 16, 2012, 12:42:37 PM by justifun »

Destide

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Space Invaders Movment
« Reply #2 on: March 16, 2012, 05:18:51 PM »
Awesome I knew I was kind of on the right lines, Thanks for helping me learn a bit more.