GameMaker Studio 2: Complete Platformer Tutorial (Part 6: Cameras & Tiles)

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025
  • ▶ Source code: shaunjs.itch.i...
    ▶ Template Tileset: shaunspalding.c...
    ▶ Support my work: / shaunjs
    ▶ Assets www.shaunspaldi...
    ▶ Playlist: • GameMaker Studio 2 - C...
    New parts to this series released every other Friday.

Комментарии • 531

  • @ajojen6346
    @ajojen6346 4 года назад +414

    Whenever I hear Shaun say when the next video is coming out, it makes me grateful that I'm watching this series after it's all been finished.

    • @GosoeGoose
      @GosoeGoose 4 года назад +2

      I know what you mean

    • @plexim1591
      @plexim1591 4 года назад +1

      @Soron64 Same here haha.

    • @venom8771
      @venom8771 4 года назад +1

      @Soron64 yepp, such a good tutorial

    • @rueminnesota427
      @rueminnesota427 3 года назад +6

      New video in two weeks? How about two seconds? :)

    • @AZASeraph
      @AZASeraph 3 года назад +3

      4 years later and it's still good

  • @RuebyKing
    @RuebyKing 4 года назад +157

    I had to take 2 game design courses in college, and this man has taught me more in 6 videos than my teacher did in 6 months of classes. I realized that these videos are almost 3 years old but they are still extremely thankful that this series is here.

    • @skepticfoxy6780
      @skepticfoxy6780 2 года назад +5

      I'm taking game design right now and the teacher gave us some really basic guides and then told us to make a full game out of that he's expecting stuff that we haven't even learned lol.

    • @jakdadkaj4546
      @jakdadkaj4546 2 месяца назад +1

      @@skepticfoxy6780 i know this comments a year old but i have a question, im taking a 6 month game design next year and was wondering if game design actually included coding a game or is just system/level design, i dont mind either way but i am kind of curious what i might actually be learning.
      also wondering whether or not i'll will need the course because of how good this series is lol.

  • @alefweimann452
    @alefweimann452 Год назад +17

    Even 6 years after you posted this, this still the best tutorial ever!!! Thank you so much Shaun!!

  • @UNIPIXEL
    @UNIPIXEL 5 лет назад +150

    shaun: its very simple, you will be able to understand it easily.
    me: *pretends to understand* ok

  • @wilywolfy3593
    @wilywolfy3593 6 лет назад +83

    For those looking to change their default description in scripts, it took me a while to find it myself. File > Preferences > Object Editor, and you can change the description in the box.

    • @Racools
      @Racools 6 лет назад +4

      do u think u can help me? when im in my room idk how to select all the sprites and its becoming a hassle for me to alte delete the wall sprites one by one

    • @NoMics
      @NoMics 6 лет назад +8

      @@Racools go to the layer they are on and hold shift then select them

    • @ginko2692
      @ginko2692 3 года назад

      my hero.

    • @sambojam
      @sambojam 7 месяцев назад

      legend!!!

  • @mrpierreedel
    @mrpierreedel 3 года назад +25

    00.55 room parameters
    01:35 create camera object
    03:50 camera event create
    09:20 camera event step
    16:00 put the camera in the room
    17:00 camera sees outside the room
    20:50 camera follow
    21:30 tiles
    27:00 making walls invisible

  • @dev6rehab666
    @dev6rehab666 5 лет назад +92

    for some reason I enjoy how loud your keyboard is.

    • @FrocxterSharp
      @FrocxterSharp 5 лет назад

      ikr...XD

    • @aecusregen4614
      @aecusregen4614 4 года назад +5

      There's nothing quite like the crisp sound of an old keyboard

    • @BuzzardPlanet97
      @BuzzardPlanet97 4 года назад +4

      Game making ASMR is a genre I never knew I needed

    • @NathanGrebowiec
      @NathanGrebowiec 4 года назад +1

      @@aecusregen4614 these aren't old keyboards...there are modern mechanical keyboards that are fantastic (I am typing this very comment on a Corsair K95).

    • @explainit1250
      @explainit1250 4 года назад

      @@BuzzardPlanet97 lol

  • @a.m.hernandez3837
    @a.m.hernandez3837 7 лет назад +107

    my game is pretty awesome already! Even though it isn't really a game just yet I am so happy about the progress. Thank you so much, again, Shaun. Super cool. Hoping to have my game fully playable this year, kind of seems possible. Not to sure. You're great, glad this tutorial exists. I am having such a great time bringing my art to life.

    • @Lattamonsteri
      @Lattamonsteri 6 лет назад +4

      Ye is it ready? :D

    • @talaset6208
      @talaset6208 6 лет назад +3

      HYPE HYPE HYPE.

    • @stevenlrussell
      @stevenlrussell 5 лет назад +2

      Is it done now?

    • @stevenlrussell
      @stevenlrussell 5 лет назад +18

      You have 3 days to respond about the progress of your game or I will break your fucking knee caps and trap you in a room with just a computer and the software Gamemaker. You will start from scratch and you won't be able to leave until you feel completely satisfied with your game. You will live on water, and ramen noodles. Expect your shit to be watery, and guess what? You'll get only 3 rolls of Kroger brand toilet paper a week.

    • @harlee4052
      @harlee4052 4 года назад

      You ever finish your game?

  • @danielcampos8986
    @danielcampos8986 6 лет назад +131

    first time= WHAT ON EARTH???
    10th time= WHAT ON EARTH??
    20th time= aaaaaah

  • @rarebitfriend6677
    @rarebitfriend6677 4 года назад +5

    Thanks for all your excellent work Shaun.
    For anyone having the same issue as me - the camera jiggles once it has caught up with the follow object - this was my (probably very amateurish, but looks good) solution:
    // Update Position
    clx = (xTo - x) / 25;
    cly = (yTo - y) / 25;
    // 0.4 being whatever 'deadzone' you want the camera position not to move below
    if clx > 0 && clx < 0.4 clx = 0;
    if clx < 0 && clx > -0.4 clx = 0;
    if cly > 0 && cly < 0.4 cly = 0;
    if cly < 0 && cly > -0.4 cly = 0;
    x += clx;
    y += cly;
    x = clamp(x,view_w_half,room_width-view_w_half);
    y = clamp(y,view_h_half,room_height-view_h_half);

  • @danimations80
    @danimations80 4 года назад +3

    I love the subtle deceleration of the camera you've built in to this... hot tip! The auto-tiling overview was a nice bonus too.

  • @JETwardCentrella
    @JETwardCentrella 7 лет назад +2

    I was watching your GMS 1.4 version of this video and was a little put off by the changes to syntax in GMS2, so this was an incredibly welcome surprise to see! You are amazing and have made learning GMS2 so much easier!

  • @luxelivez
    @luxelivez 2 года назад +4

    It’s a great series and I’ve been following along so far, good explanation, but it will take time to remember all of the functions (code in orange, green, and red) until I can make a big project myself. It is part of the learning process but I can’t wait to remember them as easily as you do.

  • @Jigtei
    @Jigtei 6 месяцев назад

    You putting the camera focus on the enemy gave me the idea of making this toggleable in my game. Thx for goofin around and the tutorial.

  • @BuzzardPlanet97
    @BuzzardPlanet97 4 года назад +2

    Love your tutorials so much, other videos tell you how to make things work but with your videos I actually understand WHY they work

  • @ThisPossumKnits
    @ThisPossumKnits 5 лет назад +64

    I don't understand how we are moving the tiles slightly at 26:02
    They want to snap to a grid, but earlier we set the origin to middle center.
    SOLVED: select everything and when moving them use the arrow keys for fine adjustment

    • @chezchetterz5226
      @chezchetterz5226 5 лет назад +3

      Michael Niesner thank you holy lord!!!

    • @ameyawarade8377
      @ameyawarade8377 5 лет назад +4

      How to select ?

    • @ThisPossumKnits
      @ThisPossumKnits 5 лет назад +6

      @@ameyawarade8377 Try holding shift while you left click and drag the mouse to select a rectangular shape of tiles or hold CTRL while clicking on each tile you want to select.

    • @ajojen6346
      @ajojen6346 4 года назад +1

      So helpful! Thanks! :D

    • @plexim1591
      @plexim1591 4 года назад +1

      SAINT!

  • @kurtsherer8211
    @kurtsherer8211 2 года назад +2

    This series is incredible, and has really helped me start my project. Thank you so much!

  • @PatrickWard4
    @PatrickWard4 2 года назад +5

    While I am very new to this type of development. One idea for those that don't want to make a lot of different tile sets and want more fluid looking art.
    You can draw your art work in something like photoshop with the with the same dimension as your room and import that as your background layer. Then you can set your Walls instance layer to not be visible. So you have a bunch of generic solid oWall tiles that act as the floor and walls placed on top of your custom artwork in a way that matches what you've drawn (if you've draw a floor somewhere, just make sure the tiles cover that floor area or you are going to have weird spots that have invisible looking ledges).
    For me I like the look of custom artwork more than the tilemaps, even if it is more of a manual process and not as customizeable after the fact.

  • @briancalma4207
    @briancalma4207 7 лет назад +7

    it is sad when i heard the ""Little bit to late for a little while" :( dude your a hero pls create your video more often. Thank you for this one!

    • @briancalma4207
      @briancalma4207 7 лет назад +2

      Yes sir :) do hope i can create my own game at the end of this year.

    • @witzler11
      @witzler11 7 лет назад +3

      You are just amazing dude! I'm making a schoolproject and you are teaching me like a master :D Hopefully I get a good grade :3
      No really, keep up that good work!

  • @dswalkij3201
    @dswalkij3201 Год назад

    Thank you for sharing the game-making process from start to finish. I can see all the steps and plan with more information if I want to start making a game myself. Thanks.

  • @toniconge7003
    @toniconge7003 7 лет назад +1

    Ahh this stuff is so cool! I wasn't expecting to make it so the camera would snap into the game world but you proved me wrong :D
    That tile stuff so cool!
    Thanks for the great videos

  • @nicolasvasquez1516
    @nicolasvasquez1516 7 лет назад +3

    Thank you man, this really helps the fellas that can't go to formal game developing schools like me.

  • @anhtho2475
    @anhtho2475 2 месяца назад

    Thanks for the Template Tileset link, Sara!

  • @Lurkingintheshadows-ME
    @Lurkingintheshadows-ME Год назад

    bro, you are crazy about how fast you can do this and, you explain this so well.

  • @patrickberbon3135
    @patrickberbon3135 6 лет назад +2

    Bro this series is so good

  • @ajojen6346
    @ajojen6346 4 года назад +1

    Even though this is kind of trivial, I think it's worth mentioning that for the description, you don't necessarily need the full word "@description". You can have "@descriptio", "@descrip", "@desc", etc. As long as you have at least "@desc", then it will work just fine.

  • @BlazertronGames
    @BlazertronGames 5 лет назад +38

    You should have mentioned that for things like oWall, you should put the origin in the top left, so it matches with the grid better.

    • @loomac7961
      @loomac7961 5 лет назад +4

      THANK YOU SO MUCH YOU DON'T KNOW HOW MUCH THIS HELPED ME

    • @kristianberget6511
      @kristianberget6511 5 лет назад +1

      how do i do this???

    • @jrgamesbrx
      @jrgamesbrx 4 года назад +1

      you're a genius

    • @pavlevilotijevic7266
      @pavlevilotijevic7266 4 года назад

      Also changing the grid to 16 * 16 instead of 32 * 32 can be helpful

  • @namoune77
    @namoune77 4 года назад +2

    Shaun typing x += (xTo - x) /0.25; : "It's very very simple"
    Me : Yeah ! yeah ...

  • @AlainPilon
    @AlainPilon 7 лет назад

    Nice to show the "Open all event scripts", this is the kind of thing I would never have noticed, at least not before a long while!

  • @ChrisDubss619
    @ChrisDubss619 4 года назад

    i dont fully understand whats going on but i like following along and being able to manipulate little things and see the results, been reading some c++ book to better understand the terminology, thanks for the videos

  • @dominickgalizia-kelder8223
    @dominickgalizia-kelder8223 5 лет назад

    amazing, absolutly brilliant thank you so much shaun for helping me advance farther into gml designing

  • @Tuntira
    @Tuntira 7 лет назад +1

    YESS!!!! Been waiting for this! Thanks Shaun!!

  • @JeffSeverson1124
    @JeffSeverson1124 7 лет назад +1

    Great tutorial series. I'd love to see a tutorial in this series on elevators and ladders. Thanks! Look forward to the next one.

  • @NefariousPotatoes
    @NefariousPotatoes 7 лет назад

    Thank you so much for making this video, I tried to make the area to play larger but that caused the camera to stop working. This helped me out so much.

  • @Temzy
    @Temzy 6 лет назад +3

    Before I watched this video, I attempted and actually succeeded in making a makeshift camera using views but yours is better 😅

  • @tobiaskochhviid768
    @tobiaskochhviid768 7 лет назад +13

    Hey, I'm currently making a platformer with your platformer tutorial as my key tutorial. I tried making a checkpoint system, which makes it so i re-spawn at the current level, instead of restarting the game. I'm really new to game development, so I would love if you could make a video or a one of the platformer tutorials include a checkpoint system. Keep up the good tutorials ;)

    • @DAHN9000
      @DAHN9000 7 лет назад +4

      oPlayer = if (place_meeting(x,y,oCheckpoint))
      {
      checkpointX = x;
      checkpointY = y;
      }
      if (place_meeting(x,y,oEnemmy))
      {
      x = checkpointX;
      y = checkpointY;
      }
      there you go, it should work.
      (please reply if it worked)

    • @eightlight1195
      @eightlight1195 7 лет назад +1

      this didnt work for me sorryd

    • @sirsupercookie5784
      @sirsupercookie5784 7 лет назад +2

      MalikGamer6283 have you created the checkpoint Object?

  • @estebanduran6255
    @estebanduran6255 6 лет назад

    awesome video!! love the way you explain things out

  • @questionmarkquestionmarkques
    @questionmarkquestionmarkques Год назад +1

    ‼if the camera is already clamped before writing the clamp code its because you set your "objecct following" in the viewpoint settings to oplayer. this should be fine if you want it to only follow the player but if you want to make it focus on something else later on you should disable that and write the clamp code‼

  • @bscitdev
    @bscitdev 2 года назад +1

    lerp my beloved

  • @wickjon1844
    @wickjon1844 3 года назад +1

    If someone have issue about the tiles doesn't fit the wall make sure you come back to the sWall and change the coordinate back to topleft (any but not middle centre).

    • @99bikerfriends
      @99bikerfriends Год назад

      ahhh, thank you, this is what i was looking for :)

  • @Baleur
    @Baleur 4 года назад +1

    I am constantly amazed at how relatively "simple" coding is now in 2020...
    I mean, what was it, 4 lines of code to control camera movement AND the smoothing of it?
    In my brain i imagined a horrible incomprehensible web of hundreds of lines.

  • @FeniksGaming
    @FeniksGaming 7 лет назад +1

    Thanks for new episode, can't help but notice coincidence after my morning tweet :P

  • @deathincarnatesplace
    @deathincarnatesplace Год назад

    The changing follow is a way to make a loco focus in a game for you to have to hunt down something like a spirit you have to catch in a ghost you should make video game of this cause you can do it. platfoermer videos 21:28 #6 where you put in cameras. i also think it is already in a game.

  • @99bikerfriends
    @99bikerfriends Год назад +2

    Hi, I got your tutorials recommended to me and even all these years later, theyre great and are still really accurate, at 26:13 you shift the walls to be in line with the grid, I'm following along and hence have the same problem, but when i move them they are still misaligned, any more info on what you did to fix that issue would be great, cheers, and thanks again for these great tutorials :).

    • @99bikerfriends
      @99bikerfriends Год назад +1

      Scrolled through the latest comments and @wickjon18441 year ago had the fix :)

    • @giangio45510
      @giangio45510 10 месяцев назад

      change the origin of the wall sprite to any corner and it will snap successfully to the grid

  • @connorburbine9459
    @connorburbine9459 4 года назад

    I am learning gml very well thanks to your tutorials 😀

  • @stev1634
    @stev1634 4 года назад +1

    If your tiles are invisible when you run the game even though the layer is marked as visible, try cleaning the cache. Broom icon towards the top left, or [CTRL] + [F7].

  • @crainingaming3082
    @crainingaming3082 6 лет назад +20

    When I did my autotile it wasn't working. nothing happened, can anyone help please?

    • @MoltiSanti
      @MoltiSanti 5 лет назад +5

      Make sure you fill the first tile in the autotile with the last tile in the tileset. If it's left blank it won't work.

    • @EvandroCWB
      @EvandroCWB 5 лет назад +2

      @@MoltiSanti Thanks! It works :)

    • @MoltiSanti
      @MoltiSanti 5 лет назад +1

      @@EvandroCWB No problem. I made the same mistake.

    • @nikolaymalyshkin2948
      @nikolaymalyshkin2948 4 года назад

      Gosh thank you so much!

  • @TheHellokitty2009
    @TheHellokitty2009 3 года назад

    if you are having a problem with the camera zooming in to close add in the create event camera_set_view_size(cam,the height you need the camera, the width you need the camera); the width must be half the height to avoid stretching
    it must be between the cam and follow variable
    cam = view_camera[0];
    camera_set_view_size(cam, 4500,2250);
    follow = obj_player;
    view_w_half = camera_get_view_width(cam) /2;
    view_h_half = camera_get_view_height(cam) /2;
    xto = xstart;
    yto = ystart;

  • @piperwalton
    @piperwalton 5 лет назад

    A few questions (which may be addressed later in the series, so sorry if these are obvious):
    1. Is there a way to place wall objects in the grid from the start, so you don't have to later select them all and move them? I know you can change the origin of the wall sprite, but will that cause any problems with collision?
    2. If you want to have different environments with different-looking walls, do you just use the same wall object but just with different tile sets?
    3. If you wanted an object which the player could stand on but with different properties than a normal wall object (say, slippery ice, or a thin platform that you can fall through if you press down, or platforms that fall out from under you after a few seconds), do you have to add code in the player object for collision with each of these objects, like you do with "oWall"?

    • @giangio45510
      @giangio45510 10 месяцев назад

      maybe this is late but
      1. no it doesn't cause problems with collision, but if say you wanna rotate the wall the origin would be the centre of rotation
      2. yes, the wall object serves as collision dummy, you can use any tileset over it as texture as long as all the wall tiles follow the same collision rules that you want (e.g. you may wanna have platforms that you can jump on from below and that would require a different wall object
      3. i think you'd have to use another wall object with different physics, idt there's another way to do it. It would also be easier to work with, as in walls with different physics are colored differently (the normal one could be grey like the one in the video, slippery ice platforms could be blue, jump from below platforms could be green, that way it's easier to visualize them in the editor

  • @ryanstewie1437
    @ryanstewie1437 3 года назад

    sup shaun! great vid man, lots of love

  • @BALLZACKMASTER999
    @BALLZACKMASTER999 Год назад +1

    I dunno if you still check the comments of old videos but currently I've set the camera to deactivate all enemies outside the camera viewport's view by default, in oCamera's step event. I'm planning to include a instance_activate_region() event to reactivate objects that enter the viewport, but I'm blanking on what to put in the parentheses. If you're reading this, what would Shaun do?

  • @nebula_the_starfish
    @nebula_the_starfish 4 года назад +2

    Fun fact: If you switch the "/ 25" in the camera's step event to "* 25" you get this really cool effect where both sides of the room are overlayed on top of each other, and moving off the right of the screen makes it look like you come back from the left, but 'behind' where you were previously. It's really cool.

    • @popsicls670
      @popsicls670 3 года назад +1

      no it doesnt, it keeps flashing lights. at least for me

  • @happyfowl_8376
    @happyfowl_8376 Год назад +1

    If my player character is on the right half of the screen, the camera shoots up into the top and wont come down. It still moves fine on the X axis, but it is locked to the ceiling.

  • @TheNigel01
    @TheNigel01 Год назад

    27:00 tiles and objects are now placed on different grids.

    • @TheNigel01
      @TheNigel01 Год назад

      Nvm, I offset the tiles by 16 on both axes.

  • @fierorecensione5828
    @fierorecensione5828 7 месяцев назад

    Beautiful!

  • @52-hzwhale44
    @52-hzwhale44 4 года назад +1

    Its amazing you are amazing

  • @n_coder
    @n_coder 5 лет назад +3

    When the camera moves , my characters get kinda glicthed , it's like if I had changes their size to a number that isn't multiple by the original size , what do I do ?

  • @GeneralJWS
    @GeneralJWS 6 лет назад +7

    My Camera is zoomed out much further than yours. I want mine to be zoomed in on my player like yours. Please help!

  • @larryteslaspacexboringlawr739
    @larryteslaspacexboringlawr739 7 лет назад +1

    thank you for gamemaker video

  •  4 года назад

    It didnt work for me, what am I doing wrong? I wrote the same as you (till min 19:57 where you test it and it works for you but not for me) my camera just stays at the top-left forever.

    •  4 года назад

      BTW this is what I wrote:
      //create event
      cam = view_camera[0];
      follow = oPlayer;
      view_w_half = camera_get_view_width(cam) * 0.5;
      view_h_half = camera_get_view_height(cam) * 0.5;
      xTo = xstart;
      yTo = ystart;
      //step event
      //update destination
      if (instance_exists(follow))
      {
      xTo = follow.x;
      yTo = follow.y;
      }
      //update object position
      x += (xTo - x) / 25;
      y += (yTo - y) / 25;
      x = clamp(x,view_w_half,room_width-view_w_half);
      y = clamp(y,view_h_half,room_height-view_h_half);
      //update camera view
      camera_set_view_pos(cam,x-view_w_half,y-view_h_half);

    • @Ivan_Ooze
      @Ivan_Ooze 3 года назад

      Did you ever get this fixed? Clamping breaks my camera

    •  3 года назад

      @@Ivan_Ooze I don't think I did, I only used GMS2 for a month.

    • @Ivan_Ooze
      @Ivan_Ooze 3 года назад

      @ dam, thx for the reply

  • @whoolieman
    @whoolieman 7 лет назад

    nice work on the video dude !

  • @GuillaumeMercier-kh8yr
    @GuillaumeMercier-kh8yr 2 года назад +1

    Something's wrong with this my player is in the top right corner and the camera is below the floor...

  • @Racools
    @Racools 6 лет назад +2

    HOW....DO YOU.....DO THIS?? 26:05
    edit: found out. if u hold shift u can highlight

  • @karimalaili6109
    @karimalaili6109 11 месяцев назад +1

    This is a serious question.
    Does this series explain slopes?

  • @madbea49
    @madbea49 7 лет назад +9

    This has all been working great until I got to adding the tiles. I can't seem to get the wall objects to line up with the grid so I can perfectly line them up with my tiles. Any help on this?

    • @LeVu-ir2cn
      @LeVu-ir2cn 7 лет назад

      I have the same problem as well

    • @lego-man2821
      @lego-man2821 7 лет назад

      I had the same problem, but I figured it out. Go to tile properties in your tile and set tile width and tile height to 32 and that fixes the problem.

    • @t8ble498
      @t8ble498 7 лет назад +6

      In the room editor on the side, go to your tile layer and set the x and y offset accordingly (about half of your object resolution, such as for 16bit graphics set the offset to 8)

    • @johnstonliu8127
      @johnstonliu8127 6 лет назад

      THANK YOU SO MUCH!!!

    • @SteppenwolfBlues
      @SteppenwolfBlues 6 лет назад +1

      In this particular case, I set Offset X = 16 and Offset Y = 16 in Tile properties and fixed that.

  • @aydemironur35
    @aydemironur35 4 года назад

    ty for those tutorials Shaun you are the best :) im learning coding and im doing my very first game with you. Im chancing something because i want my game to be special. For camera, i think camera should be little bit left sided for platformer games. I tried to update some of codes for fellas whos think like me, if you want to change yours (guys on comment) you can add this codes.
    camera step event, add this to bottom (my left key is A if yours arrows, you should change the code, just copy from oPlayer's movement )
    if (oPlayer.x < oPlayer.xprevious) or keyboard_check(ord("A"))
    {
    x = (x -15);
    }
    and
    change camera create event codes values to this (0.3 instead of 0.5)
    view_w_half = camera_get_view_width(cam) * 0.3;
    view_h_half = camera_get_view_height(cam) * 0.3;
    this makes camera moving bacwards little bit when you turn left and and positions main view to left side of the screen. Its not that smooth but we are beginners. Its enough for me :). I wısh i could code mouse poınter camera movement for this but im too noob to do.
    edit: clamps
    x = clamp(x,view_w_half*0.75,room_width-1200)
    y = clamp(y,view_h_half*1.9,room_height-350)
    this works for me but my room is 1920x1080 your should manupulate numbers for your room

  • @piperwalton
    @piperwalton 4 года назад +1

    Why did you make the origin point of the wall sprite in the middle center? Wouldn't it make more sense to have it at 0,0 so you don't have to shift all the wall objects after placing them, so they'll fit onto the grid? Is there a reason you wouldn't want to do that?

  • @paperbag3897
    @paperbag3897 3 года назад +1

    Make The object Follow and set it to 5oo if youre chracter is 64 to 100 250 if 16 and 1000 if 2000 pixels

  • @phearedphantom
    @phearedphantom 5 месяцев назад

    If you use someone's work make sure to give credit based on their requirements. If there are no requirements then you should still put them in the credits

  • @sdk2n
    @sdk2n 7 лет назад +64

    Can you make a video for a title screen?

    • @CoTn
      @CoTn 6 лет назад +2

      He made one already. Just a bit later on

    • @talaset6208
      @talaset6208 6 лет назад +10

      I think he might have figured that out by now.

    • @ZayyzYT
      @ZayyzYT 6 лет назад +2

      @@talaset6208 yeah

    • @stevenlrussell
      @stevenlrussell 5 лет назад

      You find it?

    • @JustDoom
      @JustDoom 5 лет назад +1

      did he do a title screen video yet

  • @jadeotter3328
    @jadeotter3328 2 года назад +2

    ‼️IF THE AUTO TILES ARENT DISPLAYING RIGHT, TRY CLOSING GAMEMAKER AND OPENING IT AGAIN‼️
    Took me a while to find out, I feel great relief 😮‍💨.

  • @demale5967
    @demale5967 2 года назад +1

    I did everything but my camera doesn't follow my character...

  • @amazingsparckman
    @amazingsparckman 7 лет назад +31

    ah very good, grabs the pop corn

  • @Avaruusnuija
    @Avaruusnuija 4 года назад

    If you are following this with old version of Game Maker (I myself use Professional Edition 1.4.9999), you can do Shaun's "Game Maker Studio: Dynamic Camera Tutorial" instead of this, because this won't work on old GM.

  • @indiegame3212
    @indiegame3212 6 лет назад +7

    this didnt work for me, I set up the camera exactly the same as this but when I run the game, I see the camera move to a certain spot(not the player) and stay there, when I move my player underneath the spot the camera shifts around alittle but stays in the same spot. Help? My code looks exactly the same as in this video im confused.

    • @Kielserat6969
      @Kielserat6969 4 года назад +1

      /// @description Update camera
      //Update destination
      if (instance_exists(follow))
      {
      xTo = follow.x;
      yTo = follow.y;
      }
      //Update object position
      x += (xTo - x) / 25;
      y += (yTo - y) / 25;
      //Update camera view
      camera_set_view_pos(cam,x-view_w_half,y-view_h_half); heres some of my codes Shaun delete this if you want

    • @cheesenipspartymix
      @cheesenipspartymix 4 года назад

      @@Kielserat6969 still doesnt work :(

  • @PleasantWhale
    @PleasantWhale 4 года назад

    20:20 Uhhhh, uh oh. I typed the 2 lines of clamp code, and now my camera isn't moving. Help?

    • @jaspercunningham9607
      @jaspercunningham9607 4 года назад +1

      It's probably because your room isn't big enough for the camera to move around. Now that it is clamped to the edges, it can't move. If you make your room bigger it should work

    • @PleasantWhale
      @PleasantWhale 4 года назад

      @@jaspercunningham9607 I see, I'll give that a try. Thanks!

  • @MalakaiProgrammer
    @MalakaiProgrammer 6 лет назад

    Enemy follow i just made, it kind of works. I recommend you have the enemy's walkspeed lower than the player's, otherwise they will be right next to each other the whole time walking.
    if(oPlayer.x - other.x < attraction_distance){
    if(sign(oPlayer.x - other.x) > 0) hsp = walksp; else hsp = -walksp;
    }
    in the Create event on the Enemy have a attraction_distance variable, and set it to the amount of pixels you want the distance between the enemy and player until the enemy starts moving towards the player.
    I use 750 pixels for the attraction distance, and for the walkspeed, I use the player's walkspeed (4 is mine) take one, making the enemy's walkspeed random between 2 and 3, using "random_range(2,3)", so some enemies aren't on the exact same x value while walking.
    It's really easy but it works fairly well.
    EDIT: Used to say " if(oPlayer.x - oEnemy < attraction_distance){ " and "if(sign(oPlayer.x - oEnemy.x) > 0", changed all oEnemy.x to other.x, so it will target the instance of the enemy, not all of them.

    • @CallzPS
      @CallzPS 5 лет назад +1

      or you can just do:
      if instance_exists(oPlayer) {
      move_towards(oPlayer.x, oPlayer.y, 4)
      }

  • @Racools
    @Racools 6 лет назад

    if theres anything harder than this video i think ill just quit now XD. i finally understood the camera thing after maybe like 2 and a half hours. those 5-10 minutes turned into 2 and a half hours holy shit

  • @freehdmcgee2761
    @freehdmcgee2761 2 года назад +1

    So how do we make our objects collide with the tiles? I tried changing some code around, but they still fall straight through when they spawn in.

    • @corvus3132
      @corvus3132 2 года назад

      Perhaps they are positioned too low? You want them to spawn above the ground so it triggers the collision event. If they fall through even when spawning above the ground, make sure the vertical collision code in the Step event for the object that's falling through the floor is set up properly, which was described in Episode 1, at about 26 minutes.

  • @Mr_Blobby_
    @Mr_Blobby_ 2 месяца назад

    whenever i add the "clamp" the camera gets stuck and doesnt follow me, i followed the code exactly, maybe make a new tutorial of this?

  • @domyno6304
    @domyno6304 2 года назад

    Huge fan!

  • @leingang4033
    @leingang4033 2 года назад

    I wanted to make camera protrude forth as player walks. To do that I added two new variables -- xPl and yPl containing coordinates of the player. Then I changed meaning of xTo (yTo is basically useless now) to the spot I want camera to come to, i.e. 1/4 of screen's width if moving forwards and 3/4 of screen's width if moving backwards. Then I typed this code:
    if(follow.hsp == 0)
    {
    x += (xPl - x)/25; /// smoothly setting camera to original position if player stands still
    }
    else
    {
    xTo =(xPl + (view_w_half * 0.5) * sign(follow.hsp)); /// i want camera to move to this point
    /// adding to or taking from xPl a quarter of screen's width depending on the player's movement direction
    if(follow.hsp > 0) /// checking if player's moving to the right
    {
    x = min(x + 5, xTo); /// setting camera a bit to the right until desired point is reached
    }
    if(follow.hsp < 0) /// checking if he moves to the left
    {
    x = max(x - 5, xTo); /// setting camera a bit to the left until desired point is reached
    /// if u r retyping this, pay attention to operators (+/-) and functions (min/max)
    }
    }
    And for y coordinate: y += (yPl - y)/10;
    I changed the divider so that camera moves slower in that dimention

  • @WhimsicalWisp44
    @WhimsicalWisp44 4 года назад +1

    did auto tiling change cause mine is all messed up it looks fine in properties but the in auto tiling it breaks the sprit

    • @EquinoxGX
      @EquinoxGX 4 года назад

      I think it might have. Try quitting gms2 and coming back. That seemed to fix the display issue I was having. Now I have to figure out why the template box is turning red even though the first box has been left blank. Unfortunately, every search online has only returned questions from people who filled that box in and wondered why it wasn't working, so less than helpful.
      Oh, nevermind. You don't put the void tile in the first slot, you put the last tile in the first slot. Yet another problem solved by letting the video play for a few more seconds.

  • @deathincarnatesplace
    @deathincarnatesplace Год назад

    hey wanna have some fun i just tried it at 17:26 and it is making a face and getting stuck on walls but the face looks like the 2 frames endlessly rotating from the oPlayerA so if somehow messed it up but it is making this funny super fast smiley fast like a kid caught with his hand in the cookie jar right before a beating. will send what i did wrong when i find it. you can recreate it for fun if you want.

  • @wroflife
    @wroflife 5 лет назад

    For anyone having trouble with the camera not following properly make sure the x's and y's in lines 7,8,11, and 12 of step matches up. easy mistake to make if you're copy pasting

  • @Delanator77
    @Delanator77 5 лет назад

    26:10 How did you manage this sorcery? I have been stuck for like an hour and I know it's gonna be some stupid simple solution I'm missing

    • @freezlez_yt8412
      @freezlez_yt8412 3 года назад

      Hold ctrl+shift and then hold the mouse button and select the things u want to select
      ( reply if it worked)!

  • @antigamer1013
    @antigamer1013 3 года назад

    i am really proud of my self, I made full tiles that look good for the game style, I mean I didn't just make simple edges and grass as in the video, I drew the whole thing and it made it that it worked much better the only problem of this that a lot of them were kinda useless to make as I would probably not make thin grass parts for example because it looks ugly but its still great

  • @gamermasta525
    @gamermasta525 3 года назад

    I followed up to the 1st 15 minutes but the camera zoom in on the character but only the top half of my character How do I get the camera to Show my complete character

  • @ameliebattke9949
    @ameliebattke9949 4 года назад +1

    how can you select the objects in the room and then move them. doesnt work in my case

    • @nkoui
      @nkoui 4 года назад

      make sure you are on the right layer where you placed the object they should be listed on the left

  • @reed1645
    @reed1645 6 лет назад

    I had a problem several people commented about. The camera started in the top left and as my player moved right it moved diagonally from top to left, not following the player at all. It's fixed thankfully. My advice to anyone with the same problem is to quadruple check your code. Typing an 'x' instead of an 'y' is easily done and makes a mess of things.

    • @petervargas7136
      @petervargas7136 6 лет назад

      reed how did you do it. I'm stuck on that

    • @lukaskuntner6421
      @lukaskuntner6421 5 лет назад

      @@petervargas7136 same did you find a solution?

  • @ChaosHedgehog2
    @ChaosHedgehog2 3 года назад +1

    @Shaun Spalding Is there a video you would recommend for teaching people about how to make their own tile sets? I want to make my own but I don't know where to start.

  • @mortalpenguins62
    @mortalpenguins62 7 лет назад +9

    Doesnt work for me i did the camera code but it doesnt follow

    • @ms-ewan9350
      @ms-ewan9350 6 лет назад

      It just follows the camera object but not the player - I have the same issue.

    • @etsussameugla3740
      @etsussameugla3740 6 лет назад +4

      DROP THE CAMERA OBEJECT IN SCENE. iVE FORGOT THIS.

    • @DiegoGarciarealestateinvestor
      @DiegoGarciarealestateinvestor 6 лет назад

      Mine It just clamp in the upper left corner ones it goes to the level2. Need help!

    • @ms-ewan9350
      @ms-ewan9350 6 лет назад +8

      Here's my working code. Remember to put the camera object in the room, also, and enable viewports.
      CREATE:
      cam = view_camera[0];
      follow = obj_player;
      view_w_half = camera_get_view_width(cam) * 0.5;
      view_h_half = camera_get_view_height(cam) * 0.5;
      xTo = follow.xstart;
      yTo = follow.ystart;
      STEP:
      if (instance_exists(follow))
      {
      xTo = follow.x;
      yTo = follow.y;
      }
      x += (xTo - x) / 25;
      y += (yTo - y) / 25;
      camera_set_view_pos(cam,x-view_w_half,y-view_h_half);
      Hope that helped :)

    • @DiegoGarciarealestateinvestor
      @DiegoGarciarealestateinvestor 6 лет назад +1

      Thanks for your HELP!

  • @hiih7359
    @hiih7359 2 года назад +1

    Why am I teleporting even after copying his code?

  • @JoaderR
    @JoaderR 6 лет назад

    "Object: oCamera Event: Create at line 2 : unknown function or script view_camera"
    I got this on Compile Errors. Does anyone have any idea why this is happening.
    I did everything just like in the tutorial and I've already double checked everything.
    Help?

    • @JoaderR
      @JoaderR 6 лет назад

      I've solved it. I just put the wrong type of brackets at "cam = view_camera[0];"
      Instead of [], I put () by accident

  • @costco2
    @costco2 4 года назад +1

    Hello, does anyone know why when I input the tiles, everything including the walls are now invisible? Even removing the tiles and turning visible back on the wall, it still doesn't show.

    • @danowarkills4093
      @danowarkills4093 2 года назад

      I am having a similar issue. I wonder if a GameMaker update made this tileset incompatible somehow

  • @calebanderson3134
    @calebanderson3134 2 года назад

    Not sure if anyone else had an issue with the camera 0 placing oPlayer in the top left. I had to change "= 0.5;" add the end of the code to "/ 2;".

  • @alerider942
    @alerider942 6 лет назад

    im at 16:58
    My camera just fly's off to the side,
    i put this in the create event:
    /// @description Set up camera
    cam = view_camera[0];
    follow = Osurge;
    view_w_half = camera_get_view_width(cam) * 0.5
    view_h_half = camera_get_view_height(cam) * 0.5
    xTo = xstart;
    yTo = ystart;
    and this in the Step event:
    //update destination
    if (instance_exists(follow))
    {
    xTo = follow.x;
    yTo = follow.y;
    }
    //update object position
    x += (xTo - x) / 25;
    y += (yTo - x) / 25;
    //update camera view
    camera_set_view_pos(cam, x - view_w_half,y - view_h_
    Edit: I continued on until 20:50 and solved that problem with the thing he brings up but now it fly's upward after about 20's of the game being run

  • @angkhoa1216
    @angkhoa1216 Год назад

    it would be very swell if you can show us what sort of key combination did you use while doing the tile set and deletting the sprite

  • @oreoross7214
    @oreoross7214 3 года назад

    i got a problem... when i place walls, the walls always go into the intersection of the grid but when i put the tiles, the tiles go into the right place so what happens after that is the collision of walls doesn`t macth up with the tile

  • @sirplunge998
    @sirplunge998 3 года назад +1

    I don't know what happened, but I have an issue where when I use my ps4 controller my gun shoots fine but when I use the mouse my gun shoots realllyyyy fast.