Enemy movement while falling down...

Hey all. Quick question,
I have objects (enemies) that are falling down the screen. Those objects use the acceleration behavior (down 270 degrees). All is well there. However I'd like for these enemies to have some sort of attack patterns while dropping. Perhaps they'll go left and right (on loop) as they fall down. How would I do something like that? Any ideas?
Many thanks!

Comments

  • gamesfuagamesfua Member Posts: 723
    I was just thinking that perhaps i could use interpolate behaviors for the x axis. But i may run into a snag with this since the speed of descent changes randomly.
  • kandwarfkandwarf Member Posts: 6
    the speed of descent changes randomly? like the y acceleration value is random? i believe interpolating the x value from left to right should not affect or be affected by the descent speed (y accelleration value), so interpolating might work. OR, if you can spare the memory, you can give the enemy a few extra rules. give it an initial "linear velocity x" of whatever amount you want, and then make a rule that says when self.position.x is "whatever value", reverse the linear velocity. this will make the enemy's move from side to side, however they wont have the smooth animation that an interpolate behavior will give you. You can acheive the movement you want in a number of ways, it just depends how many rules you want to make, how many attributes you want to link them up to, and how much memory you are willing to spare to acheive the precise movements you want.
  • gamesfuagamesfua Member Posts: 723
    Thanks @kandwarf. Yes i meant random speeds when i said random speed of descent. Meaning the object falling can change speeds randomly as it drops. Thanks for your input. How would i reverse the linear velocity x, thanks!
Sign In or Register to comment.