How do I set exp growth for a rpg?

Get help using Construct 2

Post » Thu Jul 06, 2017 2:32 pm

hello i am having issues with my code for when you level the amount of exp needed is increased so you don't level constantly

https://drive.google.com/open?id=0B2Hdu ... HFWN1l1ZmM
B
15
S
7
G
3
Posts: 40
Reputation: 2,823

Post » Thu Jul 06, 2017 2:47 pm

I have the exp bar set to if > then 125 the exp bar goes back to zero but the exp needed seems to stay the same, im trying to set it so when the player levels the exp needed increases but the exp bar width stays the same, but it takes longer for it to go up to 125
B
15
S
7
G
3
Posts: 40
Reputation: 2,823

Post » Thu Jul 06, 2017 9:05 pm

In your capx do the following

Instead of :
set width: Sprite35.Min+1+experience.nextLevel

Do:
set width: Sprite35.Min+1+((experience.experience/experience.nextLevel)*124)

This way sprite35's width will always go up only to 125 and the width will be (nearly) proportional to the fraction of experience you have out of total needed to level up. So it will increase slower with each level (assuming experience gained from defeating foes stays the same).

Also you can use a 9-patch object for an experience bar as it can be tiled easily/expanded easily without stretching it so it can look prettier.
B
15
S
6
Posts: 85
Reputation: 1,195


Return to How do I....?

Who is online

Users browsing this forum: alextro, tarek2, wenwen11212016 and 10 guests