Back to project page MakeitRain.
The source code is released under:
GNU General Public License
If you think the Android project MakeitRain listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.finlay.makeitrain; /*from w ww .ja va 2 s . co m*/ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.graphics.Rect; public class DollaBill { Rect bounds; Bitmap image; private boolean alive; public DollaBill(Rect bounds, Bitmap img) { this.bounds = new Rect(bounds); this.image = img; alive = true; } public void translateY(int dy) { bounds.bottom += dy; bounds.top += dy; } public void draw(Canvas c, Paint p) { c.drawBitmap(image, null, bounds, p); } public void update() { this.translateY(-10); if (0 > bounds.bottom) this.kill(); } public void kill() { alive = false; } public boolean AliveEh() { return alive; } }