Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

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