How to make a wall pass-through from only one side, and layered physics?

I got a wall, a barrier, for physics. Now I'd like to make it only pass-through from one side. Is this possible somewhat easily, or would that involve a lot of code?

Another thing that I'd like to do is having an object that collides with certain objects only when its on the ground, and not when its flying. Like a car in top down view, jumping over a wall via a ramp. When its not flying it should collide with the wall, when its in the air then not. How would I go to do that? Something with groups I assume?
I'm trying to come up with different things to practice but I think I am way over my head on some of these and they would be too difficult to do.

What do you think? Can somebody help me with doing this easily?

In the past I was working on a mario style platformer that allowed the character to jump up through platforms but not fall back through them. To accomplish this I compared the heights of the platforms to the height of the character. If the character was above a particular platform it would be erased and replaced by a solid one. If the character moved below the platform again the solid platform was erased and replaced with a jump through platform again. This can be kind of work intensive, but if you use a runtime listener to compare heights and a for loop to erase and create your platforms it's actually not that much code.

A basic solution would be to have a collision listener for your player; when the player is on the other side, make the wall as sensor. Code would be something like this.

1
2
3
4
5
6
7
8
9
local onPlayerCollide = function(event)
     if event.other.name == "wall" and event.phase=="began" then
           if player.x < wall.x then
                   wall.isSensor = true
           else
                   wall.isSensor = false
           end
     end
end
views:1606 update:2011/10/19 14:58:09
corona forums © 2003-2011