CALayer obstacles?
I am putting together a 2d RPG in Cocoa just for learning and for fun.

I've got the sprite moving around and animating just fine... but not sure how to approach making obstacles. Take for example Mt. Zozo here. I don't want Setzer falling off a cliff, or climbing up on those dangerous looking rocks!

![Sprites][1]


  [1]: http://i.stack.imgur.com/JiWqc.png

I was thinking that I might have to draw in some layers where I don't want him to move and put some code in my move keydown methods that test that the resulting position doesn't contain a point that is also contained by an 'obstacle' layer. But that seems really not generic and a lot of work. 

Any thoughts?

Thanks!
CALayer obstacles?
===

I am putting together a 2d RPG in Cocoa just for learning and for fun.

I've got the sprite moving around and animating just fine... but not sure how to approach making obstacles. Take for example Mt. Zozo here. I don't want Setzer falling off a cliff, or climbing up on those dangerous looking rocks!

![Sprites][1]


  [1]: http://i.stack.imgur.com/JiWqc.png

I was thinking that I might have to draw in some layers where I don't want him to move and put some code in my move keydown methods that test that the resulting position doesn't contain a point that is also contained by an 'obstacle' layer. But that seems really not generic and a lot of work. 

Any thoughts?

Thanks!