How do you make a SS Function? EDIT: Solved!


How do you go ahead and make side scrolling in processing?


The basic idea of a side scroller is that the world moves around while the player stays still, or at least on screen (i.e super mario). To do this you can use x and y variables to record the amount of scrolling. The values you apply to these variables will be the opposite of what you would apply to the player

Visuals such as tiles or AIs need to be able to move around to simulate the player moving. To do this you just apply the scrolling variables to the object’s actual positions

newObjectPositionX = objectPositionX+worldScrollX;
newObjectPositionY = objectPositionY+worldScrollY;


One of the bigger challenges of making a side scroller is that the positions of things are less obvious, so it may be kinda mind bottling when doing things such as collisions

I hope this helps


Some prev posts that are relevant: