android
Prev Previous Post   Next Post Next
  #11  
Old 09-08-2010, 12:58 PM
Brett_val's Avatar
Brett_val Brett_val is offline
Senior Member
 
Join Date: Jan 2010
Location: The Netherlands
Posts: 636
Default

Why don't put the exp in a table? Would make the function a lot shorter. Also, if you want it to get increasingly harder to progress to the next level, I think you should work with a parabola. [edit: I realize s1m1s already did this.. well sorry I was just bored and felt like messing around with some formulas] This is just an example and should be fine-tuned to suit your needs;
Code:
exp={0,0,0}
magic=1
strength=2
agility=3
level={0,0,0}

function giveexp(skill,up)

	exp[skill] = exp[skill] + up
	
	if exp[skill] >= 10 * level[skill]^1.8 then
		level[skill] = level[skill] + 1
	end
end
giveexp(magic,10)
__________________
this is a link to my personal homepage which I haven't

Last edited by Brett_val; 09-08-2010 at 02:48 PM. Reason: little simplification
Reply With Quote

 

Tags
creative, habhome, lua, neko apprentice, rpg, xfi2, zen

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 12:07 PM.