Dark Age Games
Home Dark Age EX Dark Age 2 Message Board Fan Art FAQ Kelzar Mage DALpedia MS Forum
Board Index Dark Age General Bug Report Website Off Topic Register User Edit User User List Search

I know you smart but this is difficult..
Posted by: William
20:13:49 12-02-2004

I know you will think this programming technicue is strange because I'm going around the most important things. But I have a turnbased bs where you walk, but I want two or more enemies and right now I have one, this is the enemy part code:


#Method xplusone()
{
#enexx[slot!]!=enex[slot!]!
#enexx[slot!]!=enexx[slot!]!+33
}

#Method xminusone()
{
#enexx[slot!]!=enex[slot!]!
#enexx[slot!]!=enexx[slot!]!-33
}

#Method yplusone()
{
#eneyy[slot!]!=eney[slot!]!
#eneyy[slot!]!=eneyy[slot!]!+33
}

#Method yminusone()
{
#eneyy[slot!]!=eney[slot!]!
#eneyy[slot!]!=eneyy[slot!]!-33
}

#Method EnemyTurn()
{

#Random(4,Random!)
#If(Random!=1){#Branch(:top)}

#check()
#Method check()
{
#xplusone()
#If(enexx[slot!]!=x!){#If(eney[slot!]!=y!){#EnemyAttack()}}
#xminusone()
#If(enexx[slot!]!=x!){#If(eney[slot!]!=y!){#EnemyAttack()}}
#yplusone()
#If(eneyy[slot!]!=y!){#If(enex[slot!]!=x!){#EnemyAttack()}}
#yminusone()
#If(eneyy[slot!]!=y!){#If(enex[slot!]!=x!){#EnemyAttack()}}
#Branch(:Move)
}


#Method EnemyEqualStoneLocation()
{
#If(enedir[slot!]$="UP"){#If(enex[slot!]!=stonex1!){#If(eney[slot!]!=stoney1!){#eney[slot!]!=eney[slot!]!+33}}}
#If(enedir[slot!]$="DOWN"){#If(enex[slot!]!=stonex1!){#If(eney[slot!]!=stoney1!){#eney[slot!]!=eney[slot!]!-33}}}
#If(enedir[slot!]$="LEFT"){#If(enex[slot!]!=stonex1!){#If(eney[slot!]!=stoney1!){#enex[slot!]!=enex[slot!]!+33}}}
#If(enedir[slot!]$="RIGHT"){#If(enex[slot!]!=stonex1!){#If(eney[slot!]!=stoney1!){#enex[slot!]!=enex[slot!]!-33}}}

#If(enedir[slot!]$="UP"){#If(enex[slot!]!=stonex2!){#If(eney[slot!]!=stoney2!){#eney[slot!]!=eney[slot!]!+33}}}
#If(enedir[slot!]$="DOWN"){#If(enex[slot!]!=stonex2!){#If(eney[slot!]!=stoney2!){#eney[slot!]!=eney[slot!]!-33}}}
#If(enedir[slot!]$="LEFT"){#If(enex[slot!]!=stonex2!){#If(eney[slot!]!=stoney2!){#enex[slot!]!=enex[slot!]!+33}}}
#If(enedir[slot!]$="RIGHT"){#If(enex[slot!]!=stonex2!){#If(eney[slot!]!=stoney2!){#enex[slot!]!=enex[slot!]!-33}}}
}


#Method EnemyEqualCharacterLocation()
{

#If(enedir[slot!]$="LEFT"){#If(enex[slot!]!=x!){#If(eney[slot!]!=y!){#enex[slot!]!=enex[slot!]!+33#If(enex[slot!]!<175)
{#enex[slot!]!=210}}}}
#If(enedir[slot!]$="RIGHT"){#If(enex[slot!]!=x!){#If(eney[slot!]!=y!){#enex[slot!]!=enex[slot!]!-33#If(enex[slot!]!>610)
{#enex[slot!]!=606}}}}
#If(enedir[slot!]$="UP"){#If(enex[slot!]!=x!){#If(eney[slot!]!=y!){#eney[slot!]!=eney[slot!]!+33#If(eney[slot!]!<60)
{#eney[slot!]!=67}}}}
#If(enedir[slot!]$="DOWN"){#If(enex[slot!]!=x!){#If(eney[slot!]!=y!){#eney[slot!]!=eney[slot!]!-33#If(eney[slot!]!>300)
{#eney[slot!]!=298}}}}
#SetImageTransparent(enetst[slot!]$,enex[slot!]!,eney[slot!]!,32,32,255,255,255)
#Branch(:top)
}

:Move

#If(eney[slot!]!>y!)
{
#eney[slot!]!=eney[slot!]!-33
#enedir[slot!]$="UP"
#EnemyEqualStoneLocation()
#EnemyEqualCharacterLocation()
}

#If(enex[slot!]!>x!)
{
#enex[slot!]!=enex[slot!]!-33
#enedir[slot!]$="LEFT"
#EnemyEqualStoneLocation()
#EnemyEqualCharacterLocation()
}

#If(eney[slot!]!<y!)
{
#eney[slot!]!=eney[slot!]!+33
#enedir[slot!]$="DOWN"
#EnemyEqualStoneLocation()
#EnemyEqualCharacterLocation()
}

#If(enex[slot!]!<x!)
{
#enex[slot!]!=enex[slot!]!+33
#enedir[slot!]$="RIGHT"
#EnemyEqualStoneLocation()
#EnemyEqualCharacterLocation()
}
}*Method EnemyTurn End*










#Method EnemyAttack()
{
*#GetStats()
#enefp!=eneFP[slot!]!
#eneFP!=eneFP!-dp!
#If(enefp!<2){#eneFP!=2}
#HP!=HP!-enefp!
#CheckCharDead()
}*Method EnemyAttack End*



Do you think you can give me some ideas how to create it so I can have more enemies?

It's okay if you don't because I know it's not easy to understand this code. Thanks anyway.

_______________
Fan of DA. Keep it going.

Working on other things now. Trying to get my life to pieces.
That was a long time ago I wrote this:
Project: Marovia
Finished: 32%
Edit Post