Forum rules - please read before posting.

2D character turning to different directions

Hello everyone,

I'm new on this forum and I'm just started to create my first adventure game with AC.

In 2D game, I'm building, I'd like my main character to be able to "turn" to every of four directions...
For example, in one of scenes the main character is staying on the spaceship bridge, facing front wall. Now, when player clicks somewhere on right corner of wall, background changes and the character is facing right wall now etc...

So, my question is what would be the best approach to implement this:

  • locate all four walls (BG, objects, hotspots etc.) in one scene (like in 3D environment) and just redirect camera between them.
  • locate every wall in different scene and switch between scenes.
  • stick to one picture of whole room :smiley:

Thank you!

Comments

  • Welcome to the community, @Ray.

    It sounds like this question has more to do with the camera and scene setup than your actual character. I'm not sure how much your character comes into play here - if the character can be moving around the scene freely, that'll make things more complicated, as you're then effectively making things appear 3D.

    Something like this is best explained visually - if you have some screenshots or mock-ups to show what you mean exactly, that'll help to understand things.

    Generally though, it's best to go with the first of your suggestions: to rely on a single scene and cut the camera between different overlays to give the effect of changing angle.

    This helps to keep things manageable when certain objects can be viewed from more than one angle, as you'd want the Interaction to be the same. Know that the "Interaction" ActionList that you define in a Hotspot doesn't have to be unique - you can share the same Interation between multiple Hotspots, so your "Hotspot: Window_Up" and "Hotspot: Window_Right" can run the same ActionList.

    Adding a little more complexity into the mix: ActionList parameters can be used to tweak ActionLists at runtime by changing their field values. It's possible to set an Interaction's GameObject parameter to the Hotspot automatically.

    You might also want to check out the Movement template: 2D first-person package on the Downloads page, since that - while using a little custom scripting - does use the same technique of using different cameras for different angles within a single 2D scene.

  • Thank you Chris!

    I'll check the Movement template: 2D first-person package.
    What if I put all four (front, right, left and back) groups of sprites with their hotspots into 2D layers and will just switch them ON and OFF, imitating player's turning to left, right, etc. In that case Player still will remain at the same XY environment, no 3D involved. Will it be possible?

  • edited November 2018

    Yeah, you could - my point about the XY was more that that the position would actually change when the perpsective does. If the character is on the left, they'd (presumably) need to be on the right if the camera "turns" 180.

    Again, this is a visual problem so I don't know what your exact needs would be, but it might be that it's easier to shift the player over instead.

    Moving your various objects into individual hierarchies is perfectly valid, though. There's no Action to enable/disable GameObjects (in my experience, this isn't always best practice), but custom Actions can be written. You could, however, create a shared parent object for all hierarchies, and animate the hierarchy objects using the Object: Animate Action.

  • RayRay
    edited November 2018

    Thanks again Chris!
    The ideas with custom Actions or using Object: Animate Action definitely sound interesting :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.