Android Open Source - Sushi-Shooter Game Screen






From Project

Back to project page Sushi-Shooter.

License

The source code is released under:

GNU General Public License

If you think the Android project Sushi-Shooter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 *                 [[ Frozen-Bubble ]]//from ww w  .  j  a  va 2 s.c om
 *
 * Copyright (c) 2000-2003 Guillaume Cottenceau.
 * Java sourcecode - Copyright (c) 2003 Glenn Sanson.
 *
 * This code is distributed under the GNU General Public License
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *
 * Artwork:
 *    Alexis Younes <73lab at free.fr>
 *      (everything but the bubbles)
 *    Amaury Amblard-Ladurantie <amaury at linuxfr.org>
 *      (the bubbles)
 *
 * Soundtrack:
 *    Matthias Le Bidan <matthias.le_bidan at caramail.com>
 *      (the three musics and all the sound effects)
 *
 * Design & Programming:
 *    Guillaume Cottenceau <guillaume.cottenceau at free.fr>
 *      (design and manage the project, whole Perl sourcecode)
 *
 * Java version:
 *    Glenn Sanson <glenn.sanson at free.fr>
 *      (whole Java sourcecode, including JIGA classes
 *             http://glenn.sanson.free.fr/jiga/)
 *
 * Android port:
 *    Pawel Aleksander Fedorynski <pfedor@fuw.edu.pl>
 *    Copyright (c) Google Inc.
 *
 *          [[ http://glenn.sanson.free.fr/fb/ ]]
 *          [[ http://www.frozen-bubble.org/   ]]
 */

package net.gamecloud.sushishooter;

import java.util.Vector;
import android.graphics.Canvas;
import android.os.Bundle;

public abstract class GameScreen
{
  private Vector sprites;

  public final void saveSprites(Bundle map, Vector savedSprites)
  {
    for (int i = 0; i < sprites.size(); i++) {
      ((Sprite)sprites.elementAt(i)).saveState(map, savedSprites);
      map.putInt(String.format("game-%d", i),
                 ((Sprite)sprites.elementAt(i)).getSavedId());
    }
    map.putInt("numGameSprites", sprites.size());
  }

  public final void restoreSprites(Bundle map, Vector savedSprites)
  {
    sprites = new Vector();
    int numSprites = map.getInt("numGameSprites");
    for (int i = 0; i < numSprites; i++) {
      int spriteIdx = map.getInt(String.format("game-%d", i));
      sprites.addElement(savedSprites.elementAt(spriteIdx));
    }
  }

  public GameScreen()
  {
    sprites = new Vector();
  }

  public final void addSprite(Sprite sprite)
  {
    sprites.removeElement(sprite);
    sprites.addElement(sprite);
  }

  public final void removeSprite(Sprite sprite)
  {
    sprites.removeElement(sprite);
  }

  public final void spriteToBack(Sprite sprite)
  {
    sprites.removeElement(sprite);
    sprites.insertElementAt(sprite,0);
  }

  public final void spriteToFront(Sprite sprite)
  {
    sprites.removeElement(sprite);
    sprites.addElement(sprite);
  }

  public void paint(Canvas c, double scale, int dx, int dy) {
    for (int i = 0; i < sprites.size(); i++) {
      ((Sprite)sprites.elementAt(i)).paint(c, scale, dx, dy);
    }
  }

  public abstract boolean play(boolean key_left, boolean key_right,
                               boolean key_fire, double trackball_dx,
                               boolean touch_fire,
                               double touch_x, double touch_y,
                               boolean ats_touch_fire, double ats_touch_dx);
}




Java Source Code List

com.sessionm.TransactionReceiver.java
net.gamecloud.sushishooter.BmpWrap.java
net.gamecloud.sushishooter.BubbleFont.java
net.gamecloud.sushishooter.BubbleManager.java
net.gamecloud.sushishooter.BubbleSprite.java
net.gamecloud.sushishooter.Compressor.java
net.gamecloud.sushishooter.FrozenBubble.java
net.gamecloud.sushishooter.FrozenGame.java
net.gamecloud.sushishooter.GameScreen.java
net.gamecloud.sushishooter.GameView.java
net.gamecloud.sushishooter.ImageSprite.java
net.gamecloud.sushishooter.LaunchBubbleSprite.java
net.gamecloud.sushishooter.LevelManager.java
net.gamecloud.sushishooter.PenguinSprite.java
net.gamecloud.sushishooter.SoundManager.java
net.gamecloud.sushishooter.Sprite.java