• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Moving a graphic in the Bag depending on the pocket you're in

BadSamaritan

Gone Fishin'
  • 148
    Posts
    15
    Years
    • Seen Jun 8, 2023
    ------------------------------------------------------
     
    Last edited:
    You have lines that read elsif @bag.lastpocket=5 which only have one = in them. This is wrong, because that's an assignment rather than a comparator. Use == instead.
     
    Might I recommend a single line of code? Utilizing math you can just have the game calculate the coordinate for you, rather than using a huge string of elsifs.

    Code:
    @sprites["bagselectioncircleicon"].x=60+40*(@bag.lastpocket)
     
    Back
    Top