Spaceship movement by Fimbul

  • If anybody is using this behaviour plugin, I need a bit of help. It's ideal for my game - I was attempting to use car movement for my spaceship but it's not really right. So I tried this and I like it, but I have a problem.

    For my game, my ship is always staying at the centre of the screen. Instead of moving the ship, all the objects around the ship are moved instead to give the illusion of movement. I just group them into a family and move them in the opposite direction and speed as the ship.

    This worked fine when using the car movement, but there's something about the spaceship behaviour I don't understand. Not sure if it's a bug or intentional or what to do about it.

    When you point your ship to the right and move right, you have a facing of 0 degrees, but a movement angle of 180 degrees (i.e the opposite direction). Similarly, when you move left, you face 180 degrees and move at 0 degrees. I think this is similar to some of the platform behaviour built in too. In other words, the movement angle isn't the direction you moved in, but the direction you came from.

    That would be no problem, except with the spaceship movement, when you move up or down, it's not reversed. When you move up, you have a facing of -90 (or 270) degrees and also a movement angle of -90. Down is 90 facing and 90 movement degrees.

    So I don't know how to translate this to my objects. I can't just move them in the opposite direction or the same direction as my ship as neither translates correctly.

    Any advice would be appreciated :)

  • Just to say that I've solved this. In case anybody has similar problems, the vectors are accessible, so you can use those directly. So in my case, I can move my background objects in the opposite direction as the vectors, which has the same result. E.G Set position of each object to 'Self.X-Ship.SpaceShip.VectorX' and the same for the Y coordinate.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks, Helped me!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)