The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.36 / 5.00 33,851 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 12,195 ViewsSo now that i've gotten progress on the game(if you haven't seen it, go to my page for more info), i've stumbled onto a problem that i cannot get past. ENEMY AI!!!!
at first i got through the tutorials and tried coding on my own. i did not do so good. then i tried searching on the forums,and all i could find that made sense was 4 direction enemy ai. i need like a side scroller enemy ai descripion.
if anyone could explain to me how a side scroller enemy works, or guide me to a good enemy ai tutorial, it would be much appreciated.
At 1/31/10 03:38 PM, K-A-H wrote: So now that i've gotten progress on the game(if you haven't seen it, go to my page for more info), i've stumbled onto a problem that i cannot get past. ENEMY AI!!!!
at first i got through the tutorials and tried coding on my own. i did not do so good. then i tried searching on the forums,and all i could find that made sense was 4 direction enemy ai. i need like a side scroller enemy ai descripion.
if anyone could explain to me how a side scroller enemy works, or guide me to a good enemy ai tutorial, it would be much appreciated.
It seems to me that the enemy in a sidescroller should always be moving towards the other side of the screen and either fire every so often or when ever it sees the player.
and if possible should randomly go up or down.
Be water my friend.
FlashGameMakers.ning.com
Real Flash Programmers + Real Flash Artists = Awesome Flash games
Programming is an extension of basic logic..
If you can't understand how and why enemy AI works then you have no business coding it.
Some simple AI code would be along the lines of checking variables of the player ex(x and y) and having the enemy respond accordingly.
:'(
Also for a side scroller you would want to take a look at an attachMovie() tutorial for the enemy spawning.
:'(
so if anything, i start with enemy spawning. alright, i'll go try that 1st.
now that i've went through attachMovie(); i've created a code that for some odd reason only works without the onClipEvent handler and the hitTest property.
onClipEvent(load){
if(this.hitTest(_root.hero)){
for(i=1;i<99;i++){
_root.attachMovie("Enemy1","NewEnemy1"+i , 1000+i);
_root["NewEnemy1"+i]._x=random(550);
_root["NewEnemy1"+i]._y=random(400);
}
}
}
can someone explain why this code does not work?