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


#1

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


#2

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;

displayObject(newObjectPositionX,newObjectPositionY);

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


#3

Some prev posts that are relevant:

https://forum.processing.org/two/discussion/20813/zooming-and-panning-headache

https://forum.processing.org/two/discussion/1364/constraining-an-image-while-panning-and-zooming

https://forum.processing.org/two/discussion/4945/zooming-and-panning

Kf