# Check this Code(Rpg Monsters)

**URL:** <https://forum.kirupa.com/t/check-this-code-rpg-monsters/65335>\
**Category:** programming\
**Created:** [September 25, 2004, 3:39am UTC](https://forum.kirupa.com/t/check-this-code-rpg-monsters/65335 "2004-09-25T03:39:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Enix591](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/enix591/32/751_2.png) [@Enix591](https://forum.kirupa.com/u/Enix591)\
**Post date:** [September 25, 2004, 3:39am UTC](https://forum.kirupa.com/t/check-this-code-rpg-monsters/65335/1 "2004-09-25T03:39:59Z")

</div>

These Are My “A” Class Enemies

```auto
/////A Class Enemies/////
AEnemies[1] = "_Angel";
AEnemies[2] = "_ChineseDragon";
AEnemies[3] = "_DarkAngel";
AEnemies[4] = "_Demon";
AEnemies[5] = "_EarthElement";
AEnemies[6] = "_FireElement";
AEnemies[7] = "_WaterElement";
AEnemies[8] = "_WindElement";

```

These Are My “B” Class Enemies

```auto

/////B Class Enemies/////
BEnemies[1] = "_Armor";
BEnemies[2] = "_BlueDragon";
BEnemies[3] = "_Chimera";
BEnemies[4] = "_Cyclops";
BEnemies[5] = "_HeadlessKnight";
BEnemies[6] = "_HornDemon";
BEnemies[7] = "_Hydra";
BEnemies[8] = "_Lamia";
BEnemies[9] = "_Minotaur";
BEnemies[10] = "_OldDragon";
BEnemies[11] = "_SeaSerpent";
BEnemies[12] = "_TailDemon";
BEnemies[13] = "_Troll";

```

These Are My “C” Class Enemies

```auto

/////C Class Enemies/////
CEnemies[1] = "_Cenataur";
CEnemies[2] = "_ClawMan";
CEnemies[3] = "_FishMan";
CEnemies[4] = "_Frog";
CEnemies[5] = "_Gryphon";
CEnemies[6] = "_Harpy";
CEnemies[7] = "_Hippopotamaus";
CEnemies[8] = "_LizardMan";
CEnemies[9] = "_Manticore";
CEnemies[10] = "_Skeleton";
CEnemies[11] = "_Tengu";
CEnemies[12] = "_TigerMan";
CEnemies[13] = "_Triton";
CEnemies[14] = "_WereWolf";
CEnemies[15] = "_Zombie";

```

These Are My “D” Class Enemies

```auto

/////D Class Enemies/////
DEnemies[1] = "_Crab";
DEnemies[2] = "_Drake";
DEnemies[3] = "_Scorpion";
DEnemies[4] = "_Snake";
DEnemies[5] = "_Spider";
DEnemies[6] = "_Wolf";

```

These Are My “F” Class Enemies

```auto

/////F Class Enemies/////
FEnemies[1] = "_Bat";
FEnemies[2] = "_Bee";
FEnemies[3] = "_Dragonfly";
FEnemies[4] = "_Eagle";
FEnemies[5] = "_Slime";

```

This Randomy Chooses and Rounds a Number, which will signal which enemy to attach.

```auto

//Which Enemy To Choose//
AEnemy = AEnemies[Math.round(random(8))];
BEnemy = BEnemies[Math.round(random(13))];
CEnemy = CEnemies[Math.round(random(15))];
DEnemy = DEnemies[Math.round(random(6))];
FEnemy = FEnemies[Math.round(random(5))];

```

This Is My Main Enemy he Will Be In The Center

```auto

/////Attcach For Main Enemy/////
this.attachMovie(AEnemy, "Main_Enemy", this.getNextHighestDepth);
Main_Enemy._x = 144.1-Main_Enemy.width/2;
Main_Enemy._y = 128.3-Main_Enemy.height/2;

```

This Is My Second Enemy On The Right

```auto

/////Attcach For Sub Enemy 1/////
this.attachMovie(AEnemy, "Sub_Enemy1", this.getNextHighestDepth);
Main_Enemy._x = 64.9-Sub_Enemy1.width/2;
Main_Enemy._y = 168.9-Sub_Enemy1.height/2;

```

This Is My Second Enemy On The Left

```auto

/////Attcach For Sub Enemy 2/////
this.attachMovie(AEnemy, "Sub_Enemy2", this.getNextHighestDepth);
Main_Enemy._x = 223.3-Sub_Enemy2.width/2;
Main_Enemy._y = 168.9-Sub_Enemy2.height/2;

```

All of this is on the first and only frame.  
[color=lime] **::Update::** [/color]  
[color=lime] **Oh yeah i forgot to tell you the problem,** [/color]  
[color=lime] **well all my enemeis are in a class "A,B,C,D,"or “F”** [/color]  
[color=lime] **well at the current moment im just testing the script with the “A” class** [/color]  
[color=lime] **and the code is supposed to choose one of the “A” class monsters randomly , assign it a instance name, and attach to the given coordinates, but for some reason it wont attach them, all my enemies are named exactly how they are shown:A underscore then their name;** [/color]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 25, 2004, 3:57am UTC](https://forum.kirupa.com/t/check-this-code-rpg-monsters/65335/2 "2004-09-25T03:57:03Z")

</div>

Sooooo, What’s wrong with the code?
