hien tai minh làm game android bang bộ khung này..trong đó co class vonglap.java..nhung minh khong hieu nó hoat dong thế nào..có ai biết giúp minh với..cam on nhiu lam

package vidu.vidu;
import java.util.timer;
import java.util.timertask;
import android.content.context;
import android.graphics.bitmap;
import android.graphics.bitmapfactory;
import android.util.attributeset;
import android.widget.linearlayout;
/**
* base class for all games. extends {@link linearlayout} and uses a
* {@link timertask} to invalidate the view
*
* @author v. silva
*
*/
publicabstractclass vonglap extends linearlayout {
// app context
private context mcontex;
// update timer used to invalidate the view
private timer mupdatetimer;
// timer period
privatelongmperiod = 1000;
/**
* c
*
* @param context
*/
public vonglap(context context) {
super(context);
mcontex = context;
}
public vonglap(context context, attributeset attrs) {
super(context, attrs);
mcontex = context;
}
/**
* fires on layout
*/
@override
protectedvoid onlayout(boolean changed, int l, int t, int r, int b) {
super.onlayout(changed, l, t, r, b);
try {
// init game
initialize();
/**
* start update task. which will fire ondraw in the future
*/
startupdatetimer();
} catch (exception e) {
// bug
e.printstacktrace();
}
}
/**
* set the update period
*
* @param period
*/
publicvoid setupdateperiod(long period) {
mperiod = period;
}
/**
* a timer is used to move the sprite around
*/
protectedvoid startupdatetimer() {
mupdatetimer = new timer();
mupdatetimer.schedule(new updatetask(), 0, mperiod);
}
protectedvoid stopupdatetimer() {
if (mupdatetimer != null) {
mupdatetimer.cancel();
}
}
public context getcontex() {
returnmcontex;
}
/**
* load an image
*
* @param id
* @return
*/
protected bitmap getimage(int id) {
return bitmapfactory.decoderesource(mcontex.getresources( ), id);
}
/**
* overload this to update the sprites on the game
*/
abstractprotectedvoid updatephysics();
/**
* overload to initialize the game
*/
abstractprotectedvoid initialize();
abstractprotectedboolean gameover();
abstractprotectedlong getscore();
/**
* canvas update task
*
* @author vsilva
*
*/
privateclass updatetask extends timertask {
@override
publicvoid run() {
updatephysics();
/**
* cause an invalidate to happen on a subsequent cycle through the
* event loop. use this to invalidate the view from a non-ui thread.
* ondraw will be called sometime in the future.
*/
postinvalidate();
}
}
/**
* halt game. stops the update task. called by a parent activity to halt
*
*/
publicvoid halt() {
stopupdatetimer();
}
/**
* resume game
*/
publicvoid resume() {
initialize();
startupdatetimer();
}
}