Guided Missile

eromingeroming Member Posts: 13
edited November -1 in Working with GS (Mac)
I am working on my first side scrolling game an I can't get the bosses missile to accelerate and continue tracking the main ship.

Thanks in advance! :)

Comments

  • RedlerTechRedlerTech Member Posts: 1,583
    Hey,
    Create 2 real attributes (global) called ShipX & ShipY

    Go inside the ship:
    Constrain attribute ShipX to self.position.X
    Constrain attribute ShipY to self.position.Y

    When you shoot the guided missile, instead of accelerate toward use the interpolate:
    Interpolate self.position.X to ShipX
    Interpolate self.position.Y to ShipY

    If for some reason the interpolation does not work, use the Move To behavior. Move to ShipX & ShipY
  • LumpAppsLumpApps Member Posts: 2,881
    I know this takes up more processor time but instead of interpolate you can use accelerate.
    This makes the missiles swing over the target and when you 'dodge' which gives a realistic effect.

    Good luck!
  • RedlerTechRedlerTech Member Posts: 1,583
    Well, if he uses accelerate, or even accelerate toward, once the missile is dodged it will not come flying back. It's really your choice depending on the effect you want :D

    Matt
  • eromingeroming Member Posts: 13
    Thank you guys for all the help so quickly! I will try each method to see which one i like best! :)
  • eromingeroming Member Posts: 13
    It worked thanks guys! :)
  • RedlerTechRedlerTech Member Posts: 1,583
    No problem :D
  • LumpAppsLumpApps Member Posts: 2,881
    NextGen said:
    Well, if he uses accelerate, or even accelerate toward, once the missile is dodged it will not come flying back. It's really your choice depending on the effect you want :D

    Matt

    No offence but it will come flying back.

    I have this in one of my prototypes.
    I used an accelerate to (the shipX and shipY)
    It will keep following it but with a delay so when you move your ship and it misses it will come back in a nice circle. Looks awesome.
  • RedlerTechRedlerTech Member Posts: 1,583
    Not a problem Ludwig, I have *101* fever so I'm not sure if I'm thinking properly :(

    Thank you for correcting me
    Matt
Sign In or Register to comment.