how to fix

  • i did what you showed there, everything works perfect. Only one tiny problem.

    When i click the gain exp button, its bar starts at half way,

    Look at the picture below

  • i did what you showed there, everything works perfect. Only one tiny problem.

    When i click the gain exp button, its bar starts at half way,

    Look at the picture below

    As i said last post, you need to set the EXP bar sprite origin point to left.. by default it is in the middle of the sprite.

    Open the EXP sprite look on the left menu "Edit the image points", it will have origin point 0, right click on it -> Quick Assign -> Left

    After that it will change the position, you will have to set it again, here 44, 81 is working fine

  • i done that, its not working

  • Its working now ! :) thank you very much for your help!!

    Now i will go and fix my other project problem xD

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • :) good, keep going

  • I have a solution to the Experience Bar Width problem ;

    1. Create 2 variables
      • Experience(Current Exp)
      • MaxExperience(Amount of Exp needed to Level up)
    2. Create 2 sprites
      • ExperienceBar(displays current Experience)
      • MaxExperienceBar(Amount of Exp needed to Level up)
    3. Then place the "ExperienceBar" sprite over top of the "MaxExperienceBar" sprite
    4. Then take the Experience Bar and set is width to "Experience" percent of the "MaxExperience" variable

    ExperienceBar set width to: round(Experience/MaxExperience)*MaxExperienceBar.Width

    This whole thing means that there is no direct correlation between the Experience Bar's width and the Variable "Experience". It actually just sets its width to a percentage.

    ex. Player's Exp is 75/100, 100 being the amount of ex they need to level up.

    Since 75/100 is 0.75, convert that to a percent and you get 75%, you then set the Exp Bar's width to 75% of its maximum width.

    This Solution works with any type of bar ;

    health, exp, ammo, timer, progress, etc.

  • > ExperienceBar set width to: round(Experience/MaxExperience)*MaxExperienceBar.Width

    Is the same as he is doing, only different order..

    70.441*(Player.XP / Player.nextLevel)

    70.441 = MaxExperienceBar.Width

    Player.XP = Experience

    Player.nextLevel = MaxExperience

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