Helpful Information
 
 
Category: Game Development
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

Ok I'll try that.

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.










privacy (GDPR)