• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • 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
    15
    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?
     
    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.
     
    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
     
    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