Monster, Level-Experience System?

heya one last question,

i got:

 onClipEvent (enterFrame) {
    if (_root.moving_mc.hitTest(this)) {
        _root.health>0 ? _root.health -= 2 : _root.moving_mc.play();
    }
} 

as my monster script
but how can i make an “experience” system?

like: 1000 exp = lvl 2

4000 = lvl 3

8000 = lvl 4

anyone that can edit my code with that?

and how should i make the dynamic box then for lvl and exp?

and the “battle” sysy? like fighting with swords

thnx :smiley:

Regards,
Ricer

i would make a formula that fits you needs, maybe something like


function getExpToLevel(lvl){
return Math.ceil(100+(10+1.2*Math.pow(lvl,2)))
}
for(i=0;i<20;i++){
trace("Level "+i+" = "+getExpToLevel(i))
}
for(i=50;i<100;i++){
trace("Level "+i+" = "+getExpToLevel(i))
}
//just to get an idea of what it would be in the future levels

not sure what it comes to, but its just an example you might want to expirment untill you find a formula that fits your needs

Ah you’re a genious!!!

ill just expand this code and ill release it for other RPG makers :slight_smile:

thnx for this beginning code bro !

thanks alot :smiley:

Ricer, by weapon system do you mean something like this?
(ctrl to use the sword, go through the door to find enemies, needs flash 8 )

umm pressing control doesn’t work, i’ll see if i can’t make an example from my tile based engine

Ah wrong file… fixed above.

Nich thats exacly what i mean yes! :smiley:

ur awsome and bomb thnx for trying to make one 2 :slight_smile:

thnx guys

I’m glad you like it :). Still has a lot of work to be done before it’s “done”, that’s early beta at best, but I’m happy with it so far.

i like it alot too :slight_smile:

could u send the .fla idd love to help u :wink:

Nah, this is a solo project of mine. Thanks for the offer though

hey nich do u think you could make a source file or something for that please?
and if you could mx 2004 useable :smiley:

No, I’ve done a lot of hard work on that and I’m not comfortable making it open source. Not to mention I’m not finished. If you have any question about how a particular part is done, I’d be happy to try and answer your questions.

k :slight_smile: but can u just release the script u made of the monster with the hp and stuff? ^^

well that’s part of my broken buggy ai that I need to change, but I’ll explain the gist of it. The health is just done in arrays, so each enemy is given a max health value and a current health value. When the enemy is generated, I make the current health equal the max health. When any given attack hits an enemy, I subtract the damage from the value of their current health. In my ai, I test that the enemy’s health is greater then 0, and if it isn’t I set a variable, creatively called “dead”, to true, which shuts down the whole thing and removes the movie clip. The movement is a simple enemy._x += 1 type thing, and I hitTest the walls to change direction.

im going to release mine later, .swf and .fla, but im going to take out my enemy moving algorithm because well i put alot of hard work into,

I know exactly what you mean bombsledder. Looking forward to it.

allright :slight_smile:

Thnx for helping me (us) with this bomb :wink:

ur a great guy ^^ :slight_smile:

well here it is, note that is not the best and i compiled for flash 6, its very basic and the ugly tile system with not many good benifets and walking is just ugly, but its for the exp and lvling help anyways, to kill things just click on them, and you have to be next to them hehe,

fla is too big

sorry guys =( gotta use rapidshare


http://rapidshare.de/files/17064690/Practice_EXP.fla.html

also you don’t die :stuck_out_tongue:

allright but right before u remove the movieclip u must put a line like:
_root.exp += 20; or something and thats how u can variate this stuff

im beginning to understand it i guess :slight_smile:

Yes, that’s exactly how you do it.