GameMaker Studio Tutorial - 2D Hack-n-Slash #20: PARALLAX BACKGROUND

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ •

  • @uheartbeast
    @uheartbeast  6 років тому +18

    Hope you guys enjoy the video!

  • @MoxlyMakesGames
    @MoxlyMakesGames 6 років тому +8

    Thanks for the tutorials, Ben! I recently started using Godot, and had finished your Platformer series. I was just wondering on how you themed your UI so well. Basically, when I tried theming my buttons, it didn't look very pixel-arty like yours. Meaning, it was stretched. I heard that I could use a NinePatchRect node, but I wanted to know how you did it. (Perhaps you can make a tutorial.) I was also wondering whether you are planning another Godot tutorial series.
    Cheers!

  • @hosamorfali3444
    @hosamorfali3444 6 років тому +2

    I jumped straight to this part to see how it looks in the end, and I can't WAIT to begin this tutorial

  • @svenbtb
    @svenbtb 6 років тому +1

    I'm still using the trial version of GM2 because I can't quite justify spending the money on a license quite yet, but I made a separate project so I could keep following along, and made a small project just to practice the backgrounds and the parallax. Thanks man, these are great, I'm really loving these videos and I'm learning a lot.
    Quick Question, where did you come up with those numbers for the parallax effect? Just trial and error? Or is there a formula to create a nice parallax effect depending on how many layers you want, screen size, etc?

  • @commenturthegreat2915
    @commenturthegreat2915 6 років тому +1

    It would be awesome if the background could interact with the foreground. for example enemys may appear in the background and jump into combat, giving you time to get some distance.

  • @oscur_destal
    @oscur_destal 6 років тому +1

    Hey I haven't watched it yet but I'd like to share something. After many tries, I've "discovered" the formula for making the background the right width (ie making sure you see it from the first pixel when you are on x == 0 of the room, to the last one when you are on the other side of the room, depending on the speed you want it to be, so you don't make a too wide background).
    First of all my code for moving the backgrounds / foregounds is in the begin step of the object o_camera, and it is:
    var _cam_x = camera_get_view_x(view_camera[0]) ;
    layer_x("Background_Sky", _cam_x * 1);
    layer_x("Background_Mountains", _cam_x * 0.9);
    layer_x("Background_Trees", _cam_x * 0.5);
    layer_x("Background_Plants", _cam_x * 0.3);
    layer_x("Foreground_Plants", _cam_x * 0.1);
    Now to find the size of the background, it's:
    camera_width + ((room_width - camera_width) - ((room_width - camera_width) * background_speed)).
    Then if you have a room 960 pixels wide and a camera 320 pixels wide and you want your background to move at a speed of 0.7, you need a background with a width of 512 pixels.

  • @Capn_
    @Capn_ 6 років тому +3

    Great video ! How can you do this in gamemaker studio 1.4 (like for the layer_x function which doesn't exist in it)

    • @cprn.
      @cprn. 6 років тому +2

      Explained in 9:29.

    • @Capn_
      @Capn_ 6 років тому

      Cyprian Guerra ty

  • @stedunn563
    @stedunn563 6 років тому +1

    Wow that really makes the game pop, if you could get the skeleton animation matching it's speed and with a little bit more weighty look it would be awesome. I'm poo at pixel art so wouldn't even know where to begin.

  • @MrSwerdna
    @MrSwerdna 5 років тому

    Really enjoying these tutorial videos! Thanks! One thing I noticed regarding this video...You set the Close/Far background grave positions with an offset on the Far ones so they don't sit on top of each other. However when you write the parallax code, you're setting the position of the grave's backgrounds in relation of the skeleton's position, essentially making the initial offset, pointless. Might not sound like much but you don't really want to use the same value to set the parallax and setting a background layer offset. Only noticed as I felt the offset between the backgrounds was to close but changing the x offset did nothing. Possibly this gets sorted in a later video...Just wanted you to know that I was paying attention ;)

  • @Trackaxion
    @Trackaxion 6 років тому

    Hey, just wanted to let you know that your videos were a great help in teaching me how to make my first game.

  • @Fierco3
    @Fierco3 4 роки тому +1

    If you're having problems with a jittery parallax. Use "End Step" event instead of "Step".

  • @lildgamedev6885
    @lildgamedev6885 5 років тому +2

    anyone else having the problem where when your at the edge of your screen and the background keeps moving with you? It ruins the effect im using my own sprites so maybe this has something to do with it im not sure

    • @RealHighBaby
      @RealHighBaby 4 роки тому

      ever figure it out? having same issue.

    • @lildgamedev6885
      @lildgamedev6885 4 роки тому +1

      @@RealHighBaby haha yes I did but it was like a year ago, let me see if i can remember what the problem was

  • @_drunkenStork
    @_drunkenStork 6 років тому +1

    My parallax background is scrolling faster as the player approaches the edge of the room. It levels off when I'm centered with the room. Any help would be greatly appreciated!

    • @greatpein
      @greatpein 5 років тому

      Hey my dude, I found the solution. Make sure under object following in Viewport 0 that it's set to skeleton and has a border of half of the camera width. I had mine less (120 instead of 160) and changing it solved my problem.

  • @MisterRandomEncounter
    @MisterRandomEncounter 6 років тому

    Enjoyed alot also yes you did cover object variables by accident last vid.. invisible and visable blocks :)

  • @ReversePrimeOFFICIAL
    @ReversePrimeOFFICIAL 6 років тому

    I am bad with pixel art can I use your sprites from the rpg but change the color and some details to make it not loook like yours

  • @wiwaszkiewicz66
    @wiwaszkiewicz66 5 років тому

    everything's fine so far except the clouds. they speed up for a moment whenever i change direction i run in. What can be the cause? please help.

  • @geraldoabilio
    @geraldoabilio 6 років тому +1

    Hi Ben,
    First, I'm a Brazilian guy and realy love your work (forgive my english), i will continue de text in portuguese because is more ease for me and you now this language.
    Ben, existe algum motivo especifico para não mudar as cores dos backgrounds diretamente no layer especifico? Você ter usado código para definir esses elementos é muito útil para uma maior compreensão dos códigos e de suas usabilidades, então se existir algum motivo a mais para usar o código em detrimento de alterar no layer a cor do background.
    Obrigado e se um dia você fizer um conteúdo especial em português será muito legal.
    Abraços.

  • @williamchambers1579
    @williamchambers1579 6 років тому

    Just finished the platformer-shooter Tutorial, freakin' great! I'm going to start this one this weekend... also have to check out Godot now lol. Thanks for the vids!

  • @MinecraftxPigs
    @MinecraftxPigs 6 років тому

    Hi Ben, would you continue godot tutorials ?
    ps you are great thanks for all tutorials!

  • @bumpcus7227
    @bumpcus7227 5 років тому

    probably no one will see this, but can i have help with the parallax in the step event? in in 1.4 btw

  • @jeromealday614
    @jeromealday614 6 років тому

    Why do you use long variables? I always use intials when naming variables.

    • @martijn19
      @martijn19 6 років тому +2

      Clarity. You're not writing for today, you're writing for your future self (or team) in a few months down the line.

    • @jeromealday614
      @jeromealday614 6 років тому

      Martijn Buurman I don't really get it. What are you talking about?

    • @martijn19
      @martijn19 6 років тому

      The reason to use long variable names is so that your future self can still understand what you were writing in the past at a glance.
      If you use initials everywhere it might be hard to understand later.

    • @jeromealday614
      @jeromealday614 6 років тому

      Martijn Buurman That why i always keep put a comment beside when setting up a new variable hahaha

    • @cprn.
      @cprn. 6 років тому +1

      What if you decide to change whatever that variable represents? E.g. if you decide to change "CloseGravesBackground" to "ParalexClose" and replace graves with something else, e.g. trees in level #3... Do you remember to update your comment? Most people don't. That's why comments are considered bad practice and descriptive variable names aren't. Your code should self-document, i.e. it should be simple for everyone to know what's what without comments. The problem you're having is not a long variable name but the lack of auto-completion in your IDE.

  • @megawindowscx1
    @megawindowscx1 5 років тому

    I missed this error and I do not know why he did everything exactly the same "Wrong number of arguments for function layer_x"

  • @cprn.
    @cprn. 6 років тому +3

    I admit I don't pay for your course because I'm Godot fan... but you've got my like under every video.

    • @uheartbeast
      @uheartbeast  6 років тому +3

      Thanks I appreciate it. I'm going to try and finish this series up quickly so I can do more Godot content.

    • @cprn.
      @cprn. 6 років тому +1

      No worries, I enjoy it even though I don't follow it. You're extremely creative and brave to follow your dream of making a living out of games and courses. Best of luck!

    • @LuisFlores-gr1bw
      @LuisFlores-gr1bw 6 років тому +2

      HeartBeast dont move on too quickly you still have GM2 lovers out here 🤣

  • @joffarex
    @joffarex 6 років тому

    Could not we just change colors from Layer Properties?

  • @GodOfTetris90
    @GodOfTetris90 6 років тому

    Nice tuto

  • @ZoidbergForPresident
    @ZoidbergForPresident 6 років тому

    Variable definitions is nice for the colours but there's one issue: in the editor, the layers still have the colours defined in the editor, any way to get wysiwyg? :P

  • @tvgeneral7178
    @tvgeneral7178 6 років тому

    Love you video

  • @jeromealday614
    @jeromealday614 6 років тому +1

    Can you do Android tutorials? It would be really nice because most of gaming moved to phones.

    • @commenturthegreat2915
      @commenturthegreat2915 6 років тому +1

      Really? A sad day for gaming...

    • @jeromealday614
      @jeromealday614 6 років тому

      Commentur The Great Lol, Most of indie developer loved the mobile gaming scene because it allows them to release shitty apps and make money off of them. You don't understand cause your'e just a casual gamer that doesn't even fucking know how hard it is to sell indie games for pc.

    • @Hoichael
      @Hoichael 5 років тому +3

      @@jeromealday614 Most people are here because they are passionate about games, not because they want to "make money off shitty apps".

  • @gozen0
    @gozen0 6 років тому

    :D