public LiveWallpaperPainting(SurfaceHolder surfaceHolder, Context context) {
    // keep a reference of the context and the surface
    // the context is needed if you want to inflate
    // some resources from your livewallpaper .apk
    this.surfaceHolder = surfaceHolder;
    this.context = context;
    // don't animate until surface is created and displayed
    this.wait = true;
    mario = new Mario(64, 578, context);
    // spriteList = new AnimatedSprite[16];
    // numSprites = 0;

    sprCoin = new AnimatedSprite();
    sprPipe = new AnimatedSprite();
    sprBlock = new AnimatedSprite();
    pipePlant = new AnimatedSprite();
    bkg = new AnimatedSprite();

    sprCoin.setID(1);
    sprBlock.setID(2);

    sprPipe.Initialize(
        BitmapFactory.decodeResource(context.getResources(), R.drawable.pipe),
        72,
        48,
        1,
        false,
        -1.0f,
        AnimatedSprite.objects.Pipe);
    sprCoin.Initialize(
        BitmapFactory.decodeResource(context.getResources(), R.drawable.coin),
        24,
        20,
        4,
        true,
        10.0f,
        AnimatedSprite.objects.Coin);
    sprBlock.Initialize(
        BitmapFactory.decodeResource(context.getResources(), R.drawable.animblock),
        24,
        24,
        4,
        true,
        10.0f,
        AnimatedSprite.objects.CoinBlock);
    pipePlant.Initialize(
        BitmapFactory.decodeResource(context.getResources(), R.drawable.pipeplant),
        48,
        40,
        4,
        true,
        10.0f,
        AnimatedSprite.objects.Plant);
    bkg.Initialize(
        BitmapFactory.decodeResource(context.getResources(), R.drawable.wallpaper_bkg),
        1515,
        642,
        1,
        false,
        -1.0f,
        AnimatedSprite.objects.Bkg);

    sprPipe.setSolid(true);
    sprBlock.setSolid(true);

    // mario.addCollisionObj(sprPipe);
    mario.addCollisionObj(sprCoin);
    mario.addCollisionObj(sprBlock);
    mario.addCollisionObj(sprPipe);

    mSensor = new SensorActivity(context);
  }