im currently making a flash game here it is http://www.freewebs.com/bmjw619/wayofthewarrior.htm
all i have to do is now sort out the opponent i was thing of using random actions but im unsure how to do them.
Or would there be a better way of programming the opponent
Soo whats the question? If theres a better way to program AI without random actions. well AI is just that. So it how you do it that counts.
I would weight the random actions based on the actions of the player. If the player tends to throw more high punches, for example, make high blocks and low attacks slightly more likely to come up. Also make sure the computer doesn’t attack unless it’s close enough to the opponent.
Also, your game could use a more readable font and some directions as to what the controls are
between the frames put a
stop();
so they wont do the same move over and over
a few guidelines:
in an rpg with an enemy that has simple ai,it can even be made just with creating roots,random
and using the if(else) commands:
example:
as the main setup(just an easy fight,monster can heal you attack):
put this in the first frame:
monsterhp = 2750;
youhp = 2300;
monstermp = 150;
yourmp = 270;
dmgmagic1 = 300;
yourattackdmg = 70+random(101);
monsterattackdmg = 100+random(201)
youabletocastice = 0
Malmostdeadatcastmagic = 0
Malmostdeadatattack = 0
2nd KEY frame put this(btw,lower down,i will cover the actionscripting that you have to insert in the buttons in this frame):
Stop();
3rd keyframe(here comes the simple ai,that can be wrenched up to an incredible feat to kill the monster that has the ai,when you understand it):
stop();
if(_root.mp<50){
_root.youabletocastice=_root.youabletocastice+1;
_root.Malmostdeadatcastmagic=_root.Malmostdeadatcastmagic+1;
}
if(_root.monsterhp<300){
_root.Malmostdeadatcastmagic=_root.Malmostdeadatcastmagic+1;
}
if(_root.monsterhp<171){
_root.Malmostdeadatattack = _root.Malmostdeadatattack+1;
}
if(_root.Malmostdeadatcastmagic=>1){
GotoAndPlay(“monsterheal”);}else{
if(_root.Malmostdeadatattack>0){
GotoAndPlay(“monsterheal”);
}else{
GotoAndPlay(“monsterattack”);
}
}
and making a few buttons that direct you to attacking and using magic(with the frames to match those commands)
then the enemy would be clever enough to measure it chances if you would use the strongest attack(in this case ice,only if you have mp enough to do it)
and would heal just before it would possibly die for example,so it woulnd’t spend to much mp
ill explain more if you ask me
@up , nice :d
thnx u helped me too with this
now i can add + damage to my player when he lvls up
could u make a .fla from that?
sure mate,np,graphics will probably suck,cuase ill make it in a snap,ill post the link when it’s done