Positioning display in front of rotating character

This forum is currently in read-only mode.
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • I'm toying with a control scheme much like the Ghost Shooter where you control where a player is looking with the mouse, however, I'd like for the camera to be focused... let's say 100 pixels in front of the character. However, which direction is in front of the player can change depending on where he's looking.

    Is there a simple way to position the camera X distance from an object in the direction it is facing?

    Any equation for it is completely escaping me at the moment.

  • I would probably go with a dummy object with "center view on me" ticked in preferences.

    Then always have the character facing the dummy.

  • That's what I figured I'd be doing, but I'm still not sure how to keep the dummy object exactly X distance away from the player sprite in the direction of the mouse...

  • Oh, I got it, and without a dummy object!

    I create a new image point 100 points to the right of the right end of the player object and have an event to scroll the camera to the X and Y of that point.

    And it's excruciatingly dizzying. I may have to tweak that if I don't want to get people sick.

  • Scrolling effects which sound cool before you make them often seem to come out bad. I thought it'd be cool if your character always faced the same angle, and the world rotated as you moved the mouse. It was incredibly confusing I think scrolling works best when totally predictable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's actually working really well now. I've got an image point slightly in front of the player character and the camera focuses on that, that means the player character is slightly off-center so the visual space can be focused more on his cone of vision.

    However, I'm seeing if I can throttle the speed of the camera to speed up if it needs to rotate far, and slow down if it doesn't. Hopefully that'll make the off-center scroll just a little bit smoother. This may be a bit much to pull off but I want to give it a shot.

    Here's my current events.

    <img src="http://floatinghandsstudios.com/games/events.png">

    It properly throttles up to the max speed, but it never comes back down.

    I think I'm missing something obvious, but I'm too blearly-minded to figure it out at the moment. Maybe someone else can come up with a better solution.

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