GMS2 Tutorial: Parallax Backgrounds

  Рет қаралды 18,240

MikeTheTech

MikeTheTech

Күн бұрын

For those who want to give a little thanks, I just set up a page over at buymeacoffee as a new way to show support. The internet can be pretty neat sometimes. :)
www.buymeacoffee.com/mikethetech
-- Follow me on Twitch! / itsmikethetech
Dig what I make? Support me on Patreon to help me keep making cool stuff! (and get a spot in my videos or early access to games!) / mikethetech ❤
Here's one way to set up parallax backgrounds for a platformer style game using lerp and layer_x.
Background Art Credit: opengameart.org/content/3-par...
Join me on Skillshare! skl.sh/2KPfdTM

Пікірлер: 61
@MartinHultquist
@MartinHultquist 6 жыл бұрын
Thanks for this :) With a little workaround, looks awesome for the y-paralax scaling in my game. You just saved me hours of tinkering, and my day. Have a wonderful day!
@studiobythebay241
@studiobythebay241 6 жыл бұрын
Thanks a lot! I've been looking everywhere for a solution to this. Great help!
@TheNexusInfo
@TheNexusInfo 7 жыл бұрын
Exactly what I needed, thank you.
@kenstevens6772
@kenstevens6772 6 жыл бұрын
Thanks Mike! This was very useful. I can't wait to implement it into a mock up game I am working on. If I could only make one suggestion, it would be that if you are going to have an object so far away in the background (ie the sun), considering how far away it really is, you don't actually see it moving over such a short period of time. Might be best to keep it as a static part of the background, and have the clouds as a separate layer like the others.
@scamonline1501
@scamonline1501 6 жыл бұрын
Best stuff for parallax background in GMS2!!
@jacksontrexler6548
@jacksontrexler6548 6 жыл бұрын
It works pretty well for me! However I'm having some trouble when I use values higher than 0.5 for follow speed. The background objects seem to overshoot the object a little bit after they stop, and there is a noticeable delay when the following object starts moving. Anyone know a fix?
@codesymphony
@codesymphony 7 жыл бұрын
finally! only tutorial I could find on parallaxing in GMS2. tons for GM1, but not 2.
@MikeTheTech
@MikeTheTech 7 жыл бұрын
+symphony thanks for the comment! Sorry it took so long to get to your question.
@TrentKaniuga
@TrentKaniuga 7 жыл бұрын
thanks! this really helped!
@MikeTheTech
@MikeTheTech 7 жыл бұрын
+Trent Kaniuga awesome! Glad you enjoyed it. Thanks for the comment.
@ro_drigo
@ro_drigo 2 жыл бұрын
Thank you so much, that's perfect!
@ryanjnealmovies
@ryanjnealmovies 6 жыл бұрын
Thanks so much for this. It's just what I was looking for!
@MikeTheTech
@MikeTheTech 6 жыл бұрын
+Ryan J Neal Art sweet, glad it helped!
@jdaltair
@jdaltair 7 жыл бұрын
Thanks man! It's still so difficult to find good tutorials for GMS 2, you really know your stuff.
@MikeTheTech
@MikeTheTech 7 жыл бұрын
+jdaltair thanks! Much appreciated. There's lots more to come. 👍
@jdaltair
@jdaltair 7 жыл бұрын
Neat-o, I subscribed yesterday, hope to see more from your channel.
@julienlebosse662
@julienlebosse662 6 жыл бұрын
Hello, the bottom of the parallax should it not move less quickly than the foreground ??
@adriannavarro1955
@adriannavarro1955 4 жыл бұрын
great video! Thank you :) helped tremendously.
@MikeTheTech
@MikeTheTech 4 жыл бұрын
I'm glad the video helped! Cheers!
@al-farsigames538
@al-farsigames538 5 жыл бұрын
Thank you so much!
@jelser23
@jelser23 4 ай бұрын
lifesaver, man. Thanks
@MikeTheTech
@MikeTheTech 3 ай бұрын
Glad it helped!
@isaacrivera7808
@isaacrivera7808 6 жыл бұрын
Awesome, thanks, +1 like and suscriber!
@gruzum
@gruzum 6 жыл бұрын
hey! nice tutorial ;) but why does layer_x function only move Background layers and not Instance layers?
@easycool7254
@easycool7254 4 жыл бұрын
WORKED PERFECTLY:)
@MikeTheTech
@MikeTheTech 4 жыл бұрын
Nice! Thanks for commenting!
@respirra4717
@respirra4717 5 жыл бұрын
I owe You a lot Sir! Keep up the good work :)
@MikeTheTech
@MikeTheTech 5 жыл бұрын
Thanks for the comment!
@paulschulberg420
@paulschulberg420 4 жыл бұрын
Thank you so much.
@MikeTheTech
@MikeTheTech 4 жыл бұрын
You're welcome!
@PrabuWijaya
@PrabuWijaya 6 жыл бұрын
Nice video
@milddiffuse
@milddiffuse 6 жыл бұрын
I just can't get this to work and I really don't know why...
@StuartGrahamV
@StuartGrahamV 4 жыл бұрын
this has been the most calming tutorial I have seen, after coding for hours I needed it, thanks!
@MikeTheTech
@MikeTheTech 3 жыл бұрын
Glad it helped!
@vectrexpilot4616
@vectrexpilot4616 6 жыл бұрын
Hi there, First of all i love your channel that's why i suscribed and i hope you will make more gms2 stuffs :) Back to the subject, i followed exactly what you did in the tutorial but i don't understand why 1 of my background is moving too fast (even if speed is set to 1 *layer_x(layer_id5, lerp(0,camera_get_view_x(view_camera[0]), 1));* , is there a way "to freeze" it . Any ideas. Cheers. keep it up.
@dungos2932
@dungos2932 6 жыл бұрын
use .1, not 1. He uses .5 in the video, and according to the other people here, if you pop it up to 1, it s kinda wonky.
@codesymphony
@codesymphony 7 жыл бұрын
Hi. Do you have any idea why this code won't work for me? var back_id = layer_background_get_id("Background"); layer_hspeed(back_id, -20); I've dropped the object in my game, and the background doesn't move.
@MikeTheTech
@MikeTheTech 7 жыл бұрын
+symphony try "layer_get_id" instead?
@codesymphony
@codesymphony 7 жыл бұрын
thank you mate. not sure why there even is a layer_background_get_id
@steventechno
@steventechno 4 жыл бұрын
Liked for simplicity. Other tutorials go for using custom camera systems, which I'll eventually tackle in the future when I leave my comfort zone. I added my own tweaks, and it works great, thanks for the pointer!
@MikeTheTech
@MikeTheTech 4 жыл бұрын
Glad it was helpful!
@escarabajomayih
@escarabajomayih 5 жыл бұрын
excelente.
@jamiefox
@jamiefox 5 жыл бұрын
Genius
@MikeTheTech
@MikeTheTech 5 жыл бұрын
lol, thanks for the comment!
@magnus00125
@magnus00125 6 жыл бұрын
great except my art looks like a kid's drawing which is distracting from the game but ANYWAY my level has a lot of change in y value, I figure I should create some y lerp? the ground should probably not at all or very little, don't want the player to see nothing beneath the sprite
@devildeggz
@devildeggz 6 жыл бұрын
I couldnt get this working for 20 mins and then i realised that i made a create event instead of step lmao
@MikeTheTech
@MikeTheTech 6 жыл бұрын
+Rybellion 😂 happens to the best of us.
@MorganOliver77
@MorganOliver77 5 жыл бұрын
good tut, but did your web cam image really need to cover up that much screen?
@MikeTheTech
@MikeTheTech 5 жыл бұрын
yeah dude, I'm so pretty! 😂 JK. Eventually upgrading to green screen cutout.
@TheTrueFallenKnight
@TheTrueFallenKnight 7 жыл бұрын
can you make a Tutorial on how to make a RTS game ??? just asking
@MikeTheTech
@MikeTheTech 7 жыл бұрын
That would be a fun one! I have a few others lined up, but I'd love to eventually make an RTS tutorial.
@TheTrueFallenKnight
@TheTrueFallenKnight 7 жыл бұрын
cool :)
@Olkkulus
@Olkkulus 3 жыл бұрын
Making videos at 2AM?
@feronar-warsongus221
@feronar-warsongus221 4 жыл бұрын
Thanks for the tutorial, unfortunately when my character moved around, it caused the background to jitter around, especially when starting or stopping. It's most noticeable when I have an element that I want to stay still relative to the camera (lerp position of 1.0). So instead, I used a method similar to the following, and it works great for me: [DRAW EVENT]: draw_sprite_tiled(plxFantasyCave1, 0, camera_get_view_x(view_camera[0])*1.0, camera_get_view_y(view_camera[0])*1.0); draw_sprite_tiled(plxFantasyCave2, 0, camera_get_view_x(view_camera[0])*0.875, camera_get_view_y(view_camera[0])*0.875); draw_sprite_tiled(plxFantasyCave3, 0, camera_get_view_x(view_camera[0])*0.75, camera_get_view_y(view_camera[0])*0.75); draw_sprite_tiled(plxFantasyCave4, 0, camera_get_view_x(view_camera[0])*0.5, camera_get_view_y(view_camera[0])*0.5); You can also use draw_sprite_tiled_ext() for more flexibility (Scaling, colour, transparency).
@MikeTheTech
@MikeTheTech 4 жыл бұрын
Wow, thank you so much for the tip! I'm very appreciative for your contribution. Glad you found a solution!
@marcelsebek8446
@marcelsebek8446 4 жыл бұрын
There is an Owo in youtube link
@ThunderHail
@ThunderHail 7 жыл бұрын
Why a face cam???
@MikeTheTech
@MikeTheTech 7 жыл бұрын
Why not? lol
@pellax
@pellax 4 жыл бұрын
You talk a little bit like Barry White.
@spiritgame6259
@spiritgame6259 5 жыл бұрын
thanks! this really helped!
@MikeTheTech
@MikeTheTech 5 жыл бұрын
No problem! Happy it helped. 👍
GMS2 Tutorial: Rotating an Object to face the Mouse Cursor
7:07
MikeTheTech
Рет қаралды 13 М.
The Story of a Failed Game Dev
15:14
Kurt Indovina
Рет қаралды 95 М.
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,6 МЛН
Iron Chin ✅ Isaih made this look too easy
00:13
Power Slap
Рет қаралды 36 МЛН
A teacher captured the cutest moment at the nursery #shorts
00:33
Fabiosa Stories
Рет қаралды 45 МЛН
Absolute Beginner's Guide Part 13 - Parallax Backgrounds
21:31
Let's Learn This Together
Рет қаралды 1,8 М.
GameMaker Studio 2: Music Tutorial
16:53
Shaun Spalding
Рет қаралды 73 М.
🔴Game Maker Studio 2 | Basics - Parallax scrolling
6:16
1up Indie
Рет қаралды 21 М.
Organising Data | Menus: GMS2 [P1]
28:19
FriendlyCosmonaut
Рет қаралды 67 М.
GameMaker - Better Saving & Loading (JSON)
25:49
Shaun Spalding
Рет қаралды 46 М.
When Your Game Is Bad But Your Optimisation Is Genius
8:52
Vercidium
Рет қаралды 1,4 МЛН
Menus: Part 1 - Game Maker Studio 2
14:21
Code Workshop
Рет қаралды 66 М.
Death pit + save spot - [Game Maker Studio 2 | Basics]
5:28
1up Indie
Рет қаралды 6 М.
Optimisation Tips | GameMaker Studio 2
19:10
FriendlyCosmonaut
Рет қаралды 49 М.