[Question] Moving screen in Arduboy

Hello, i am new here, i have a question:
existing function that follows a point in arduboy?
in the case of not existing, could you give me some idea.
I was thinking of doing repainting every time you reach a point, to simulate the movement of the stage.

I think you can scroll that’s on screen, so in case you are moving a character you could just make everything else but the character. This way you would have it like if the camera was following your character.

I don’t know any functions that just does it though.

But i am sure others will be able to help you more on that.

I don’t know of an existing function. This is a simplistic example of what I usually do:

Have an x and y coordinate for your camera that represents the top-left of the screen. Have an x and y coordinate for the object you want to follow. When you draw the object you’re following, take the camera coordinates into account. e.g. sprites.drawSelfMasked((int16_t) (x - camera.x), (int16_t) (y - camera.y), sprite, frame); Then you just need a function that makes the camera coordinates follow the specified object which is pretty simple “if the x coordinate of the object I’m following is greater than the camera x coordinate, increase the camera x coordinate” (or similar) logic.

Make sure the data types you use for the x and y coordinates for the camera and the object are large enough to hold values much wider than the Arduboy screen. This page should help you decide.

There is this scrolling idea I had :slight_smile:

If you could explain the effect you want in greater detail,
I’m sure at least one of us will know a way to pull it off.

At the moment I’m not sure what you mean by following a point.