How do I Create an Experience Table

Get help using Construct 2

Post » Sun Aug 28, 2016 9:27 pm

Hey there,
I am starting work on a level up system and I am looking for the most efficient way of handling this.

I current plan is to have the players total experience in a variable and then have a bunch of if statements.
if exp > 100 = make player level 2
if exp > 400 = make player level 3
if exp > 1200 = make player level 4
and so on.

I have a feeling there is a simpler way to do this though. Perhaps with JSON or a Dictionary or who knows.

Any advice?

Thank You,
Stephen
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Sun Aug 28, 2016 11:13 pm

If all you're doing is setting a level based on exp, you don't need any JSON or Dictionary..
I'd say what you're doing is fine (it's pretty simple already). If you really wanted, you could figure a single formula that would do all that. but the only difference would be how many lines of code it took..
B
86
S
43
G
71
Posts: 601
Reputation: 43,619


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests