public void hit(JGObject o) { playAudio("explo"); for (int i = 0; i < (isMidlet() ? 5 : 8); i++) new JGObject( "explo", true, x, y, 0, "explo", random(-2, 2), random(-2, 2), (int) random(8, 32)); o.remove(); remove(); score += 5; }
public void move() { if (to_follow != null) { // follow the player if (!to_follow.isAlive()) remove(); shiftPos(to_follow.x, to_follow.y); // JGPoint newpos = shiftPos(to_follow.getLastX(), // to_follow.getLastY() ); // x = newpos.x; // y = newpos.y; } }
public void hit(JGObject obj) { if (and(obj.colid, gp_playerdieobjtype) && invulnerability == 0) lifeLost(); if (and(obj.colid, gp_playergetobjtype)) { obj.remove(); score += gp_playergetscore; new StdScoring( "pts", obj.x, obj.y, 0, -1.0, 40, (int) gp_playergetscore + " pts", scoring_font, new JGColor[] {JGColor.red, JGColor.yellow}, 2); } }
public void hit(JGObject obj) { if (and(obj.colid, dieobjtype)) { die(); if ((obj.colid & BULLETTYPE) != 0) obj.remove(); } }