8 Directional Movement: Spritesheets | GMS2 [3]

Поділитися
Вставка
  • Опубліковано 9 лют 2025
  • In the final iteration of our 8D movement system, instead of using separate sprites for each direction, we use a single spritesheet!
    Sprites download:
    1drv.ms/f/s!Am...
    Sprites credit:
    Adapted from TheNess "RPG sprite - 8 direction human male 16x16": opengameart.or...
    Here I am in other places:
    FriendlyCosmonautDev channel: / @friendlycosmonautdev8040
    Twitter: / friendly_cosmo
    Patreon: / friendlycosmonaut

КОМЕНТАРІ •

  • @Beologe
    @Beologe 3 місяці тому +1

    this is so nice and smooth, thank you for this tutorial :)

  • @Camdoggage
    @Camdoggage 5 років тому +8

    Thank you for taking the time to make all these, and additional thanks for your use of visual aids and your general teaching style-- I've been struggling a great deal with my confidence as a new programmer, and the accessibility of your content has made a world of difference for me. :)

  • @typicalplayer9344
    @typicalplayer9344 5 років тому +4

    Wow i'm glad i found you through the gamemaker tutorials, i have a feeling i'll be visiting this channel quite often for various topics that ya made! Thanks for all the effort you put in

  • @mahmoud.zayedd
    @mahmoud.zayedd 5 років тому +4

    Welcome back , Love your videos The quality of it is insane 🙋 .

  • @Etredal
    @Etredal 5 років тому +6

    Glad to see frequent uploads again!

  • @CriticalBattle
    @CriticalBattle 3 роки тому +1

    This was well explained, nice job Cosmo.

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

    Thank you for posting these tutorials! I'm currently following along with your farming series. The videos are inspiring and have helped me to keep my motivation up. I'm looking forward to more videos. They have inspired me to attempt making seasons for the farming game I'm working on. If you get the chance I would love to see how you approach visually creating seasons!

  • @GMWolf
    @GMWolf 5 років тому +8

    quite neat way to do this! Goes to show you dont always need all the high level features an engine offers!. I would add though that you might want to use div rather than / when calculating the yframe in case your dir isnt exact multiples of 45 (say you add acceleration curves).

  • @igord4679
    @igord4679 2 роки тому

    Самые лучшие уроки на ютубе ! Спасибо ! Голос приятный , все легко и понятно.

  • @steveyOhmey
    @steveyOhmey 2 роки тому +2

    Trying to use this logic for a 4 directional animation (where the character stays in either horizontal or vertical animation while moving diagonally), but when I move diagonally the y_frame goes out of wack... like I have the top and bottom half's of two vertically adjacent frames....trying to figure out what part of the maths is causing this but its destroying my brain

  • @x8squish8x16
    @x8squish8x16 5 років тому +1

    More yay these tuts are amazing

  • @fierorecensione5828
    @fierorecensione5828 Рік тому

    yeah!

  • @SOULS231
    @SOULS231 2 роки тому +1

    just in case anyone else has the issue where a fraction of a pixel is visible above their sprite, I increased my y_offset variable by .25. so in my case, doing y_offset = 24.25; worked to remove that subpixel.

  • @Luigi_Jr
    @Luigi_Jr Місяць тому

    So I'm tryna follow this 8 directional moving tutorial mixed with another tutorial on how to make RPGs, and my main issue is that the spritesheet doesn't animate, but the tutorial only seems to be accounting for if it's always animating.
    Edit: I fixed that issue, it's all good. But if you wanna leave a reply for anyone else who's trying to do the same thing I'm doing, go ahead and do that!

  • @waxfreeointment2121
    @waxfreeointment2121 5 років тому +1

    Thank you for posting this!!

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

    cosmo please help i cant seem to figure out hwo to deselect a slot when the mouse isnt near the inventory, it always has one selected

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

    Very useful! When using this method, do you assign a sprite that has the mask you want, or do you create a bounding box in code?

  • @reuzlwickluwican2351
    @reuzlwickluwican2351 3 роки тому

    Can I make the character move in more directions?

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

    thanks, this method is so nice and neat ^__^

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

    This might sound stupid, but how would I get collisions running for this sort of movement? I’ve tried multiple scripts, but they all failed

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

      This tutorial only changes the apparence of the object so it shouldn't change anything about the collision part
      that said there is one easy to make mistake here.
      You have to make sure that your object has the right sprite assigned to it.
      In this tutorial is that a 17x17 sprite named "spr_r".
      (you can see that In the left of the sceen for most of the video)
      You can use any sprite so it doesn't have to be "spr_spritesheet"
      and this sprite (by defealt) will be use for collision.
      I hope this helps

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

      You can use place_free(x, y) to prevent collisions with solid object.
      (this is probably what you were looking for)
      replace:
      x += moveX;
      y += moveY;
      with:
      if (place_free(x+moveX, y+moveY))
      {
      x += moveX;
      y += moveY;
      }

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

      I just added this:
      if (!place_meeting(x+moveX,y,obj_collisionBox)) x += moveX;
      if (!place_meeting(x,y+moveY,obj_collisionBox)) y += moveY;

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

      Hmmm... yes that would be even better.
      You just have to make sure the everything you want to collide with is obj_collisionBox or is a (grand)child of obj_collisionBox and that would work fine.

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

      @@joepveenman heh, I was making this for a school project, thanks for making so much to help though

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

    how can i change the position of the origin? i used this in "click to move"-movement and a problem i'm having is that the player moves his chest to the point where i clicked instead of his feet...

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

    u legit need millions of subs

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

    i like the video but it would've really been nice to see how to use idle frames for specific animations and also switching to different rows on the same sprite for attack animations and stuff... this seems oriented to exactly your sprite sheet

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

    great video 👀💓👍🏻

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

    good job

  • @MiguelAngelValdepenaDelgado
    @MiguelAngelValdepenaDelgado 2 роки тому

    woow

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

    Can I do this in GMS 1.4, is there any limitation?

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

      You can do this in GMS 1.4 without any problem.

  • @alantalan228
    @alantalan228 2 роки тому

    and stop creating a wall?

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

    I have issues with 8 directional movement, when i move diagonally, and i release both keys it will face (most of the times) up or left instead of up-left or any other diagonally direction. Because i can't release both keys on exact the same time i presume. Do you have any suggestion for this?

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

      Well I have a suggestion. you could slow down proces of "not animating" (stopping with changing the x_frame and y_frame) like this.
      >> set "animation_slowdown=0" in your create event. 0)
      {
      //Increment frame for animation
      y_frame= dir/45;
      //Set direction
      x_frame += anim_speed/room_speed;
      if(x_frame >= anim_length) x_frame = 0;
      }
      else
      {
      x_frame = 0;
      }

    • @syantorres5817
      @syantorres5817 3 роки тому

      anyone solved this problem?

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

    Can i skip this or it is important?

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

    I have an Idea you should make a online game that's not a plan game

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

    Lan*