• 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?".
  • 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.

Where is the position of the enemy hp bar defined?

320
Posts
14
Years
    • Seen Dec 27, 2021
    When I change the HPGAUGE_X value the player hp bar moves.
    The enemy hp bar just disappears or move offscreen..
    Where can I define the position of the enemy hp bar?
     

    Maruno

    Lead Dev of Pokémon Essentials
    5,286
    Posts
    16
    Years
    • Seen May 3, 2024
    Both bars use the same coordinates. Something that is in a different place depending on whether it's for a user's Pokémon or an opponent is the shininess star, so you could have a look at that to see what to change.
     
    320
    Posts
    14
    Years
    • Seen Dec 27, 2021
    Sorry but I don't get it.
    How can they both use the same coordinates.
    The only thing I see that defines how the bars are drawn is this code:

    self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY,hpgauge,2,hpcolors[hpzone*2])
    self.bitmap.fill_rect(@spritebaseX+hpGaugeX,hpGaugeY+2,hpgauge,4,hpcolors[hpzone*2+1])

    How does it possible draw two of them with only this? :S
     

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • Sorry but I don't get it.
    How can they both use the same coordinates.
    The only thing I see that defines how the bars are drawn is this code:

    How does it possible draw two of them with only this? :S

    Because of this:
    Code:
    @sprites["battler0"]=PokemonDataBox.new(battle.battlers[0],battle.doublebattle,@viewport)
    @sprites["battler1"]=PokemonDataBox.new(battle.battlers[1],battle.doublebattle,@viewport)
    As you can see, both of the battle boxes use the same class when they are loaded up and called up. There are some differences in the two though, like the player box has @showhp=true and @showexp=true. So if you were to create conditional branches to check for those (hence distinguish from player and opponent boxes) you could tweak the positions of the HP bars to your desire.
     
    Back
    Top