package com.example.tc.android_flappy_bird.GameObjects;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.view.MotionEvent;
import android.view.View;

import com.example.tc.android_flappy_bird.R;

public class GameView extends View {
    private final int GRAVITY = 2000;

    private Paint paint;
    private Bitmap birdBitMap;

    private Bird playerBird;

    private int screenHeight;
    private int screenWidth;

    private long lastFrame = -1;

    public GameView(Context context) {
        super(context);
        this.paint = new Paint();
        this.playerBird = new Bird();
        this.birdBitMap = BitmapFactory.decodeResource(getResources(),
                R.drawable.bird);
    }

    // called on initial startup
    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        screenHeight = h;
        screenWidth = w;
        resetGameState();
    }

    private void resetGameState() {
        lastFrame = -1;
        playerBird.resetState();
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        playerBird.drawSelf(canvas, birdBitMap, paint);
        updatePositions();
        invalidate();
    }

    private void updatePositions() {
        long currentTime = System.currentTimeMillis();
        if (lastFrame != -1) {
            float time = (currentTime - lastFrame) / 1000f; // divide by 1000 to convert to seconds
            playerBird.updatePosition(time, GRAVITY);
        }
        lastFrame = currentTime;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            playerBird.setYVelocity(-800);
        }
        return true;
    }
}

@@ -484,16 +484,53 @@
 dBitMap;
+%0A    private Bitmap backGroundBitMap;
 %0A%0A    pr
@@ -887,16 +887,133 @@
 .bird);%0A
+        this.backGroundBitMap = BitmapFactory.decodeResource(getResources(),%0A                R.drawable.background);%0A
     %7D%0A%0A 
@@ -1445,16 +1445,48 @@
 anvas);%0A
+        drawBackground(canvas);%0A
         
@@ -1556,24 +1556,24 @@
 ositions();%0A
-
         inva
@@ -1581,32 +1581,237 @@
 idate();%0A    %7D%0A%0A
+    private void drawBackground(Canvas canvas) %7B%0A        RectF backgroundRect = new RectF(0, 0, screenWidth, screenHeight);%0A        canvas.drawBitmap(backGroundBitMap, null, backgroundRect, paint);%0A    %7D%0A%0A
     private void

Add draw background resource