playMaker

Author Topic: Parabolic arcs at any orientation  (Read 1666 times)

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
Parabolic arcs at any orientation
« on: March 27, 2015, 11:21:44 PM »
Hey guys and gals, here's a fun challenge I seem to have set myself with playmaker's iTween actions :)

I'm making a tempest-style game - i.e. one in which the player is constrained to the inside of the tube, dodging enemies and so forth...

Anyway, I'm trying to make an enemy attack that functions like a mortar - in other words it follows a parabolic trajectory. The catch is, of course, that the trajectory can occur at any rotation - so in other words, if the player is on the "roof" of the pipe, I need the parabolic arc to travel down first, and then rise up until it hits the edge of the tube.

I don't think this is impossible, as basically it's just a standard parabola, rotated to exist in the player-space (if that makes sense?), but I'm stuffed if I can figure out a way of doing it.

1) Can't use physics, because gravity would always be "down", so the player cannot be hit if they are on the roof.

2) Tried setting up two itween actions - one to make the mortar move towards the player in world-space (down the tube), and then a second one to deal with the up and down motion in "self-space" (towards the middle of the tube, and then towards the outside) - seems like objects really don't like having two itween events running at once. Mortars ignored the first command and just bounced up and down on the spot.

3) Tried splitting the curve in the middle - so two consecutive itween actions, the first to go halfway and up, the second to go the rest of the way and down - looked terrible, but maybe this is the answer and I just need to tweak the eases for a while?

Anyway, just thought I'd throw it out to the community as I'm sure there are people out there who like a challenge and I might have missed an obvious or easy solution?