multi npcs on 1 sprite

0 favourites
  • 2 posts
From the Asset Store
Fantasy RPG Human-NPC assets pack of 15 characters
  • I have one sprite instance and have 12 npcs with their different walking animations for each direction.

    boy1left

    boy1right

    boy1up

    boy1down

    boy2left

    boy2right

    boy2up

    boy2down

    How do i get it to play the correct direction with the correct boy?, i need the expression to say "whatever boy is playing and the direction".

    set animation to "boy1" & "up" (the "up" part is determined by a value)

    The above code works with fine with one npc per different object sprite but im trying to combine them all in one sprite. Can this be done?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Instead of using a static value to represent each and every action, use instance variables to represent which version to display.

    I am assuming the list above of boy number and direction is what you name each of your animations.

    Use a variable to store the selected boy number: BoyNum = 1

    Use a variable to store the selected direction: BoyDir = "up"

    Then when setting the animation set it to: "boy" & BoyNum & BoyDir

    The above will result in the "boy1up" animation being played.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)