Screen focus

Hello,

is it somehow possible to have one display object as the center of the screen all the time? For example a player on which the “camera” would be focused and allow him to run through the map that is initially outside of the screen.

Because Corona doesn’t contain a camera per se but what you could do is something like this when the player is moving:

If you press left for example:

  1. Start the sprite that makes the player run left (so it looks like he is running left) but don’t move the player at all

  2. Move the map (instead of the player) and if the player collides with a rock for example the movement of the map should stop

I hope this will help you get going,

Best regards,

Tomas

Thank you for answer,

I know about this but I feel like it makes everything unnecessarly complicated. Isn’t there really anything to create what I mean?

I think this would be the best way and it’s not that complicated.

In Unity it works the same but they use the word “Camera”. In Corona the “Camera” would be the screen i.e. what the user sees.

Best regards,

Tomas

Because Corona doesn’t contain a camera per se but what you could do is something like this when the player is moving:

If you press left for example:

  1. Start the sprite that makes the player run left (so it looks like he is running left) but don’t move the player at all

  2. Move the map (instead of the player) and if the player collides with a rock for example the movement of the map should stop

I hope this will help you get going,

Best regards,

Tomas

Thank you for answer,

I know about this but I feel like it makes everything unnecessarly complicated. Isn’t there really anything to create what I mean?

I think this would be the best way and it’s not that complicated.

In Unity it works the same but they use the word “Camera”. In Corona the “Camera” would be the screen i.e. what the user sees.

Best regards,

Tomas