1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

An Inquiry About Sprite Control

Discussion in 'Programming' started by Ceddil, Dec 8, 2017.

  1. Ceddil

    Ceddil Member

    Aug 1, 2017
    Hey All!
    I have finished a game. Well, "finished" in the sense that I have all the programming and mechanics, but no art. I was going to make some animations for my player, but don't know how to control that. For starters, how would I make my character walk down/left/up/right and change between them depending on the direction it is going? And, would I make 4 different sprite sets, or would I cram it all into one and distinguish it?
    I hope this made sense and Thank You!
  2. Halph-Price

    Halph-Price Member

    Mar 20, 2017
    Look over some
    https://docs.yoyogames.com/source/dadiospice/002_reference/objects and instances/instances/instance properties/index.html

    There's basically 2 different factors, sort of like you mention. Either changing image_index or changing sprite_index. sprite_index is changing different sprite sets. image_index is changing different sub image for each sprite set. So sprite_index changes which sprite you're using, image_index changes which frame of that sprite you're viewing. Most people usually cram all the frames into one sprite set and just change the image_index, as this gives you the most control over animation.

    I mean for most animations you only need 2 to 6 frames for anything, so it's usually pretty manageable to just change the image_index as needed with all the frames crammed into one sprite set, but it is easier to just change sprite_index for each animation.

    is sort of what you're looking for

    Something to keep in mind is depth of the objects, if it's not directly overhead or side view, you can just set depth to equal x value if it's an isometric view.

    Sprite_index is the overall sprite set you're using, image_index is each from of that sprite, image_speed is how fast per step it will animate the sprite.

    There's a lot of choices, but having 4 different sprite sets is probably the best bet.
  3. TheouAegis

    TheouAegis Member

    Jul 3, 2016
    Are you going to manually specify when and where to change each frame of each animation? Or do you want the game to do it for you? If you want gamemaker to handle all of the animation for you, then it is easiest to use one Sprite per direction per animation. In other words, one Sprite per Direction walking, one sprite per direction attacking, etc etc.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice