• Stormys • New • Free • Vertical & Horizontal Parallax Template • for GS users...
StormyStudio
United KingdomMember Posts: 3,989
Afternoon world….
I'm pleased to announce another 100% Free template from Stormy Studio.com
A couple of days ago a fellow GS user emailed me asking for some help with vertical parallax to go along with the more common horizontal parallax..
So I created this little 'Vertical & Horizontal Parallax Template' .
It's all labelled up, and hopefully gives others something to learn from, adjust and implement into their own games, storybooks, apps or what ever.
As well as the rules for the parallax offsets for foreground and background layers, it also includes rules which stop the constraining behaviours happening when outside a given area around the camera. This should reduce the load on the CPU as well as stop actors from moving so far out of the scene that they are automatically destroyed when they go 500px outside the scene area.
Head here to download the template for free:
http://www.stormystudio.com/game_templates.html
And here's a little video preview to see what I'm talking about:
I hope its of use for some of you.
Cheers
Jon
I'm pleased to announce another 100% Free template from Stormy Studio.com
A couple of days ago a fellow GS user emailed me asking for some help with vertical parallax to go along with the more common horizontal parallax..
So I created this little 'Vertical & Horizontal Parallax Template' .
It's all labelled up, and hopefully gives others something to learn from, adjust and implement into their own games, storybooks, apps or what ever.
As well as the rules for the parallax offsets for foreground and background layers, it also includes rules which stop the constraining behaviours happening when outside a given area around the camera. This should reduce the load on the CPU as well as stop actors from moving so far out of the scene that they are automatically destroyed when they go 500px outside the scene area.
Head here to download the template for free:
http://www.stormystudio.com/game_templates.html
And here's a little video preview to see what I'm talking about:
I hope its of use for some of you.
Cheers
Jon
Comments
@StormyStudio
Looking terrific, Jon - there's a few or more solutions to the parallax prob. as you know - I look forward to downloading your file to see your solution. Looking really smooth and responsive on the video, congrats, and generous of you to donate to the GameSalad community. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
As always I'm sure there might be a better more efficient way but this works well for me and only requires a few behaviours.
I did it from scratch can't be 100% sure if its how I've done parallax in my games before but seems to be as good a way as any.
It's also pretty simple to understand, separate actors for each of the parallax layers, which could be reduced to using the same actor with the parallax value set as a self attribute... but then it gets all the trickier to explain to those new to the shores of GameSalad.
I was still quite chuffed though as I got mine working with two expressions for x and y. The same expressions were attached to different sized backgrounds.
One problem with it is that it requires you to specify the level width and height, and I was too lazy/busy to introduce camera movement. These are the two expressions using constrain attribute, and the minimum required to move the backgrounds around.
self.Position.X = (self.Size.Width / 200) * (100-((game.Player X / game.Level Width) * 100))
self.Position.Y = (self.Size.Height / 200) * (100-((game.Player Y / game.Level Height) * 100))
The 200 here (self.Size.Width / 200) stops it from disappearing off of the screen and being destroyed.
Darren.
Your way looks interesting... gonna have to put that into GS myself to figure out whats happening there. Which value are you varying for the different levels of parallax?... or is that down to the actor width?
@DeepBlueApps cheers Darren...
I'm sure it will make its way over to DeepBlueApps eventually, if you want it :-)
I need to mention that I've not yet had to move the camera around a bigger scene so I didn't look at doing that when I worked on this one. Nor have I ever set up a scene bigger than the camera, but I'm guessing those bigger than the camera still use the full x and y coordinates so it should work on any size level, as long as you update two game attributes with the level size.
I'm not sure it's correct, as I've never had to do it before but it gave the GS member an idea on how it might be done.
And the different levels of parallax is automatically calculated based on the background size which is why the two expressions work on any sized background without having to make any adjustments with each:
self.Size.Width and self.Size.Height.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Try it now...
:-O
Yup! Working now.
Time to dig into this and learn how to do parallax right!
Woh! woh! ... I never said I did it right :-)
Hope its useful.
Anyone downloaded and tried it yet?
Just got round to posting about it on
Our Twitter: https://twitter.com/stormystudio69
Our Facebook: https://www.facebook.com/StormyStudio
Our Own Blog: http://stormystudio.com/blog/
Hope it runs smoothly for you... I'm sure a good few of you lot will play around with the rules, if you find any cool alternatives/tweaks to the current rules please share.
Thank you!
Big Smile Games Play Happy!
Check out our other GameSalad exclusives.
This will help me very much! Thanks a mill!