# Monster, Level-Experience System?

**URL:** <https://forum.kirupa.com/t/monster-level-experience-system/184068>\
**Category:** programming\
**Created:** [April 1, 2006, 3:31pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068 "2006-04-01T15:31:11Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 1, 2006, 3:31pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/1 "2006-04-01T15:31:11Z")

</div>

heya one last question,

i got:

```auto
 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 😃

Regards,  
Ricer

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 1, 2006, 6:52pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/2 "2006-04-01T18:52:21Z")

</div>

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

```auto

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

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 1, 2006, 8:41pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/3 "2006-04-01T20:41:04Z")

</div>

Ah you’re a genious!!!

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

thnx for this beginning code bro !

thanks alot 😃

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 1, 2006, 11:04pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/4 "2006-04-01T23:04:40Z")

</div>

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 )

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 2, 2006, 2:19am UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/5 "2006-04-02T02:19:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 2, 2006, 2:43am UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/6 "2006-04-02T02:43:05Z")

</div>

Ah wrong file… fixed above.

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 2, 2006, 9:15am UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/7 "2006-04-02T09:15:09Z")

</div>

Nich thats exacly what i mean yes! 😃

ur awsome and bomb thnx for trying to make one 2 🙂

thnx guys

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 2, 2006, 2:28pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/8 "2006-04-02T14:28:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 2, 2006, 3:52pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/9 "2006-04-02T15:52:28Z")

</div>

i like it alot too 🙂

could u send the .fla idd love to help u 😉

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 2, 2006, 4:56pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/10 "2006-04-02T16:56:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ravmaster](https://avatars.discourse-cdn.com/v4/letter/r/ee59a6/32.png) [@Ravmaster](https://forum.kirupa.com/u/Ravmaster)\
**Post date:** [April 2, 2006, 5:29pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/11 "2006-04-02T17:29:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 2, 2006, 5:46pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/12 "2006-04-02T17:46:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 2, 2006, 6:31pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/13 "2006-04-02T18:31:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 2, 2006, 7:23pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/14 "2006-04-02T19:23:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 2, 2006, 8:37pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/15 "2006-04-02T20:37:15Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 2, 2006, 8:42pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/16 "2006-04-02T20:42:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 2, 2006, 8:42pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/17 "2006-04-02T20:42:38Z")

</div>

allright 🙂

Thnx for helping me (us) with this bomb 😉

ur a great guy ^^ 🙂

---

<div class="post-metadata">

**Author:** ![bombsledder](https://avatars.discourse-cdn.com/v4/letter/b/958977/32.png) [@bombsledder](https://forum.kirupa.com/u/bombsledder)\
**Post date:** [April 2, 2006, 10:28pm UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/18 "2006-04-02T22:28:26Z")

</div>

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

```auto

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

```

also you don’t die 😛

---

<div class="post-metadata">

**Author:** ![ricer](https://avatars.discourse-cdn.com/v4/letter/r/e47774/32.png) [@ricer](https://forum.kirupa.com/u/ricer)\
**Post date:** [April 3, 2006, 8:26am UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/19 "2006-04-03T08:26:20Z")

</div>

> [@Nich](#):
>
> 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.

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 🙂

---

<div class="post-metadata">

**Author:** ![Nich](https://avatars.discourse-cdn.com/v4/letter/n/e79b87/32.png) [@Nich](https://forum.kirupa.com/u/Nich)\
**Post date:** [April 3, 2006, 11:13am UTC](https://forum.kirupa.com/t/monster-level-experience-system/184068/20 "2006-04-03T11:13:38Z")

</div>

Yes, that’s exactly how you do it.

[Next page](https://forum.kirupa.com/t/monster-level-experience-system/184068.md?page=2)
