Advertisement
xerpi

Core.java

Oct 2nd, 2011
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.74 KB | None | 0 0
  1. package com.xerpi.core;
  2.  
  3. import android.graphics.Bitmap;
  4. import android.graphics.Canvas;
  5. import android.graphics.Paint;
  6.  
  7. public class Core {
  8.     public float angle;
  9.     public int score;
  10.     public float x,y,w,h;
  11.     public float life = 100;
  12.     public Bitmap image;
  13.    
  14.     public Core(float screenW,float screenH,Bitmap image){
  15.         this.image = image;
  16.         this.w = image.getWidth();
  17.         this.h = image.getHeight();        
  18.         this.x = screenW/2;
  19.         this.y = screenH/2;
  20.     }
  21.     public void setAngle(float angle){
  22.         this.angle = angle;
  23.     }
  24.     public void blit(Canvas canvas,Paint paint){
  25.         canvas.save();
  26.         canvas.rotate(this.angle,this.x,this.y);
  27.         canvas.drawBitmap(this.image, this.x-this.w/2,this.y-this.h,paint);
  28.         canvas.restore();
  29.         paint.reset();
  30.     }
  31.    
  32. }
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement