View Single Post
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 09-11-2010, 11:49 AM

patsito, what you want is called "collision detection", and its harder to put into a game than you might think. If you want you can look at my "maze" game in my signature and there will be a method called "collisionDetection", which will show how I made the collisions work. You basically make tons of walls wherever you want to collide with, and then have an infinite loop making sure that if the character touches any of those walls, the wall pushes them back.


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote