I would like to make the screen shake whenever the player receives damage or there is an explosion. By shake I mean a tremor-like effect(the whole image shakes a little bit.) How could I achieve something like this?
The code that you would use to make the screen shake is basically the same as what you would use to make the world a scrolling world. The only differences are (1) the scrolling is limited to very short distances (vertically and/or horizontally); (2) what condition(s) are used for scrolling; and (3) the behavior of the scrolling. The third difference is really a result of the second one.
Shaking the world is now included in my Scrolling Tutorial scenario and is demonstrated in my Scroller Class Demos scenario.