Need Coding Help

I’m trying to create an auto-scroller level for my game Super Color Platformer… but I have a small problem :neutral_face:

Is there a way for the game to check if the player is off screen? Mainly because this is my first time attempting to build an auto-scroller level…

3 Likes

There is a block under scene that makes the camera follow the player.
Nice drawing!

2 Likes

You can have a sprite as big as the screen size and be locked onto the sprite the camera is following

If the player stops overlapping it do whatever you wanna do

Or you could add the scrolling extension and make the sprite not move and… BOOM. It looks like he is walking. (Or what he is doing in your game.) But if you’re ACTALLY moving, do what @mmurray1019 said.

1 Like

I don’t think there is an easy way, but if you get the cameras location then you might be able to see how far away the player is on the x axis by getting the difference between the cameras X and the players X, then checking if it is above or below 80 and -80. (160 is the screen size so 80 is half.)

This was written quickly, if you need a better explanation just ask.

4 Likes

Yes, using a bit of math and an if statement, you can check.


I inagine there is an extension out there that would do it better though.

1 Like

i know that you can force a player to be in screen

1 Like

Will this help?

2 Likes

PERFECT!

It’s exactly what I envisioned!

1 Like