Limiting rotation in Game Engine

I have an object rotating on X and Y axis when the arrow keys are pressed. Is there any way to prevent the object rotating past a certain point e.g. 45 degrees?

The game is basically a platform with a hole in it and a ball falls onto the platform and you tilt the platform to get the ball to roll into the hole. I don’t want the platform to be able to rotate around completely - I want to be able to place a limit or constraint on it.

Maximized

There are many ways to go about it, the attached example is merely one.

Attachments

limit_rot.blend (129 KB)