PiCkDaT
Joined: 04 Oct 2007 Posts: 69
|
Posted: Tue May 20, 2008 3:19 am Post subject: |
|
|
Make an array of a map like this
map = {
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,2,2,2,2,2,2,2,2,2,3,2,2,2,2,2,2,2,1,
1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
}
just as an example make 1 = water and 2 = grass(walkable) and 3 = house... what you do is keep track of where the character is on the map and depending on that and what space the character will move to next you can say...
tileUp is a function that looks for the tile above the character
if tileUp = water or tileUp = house then canWalkUp = false end
hope this gives you an idea. _________________ Enlighten me, Reveal my fate -- Follow - Breaking Benjamin |
|