Results 1 to 7 of 7

Thread: rpg ai hit-tests

  1. #1

    rpg ai hit-tests

    hiyar
    i have been working on a pretty big rpg and have realised my ai is flawed, when it comes into contact with the object, called map, there the walls, i want it to bounce off the walls instead of walking throught them, so i divided it up into quarters and so when it hittests that quarter is bounces it away the correct way, but it aint working for me, can anyone have a look at it for me
    thank you in advance
    Attached Files Attached Files

  2. #2
    can anybody help me ?

  3. #3
    Quote Originally Posted by mordormaster View Post
    hiyar
    i have been working on a pretty big rpg and have realised my ai is flawed, when it comes into contact with the object, called map, there the walls, i want it to bounce off the walls instead of walking throught them, so i divided it up into quarters and so when it hittests that quarter is bounces it away the correct way, but it aint working for me, can anyone have a look at it for me
    thank you in advance

    You should really just go tile based and get a better grasp of what you're doing.
    you = function(){
    setEnabled( true );
    live();
    setEnabled( false );
    }

  4. #4
    i have treid that but i found art based easier

  5. I think you maybe want to consider an easier project if you can't answer these kind of questions.

    Anyways:

    if (_root.mc.hitTest(_root.map.wall1))
    {
    * check what key is pressed and move it the other direction.
    }


    Is this something you are looking for?

  6. #6
    it isnt for my main character
    its for my enemy ai, i need it when the ai comes into contact with the walls it bounces off, because so far they walk straight through it

  7. #7
    onClipEvent(load){
    speed = 5
    }
    onClipEvent(enterFrame){
    this._x = speed
    if(_root.map.hitTest(_x, _y, true)){speed = speed*-1}
    }


    Thats what I would do, have fun man

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012