A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Collision and stop

  1. #1
    Junior Member
    Join Date
    Feb 2007
    Posts
    23

    Collision and stop

    i tried various tutorials but i still cant figure out how to make a player stop when hitting a object in the way. it could be a maze or just a simple play area with walls.

    if anyone has the knowledge and time it would really help with a detailed explanation on the subject.

  2. #2
    Axis Games Djugan's Avatar
    Join Date
    Oct 2003
    Posts
    238
    It depends on how you have your world built. Is it tile-based?

  3. #3
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    you could setup for the keyboard control only direction variables and on the forward or thrust button a speed variable. If you collide overwrite the speed variable to 0 so that if you multiply the direction variable with the speed variable you reach 0 distance in shifting.
    e.g
    dirx = -1;
    myMc._x += dirx *speed;
    Of course like Djugan already said, depending on how your game works (concept wise) it can be implemented in many different ways.

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