That works great but, if you want to use specific amount of experience points, then an array works great. What you were using wasn't actually an array. An array looks like this
`dim creates an array, how mant points of data is declared by the number in the parentheses.
dim levelexp#(10)
levelexp#(1)=100
levelexp#(2)=300
levelexp#(3)=400
levelexp#(4)=950
levelexp#(5)=1000
levelexp#(6)=1500
levelexp#(7)=2000
levelexp#(8)=3000
levelexp#(9)=4000
levelexp#(10)=4100
`then, with two variables-playerxp, and playerlevel....
do
for a=1 to 10
if playerxp>levelexp#(a)
if playerlevel<a
inc playerlevel
cls
print str$(playerlevel)
endif
endif
next a
if upkey()=1
inc playerxp
endif
sync
loop
Or if you want a generated level experience counter...
total_amount_of_levels_desired=10
dim levelexp#(total_amount_of_levels_desired)
for b=1 to total_amount_of_levels_desired
for c=1 to b
levelexp#(b)=100*c*c
next c
next b
`then, with two variables-playerxp, and playerlevel....
do
for a=1 to total_amount_of_levels_desired
if playerxp>levelexp#(a)
if playerlevel<a
inc playerlevel
cls
print str$(playerlevel)
endif
endif
next a
if upkey()=1
inc playerxp
endif
loop
The beauty of the second one is that there can be as many levels as you want.... eventually it gets pretty big though, level ten is 10,000 experience points. level 11 would be 12,100, 12 would be 14,400, up to 20 which would be 40,000 experience points.
parrot