Parallax scrolling made easy!
Control an infinite number of parallax layers and backgrounds using just two objects and one script.
Easy to implement and easily extendable!
Works on all platforms.
Reviews and feedback are much appreciated!
HTML5 Demo: https://dl.dropboxusercontent.com/u/103042952/parallax%20demo/index.html
What's parallax scrolling? Instead of setting up a fully 3D environment, make a 2D scene appear artificially 3D by making objects "farther off" in the distance move more slowly than objects closer to the camera. It's a great technique for giving scenes in all sorts of 2D games more depth.
Did you use Infinite Parallax in one of your games? Let me know! I'd love to hear about it.
Quick note: all the demo art assets in this project are derivative works of photos on Wikimedia Commons.
Version 1.0.0. Published November 29, 2014
Created with GameMaker: Studio v1.4.1474
You can only review assets you've bought.
A good place to start
Using depth for parallax is a no-brainer, and works well with game maker. Also, using backgrounds instead of fully initialized objects is a great way to optimize. Although I probably won't use this code myself, these ideas will find their way into my user interfaces and backdrops. The explanation room was helpful visualization. Then I pressed enter... oops, error, you forgot an "else" statement to send me back to the first room if I press enter in the last room.
Good but I have some questions
in the How To Use script it talks about applying the depth of the creation code of the room event. But when I go to the room's creation code There is nothing there. So how is it applying the depth to all the objects? I cant seem to find it anywhere. Also what would I put in the creation code to assign a depth value?
Edit: I found it! It was a little confusing to say Room creation event code and not the objects creation code in the room editor. But why did you do it like that. I think a better system would be one where the obj_parallax_element takes the parallaxDepth from the child obj's depth after 1 step so that you can assign the depth either in the room editor, create event. Or if another object is spawning it they can set the depth and everything well still work
A++ Would buy again
Very easy to use and added a lot to my game with little effort.
Thanks! Glad it helped you.
Thank you soo much!!
although I'm a beginner with game programming I really like how you make it soo easy that i use their objects to implement mines, but i don't really understand the code
Thanks! It's great that it worked for you easily.
Great Job! Small code fixes can make the code handle moving background objects which makes the world awesome.
Thanks! There is some built-in background scrolling functionality but it's not immediately obvious. I'm hoping to make a clearer example next update.
Not very practical
This parallax code initally looks good when run but when you break it down, it uses objects as backgrounds. This is not how you are suppose to use parallax since game maker comes with its own background system. Use if you want to implement parallax on objects you plan to control.
There actually is code in place to let you use GM's background system, but it's not implemented in the examples because I wanted the focus to be on creating dynamic background elements (like Spine animations attached to objects) and placing them easily in the room editor. The code is there; you just have to dig around a little bit in obj_parallax_handler. In a future update I'll add an example more clearly demonstrating how to do this. Thanks for the review!
It's better than the typical way of doing parallaxing. More precise than most methods to be sure! It's simple and comes with a demo included so I don't have much bad to say about it. I guess if there's on complaint its that its not really as simple as just using a script or something. There's a bit more setup here than that...
I'm glad you like it! I guess setup is kind of complicated in the sense that you need to figure out what depth you want layers to be drawn at, and then define that depth in the room editor, but otherwise it works more or less out of the box. What would make it easier to use/setup?