Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.xerpi.core;
- import android.graphics.Bitmap;
- import android.graphics.Canvas;
- import android.graphics.Paint;
- public class Core {
- public float angle;
- public int score;
- public float x,y,w,h;
- public float life = 100;
- public Bitmap image;
- public Core(float screenW,float screenH,Bitmap image){
- this.image = image;
- this.w = image.getWidth();
- this.h = image.getHeight();
- this.x = screenW/2;
- this.y = screenH/2;
- }
- public void setAngle(float angle){
- this.angle = angle;
- }
- public void blit(Canvas canvas,Paint paint){
- canvas.save();
- canvas.rotate(this.angle,this.x,this.y);
- canvas.drawBitmap(this.image, this.x-this.w/2,this.y-this.h,paint);
- canvas.restore();
- paint.reset();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement