Make my enemies fly straight!

thompsonjm22thompsonjm22 Member Posts: 15
edited February 2012 in Working with GS (Mac)
I'm in the progress of developing a platformer. My current issues is with my enemies. My enemies are birds and placed randomly throughout the map. My issues begin with having them fly in a straight line, rather than flying directly towards my player. I'm only using the "Move" function on the enemy and I'm not sure what I need to change or constrain so they fly in a straight line.

My second issue is having them begin their flight when the player reaches a certain point in the level. As of right now the enemies begin their path as soon as the game starts and I would like them to start flying once my player reaches a certain point. Thanks in advance!

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Are you using gravity in the whole scene, or individual accelerate down behaviors in each actor? The move behavior will just move the actor in the direction you set the little turn nob to, but if there is gravity set to the entire scene, it will pull them downward as they fly.

    As far as making the birds move when you get close, this video may help you.

  • thompsonjm22thompsonjm22 Member Posts: 15
    Thanks much for the help! Is there a way to make certain enemies ignore gravity?
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Not if you are using the gravity attribute for the whole scene. You COULD use a behavior set to the same amount in the opposite direction, but that will give you undesirable playback, i'm sure. The best method is to have an accelerate down behavior in each actor that you want gravity applied to.
  • thompsonjm22thompsonjm22 Member Posts: 15
    I applied 0 gravity to the scene which caused my enemies to fly straight, thanks a bunch! However, I have some issues now with my solid objects. I accelerated my player downward when he jumps, but when I collide with a solid object or when my player is pushed up directly next to a solid object he can either jump much higher than he should or he gets caught on the object and slows very slowly to the ground, do I need to adjust some attributes to my solid objects now?
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Yes, you may have to do some tweaking around with the physics and stuff to get everything just right.
  • thompsonjm22thompsonjm22 Member Posts: 15
    I decided to keep gravity on and use the opposite acceleration upwards on the objects I want to fly which seems to make it work. I currently am using a "gun" and when I shoot while facing right the bullets fly straight because of the acceleration upwards I placed on them. However, when I face left the bullets fly towards the bottom of the screen.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    You need to add the opposite movement into the bullet rules for when the actor is facing left as well.
Sign In or Register to comment.