Back to project page Hungry-Mouse.
The source code is released under:
MIT License
If you think the Android project Hungry-Mouse listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
//Name: Kamikazi.java //Purpose: the bomb enemy with the coordinates /*from w ww . j a va2s . c o m*/ package com.hungry.mouse.main; //android libraries stored in SDK platform import android.graphics.Rect;//hold 4 integer coordinates for rectangle public class Bomb extends Enemy { //constructor public Bomb(int centerX, int centerY) { setCenterX(centerX);//x axis coordinates setCenterY(centerY);//y axis coordinates } @Override public void update() { centerX += speedX; speedX = bg.getSpeedX() * 5 + movementSpeed; r.set(centerX - 25, centerY - 25, centerX + 25, centerY + 35); if (Rect.intersects(r, Mouse.yellowRed)) { checkCollision(); } } public void subtractHealth(int health){ this.health-=health; } }