#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Location
    America
    Posts
    146
    Rep Power
    9

    Question Can this be done?


    Hi, can anyone tell me how to make your character (in Flash 8) not go through walls without messing with the _xscale? I've seen alot of tutorials for this but all of them make the character bounce. I don't want this because in my game the background is the one that moves (my character is always centered, it only rotates). So if anyone could tell me how it would be great.

    Thanks in advance
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2006
    Location
    America
    Posts
    146
    Rep Power
    9
    Ok I'll try that.
  4. #3
  5. "That Guy"
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2005
    Location
    Wouldn't you like to know? (To come beat me up maybee)
    Posts
    677
    Rep Power
    368
    Your doing something wrong with the code, you gotta precalculate, your process in the code your using is:

    1. Move
    2. Check if your touching wall
    -If True: Move Back
    -If False: Nothing

    It should be
    1. Check if you will be touching a wall when your current x and ys are added with the move's distance.
    -If True: Nothing
    -If False: Move

    So there is no backmoving when hitting the wall, you just see where you would be if the move was made, then if its alright, you move.

    Comments on this post

    • pumpkin head agrees : exactly

IMN logo majestic logo threadwatch logo seochat tools logo