Add original project.

This commit is contained in:
2025-01-04 12:48:09 -07:00
parent 2ea0f8441d
commit 6e7114a24d
92 changed files with 3462 additions and 0 deletions
@@ -0,0 +1,34 @@
package com.hyperling.apps.games;
import android.graphics.Bitmap;
import android.graphics.Canvas;
/**
* Created by ling on 12/23/16.
*/
public abstract class EnvironmentObject extends GameObject {
protected Bitmap image;
public EnvironmentObject(Bitmap i, int w, int h, int x, int y){
image = i;
width = w;
height = h;
this.x = x;
this.y = y;
}
public void update(int gameSpeed){
// Move the object
x += gameSpeed;
setEndX(getX() + getWidth());
setCenterX((getX() + getEndX()) / 2);
}
public void draw(Canvas canvas) {
// Draw the object
canvas.drawBitmap(image, x, y, null);
}
}