A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: AI for tile based game

  1. #1
    Life is too Exaggerated rhyeen's Avatar
    Join Date
    May 2005
    Location
    My own little world
    Posts
    257

    AI for tile based game

    hello, ok i'm going to try and word this so it makes sense. I am creating a flash game called Shadow, and i was wondering what actionscript i would need to make an AI which moves 18 steps, at 90° turns (left, right, up, down), about, say, every second, and if he runs into the main character, instance name, hero, then it jumps to the second frame saying, 'game over' or such.

    Yeah, but there might be a problem, when the character moves so does the screen, (giving the hole running in place thing) so he only moves 9 steps and the background moves 9 steps in the opposite direction, this might mess up the AI creature, not only that, but there is walls in this game, and the AI needs to stop after he hits the wall so the hole moving background might mess it up, if so then i will just make the man move, so hope you can help me with the AI.

  2. #2
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    For simple enemy:
    http://www.tonypa.pri.ee/tbw/tut09.html

    The fact that background is scrolling doesnt change anything:
    http://www.tonypa.pri.ee/tbw/tut13.html

  3. #3
    Life is too Exaggerated rhyeen's Avatar
    Join Date
    May 2005
    Location
    My own little world
    Posts
    257

    thanks

    thanks for the help, but i will need more time to read it all, do you think you can just give me the actionscript for one? if not i'll just check it out when i have a free night

  4. #4
    Razor
    Join Date
    Aug 2002
    Location
    Canada
    Posts
    721
    The code we supply you might not work with the way you have you current tile engine set-up so we would need to see that or just try and give you an example to work off of.

  5. #5
    hmm Pugger's Avatar
    Join Date
    Sep 2003
    Location
    Perth, Australia
    Posts
    616
    Sorry, but I think you will have to read - the tutorials are very good - and you should be able to adapt them to your needs once you get your head around the concepts within.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center