|
-
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.
-
Axis Games
It depends on how you have your world built. Is it tile-based?
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|