/** uses current status to determine next iteration */ public void tick() { if (!hasEvent()) { return; } if (System.currentTimeMillis() - startTime > duration) { removeEvent(); game.removeTimedEvents(); if (eventName.equals("sayakaCutIn")) { translate = 1; imageTranslate = 1; startEvent(1200, "sayakaCutIn2"); } else if (eventName.equals("sayakaCutIn2")) { translate = 1; imageTranslate = 1; effect.startFadeWhite(); startEvent(3000, "sayakaCutIn3"); } return; } effect.tick(); if (eventName.equals("timeStop")) { game.timeStop(); } else if (eventName.equals("timeStopCutIn")) { game.stopTick(); translateImage(background); translate = translate * 1.23; if (translate >= 100) { translate = 100; } // game.pauseMusic(); } else if (eventName.equals("madokaCutIn")) { game.stopTick(); translateImage(background); translate = translate * 1.23; if (translate >= 100) { translate = 100; } } else if (eventName.equals("sayakaCutIn")) { game.stopTick(); translateImage(background); translate = translate * 1.23; if (translate >= 100) { translate = 100; } } else if (eventName.equals("sayakaCutIn2")) { game.stopTick(); translateImage(background); translate = translate * 1.23; if (translate >= 100) { translate = 100; } } }
/** * Renders graphics such as backgrounds, colour, image locations, image size, etc. * * @panam graphic object * @return render game */ public void render(Graphics g) { if (System.currentTimeMillis() - startTime > duration) { translate = 1; imageTranslate = 1; return; } // renders timeStop cutIn picture effect.render(g); if (eventName.equals("timeStopCutIn")) { // g.drawImage(homuraCutInBg,5,5,GameSystem.ABSWIDTH,GameSystem.ABSHEIGHT,null); // g.setColor(Color.WHITE); // g.fillRect(0, 0, 700, 700); // g.drawImage(homuraCutIn,(int) (100-translate),0,null); g.drawImage( cutInLarge, (int) (-1 * GameSystem.ABSWIDTH / 2 + translate), -1 * GameSystem.ABSHEIGHT / 3, null); g.drawImage(background, (int) (-1 * imageTranslate - 20), 0, null); g.setColor(Color.BLACK); g.setFont(new Font("arial", Font.ITALIC, 32)); g.drawImage(homuraCutIn, (int) (GameSystem.ABSWIDTH / 3 - translate), 0, null); g.drawString("TIME STOP", 50, 400); } else if (eventName.equals("madokaCutIn")) { g.drawImage( madokaCutInLarge, (int) (-1 * GameSystem.ABSWIDTH / 2 + translate + 100), -1 * GameSystem.ABSHEIGHT / 3, null); g.drawImage(pinkStripes, (int) (-1 * imageTranslate - 20), 0, null); g.setColor(Color.BLACK); g.setFont(new Font("arial", Font.ITALIC, 32)); g.drawImage(madokaCutIn, (int) (GameSystem.ABSWIDTH / 3 - translate + 100), 0, null); g.drawString("", 50, 400); } else if (eventName.equals("sayakaCutIn")) { // Graphics2D g2D = (Graphics2D)g; // g.drawImage(blueBlob,rand.nextInt(GameSystem.ABSWIDTH)-blueBlob.getWidth()/2,rand.nextInt(GameSystem.ABSHEIGHT)-blueBlob.getWidth()/2,null); // g.drawImage(background, (int) (-1*imageTranslate-20),0,null); g.drawImage(blueBgTrans, 0, 0, null); createStripes(g); g.drawImage( saCutIn1, (int) (GameSystem.ABSWIDTH / 4 - translate + 100), (int) (-1 * translate / 3), null); // createStripes(g); // createStripes(g); // g.drawImage(blueBlob,rand.nextInt(GameSystem.ABSWIDTH),rand.nextInt(GameSystem.ABSHEIGHT),null); // g.drawImage(blueBlob,rand.nextInt(GameSystem.ABSWIDTH),rand.nextInt(GameSystem.ABSHEIGHT),null); } else if (eventName.equals("sayakaCutIn2")) { g.drawImage(blueBgTrans, 0, 0, null); createStripes(g); g.drawImage(saCutIn2, (int) (-100 + translate), (int) (120 + translate / 3), null); } }