Android Open Source - Hungry-Mouse Loading Screen






From Project

Back to project page Hungry-Mouse.

License

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.

Java Source Code

//Name:   LoadingScreen.java
//Purpose:  loads the assets during presentation of splashscreen
//  w w w .ja  va 2 s.  c  om
package com.hungry.mouse.main;

import com.hungry.mouse.main.Settings;
import com.hungry.mouse.framework.Game;
import com.hungry.mouse.framework.Graphics;
import com.hungry.mouse.framework.Screen;
import com.hungry.mouse.framework.Graphics.ImageFormat;

public class LoadingScreen extends Screen {
  
  //constructor
  public LoadingScreen(Game game) {
    
    super(game);
  }

  //load the assets and the saved settings
  @Override
  public void update(float deltaTime) {
    Graphics g = game.getGraphics();
    
    //rectangle buttons
    Assets.menu_buttons = g.newImage("menu_buttons.png", ImageFormat.RGB565);    

    //small buttons
    Assets.pause_button = g.newImage("pause_button.png", ImageFormat.RGB565);
    
    Assets.cheese_reward = g.newImage("cheese_reward.png", ImageFormat.RGB565);
    Assets.bomb = g.newImage("bomb.png", ImageFormat.RGB565);    
    Assets.bomb2 = g.newImage("bomb2.png", ImageFormat.RGB565);  
    Assets.sign = g.newImage("sign.png", ImageFormat.RGB565);  
    
    
    Assets.play_buttons = g.newImage("play_buttons.png", ImageFormat.RGB565);    
    Assets.sound_on_buttons = g.newImage("sound_on_buttons.png", ImageFormat.RGB565);
    Assets.music_on_buttons = g.newImage("music_on_buttons.png", ImageFormat.RGB565);  
          
    Assets.info_buttons = g.newImage("info_buttons.png", ImageFormat.RGB565);  
    Assets.gyroscope_buttons = g.newImage("gyroscope_buttons.png", ImageFormat.RGB565);  
    Assets.level_buttons = g.newImage("level_buttons.png", ImageFormat.RGB565);  
    Assets.level1_button = g.newImage("level1_button.png", ImageFormat.RGB565);  
    Assets.level2_button = g.newImage("level2_button.png", ImageFormat.RGB565);  
    Assets.level3_button = g.newImage("level3_button.png", ImageFormat.RGB565);  
    Assets.arrow_buttons = g.newImage("arrow_buttons.png", ImageFormat.RGB565);    
    
    Assets.logo = g.newImage("logo.png", ImageFormat.RGB565);
    Assets.help = g.newImage("help-buttons.png", ImageFormat.RGB565);
    Assets.control_buttons = g.newImage("control_buttons.png", ImageFormat.RGB565);    
    
    Assets.help1 = g.newImage("help1.png", ImageFormat.RGB565);
    Assets.help2 = g.newImage("help2.png", ImageFormat.RGB565);
    Assets.help3 = g.newImage("help3.png", ImageFormat.RGB565);
    Assets.help4 = g.newImage("help4.png", ImageFormat.RGB565);
    
    Assets.about = g.newImage("about.png", ImageFormat.RGB565);  
    
    Assets.menu = g.newImage("menu.png", ImageFormat.RGB565);
    Assets.background = g.newImage("background.png", ImageFormat.RGB565);
    Assets.character = g.newImage("character.png", ImageFormat.RGB565);
    Assets.character2 = g.newImage("character2.png", ImageFormat.RGB565);
    Assets.character3  = g.newImage("character3.png", ImageFormat.RGB565);
    Assets.characterJump = g.newImage("jumped.png", ImageFormat.RGB565);
    Assets.characterDown = g.newImage("down.png", ImageFormat.RGB565);

    
    Assets.Kamikazi = g.newImage("kamikazi.png", ImageFormat.RGB565);
    Assets.Kamikazi2 = g.newImage("kamikazi2.png", ImageFormat.RGB565);
    Assets.Kamikazi3  = g.newImage("kamikazi3.png", ImageFormat.RGB565);
    Assets.Kamikazi4  = g.newImage("kamikazi4.png", ImageFormat.RGB565);
    Assets.Kamikazi5  = g.newImage("kamikazi5.png", ImageFormat.RGB565);


    
    Assets.tiledirt = g.newImage("tiledirt.png", ImageFormat.RGB565);
    Assets.tilegrassTop = g.newImage("tilegrasstop.png", ImageFormat.RGB565);
    Assets.tilegrassBot = g.newImage("tilegrassbot.png", ImageFormat.RGB565);
    Assets.tilegrassLeft = g.newImage("tilegrassleft.png", ImageFormat.RGB565);
    Assets.tilegrassRight = g.newImage("tilegrassright.png", ImageFormat.RGB565);
    

    Assets.fire = game.getAudio().createSound("fire.wav");
    Assets.jump = game.getAudio().createSound("jump.wav");
    Assets.click = game.getAudio().createSound("click.wav");
    Assets.collision = game.getAudio().createSound("collision.wav");
    Assets.gameover = game.getAudio().createSound("gameover.wav");
    Assets.passed = game.getAudio().createSound("passed.wav");
    Assets.collect = game.getAudio().createSound("collect.wav");
    
    Settings.load(game.getFileIO());//lest load the settings
    game.setScreen(new MainMenuScreen(game));

  }

  @Override
  public void paint(float deltaTime) {
    Graphics g = game.getGraphics();
    g.drawImage(Assets.splash, 0, 0);
  }

  @Override
  public void pause() {

  }

  @Override
  public void resume() {

  }

  @Override
  public void dispose() {

  }

  @Override
  public void backButton() {

  }
}




Java Source Code List

com.hungry.mouse.framework.Audio.java
com.hungry.mouse.framework.FileIO.java
com.hungry.mouse.framework.Game.java
com.hungry.mouse.framework.Graphics.java
com.hungry.mouse.framework.Image.java
com.hungry.mouse.framework.Input.java
com.hungry.mouse.framework.Music.java
com.hungry.mouse.framework.Pool.java
com.hungry.mouse.framework.Screen.java
com.hungry.mouse.framework.Sound.java
com.hungry.mouse.framework.implementation.AccelerometerHandler.java
com.hungry.mouse.framework.implementation.AndroidAudio.java
com.hungry.mouse.framework.implementation.AndroidFastRenderView.java
com.hungry.mouse.framework.implementation.AndroidFileIO.java
com.hungry.mouse.framework.implementation.AndroidGame.java
com.hungry.mouse.framework.implementation.AndroidGraphics.java
com.hungry.mouse.framework.implementation.AndroidImage.java
com.hungry.mouse.framework.implementation.AndroidInput.java
com.hungry.mouse.framework.implementation.AndroidMusic.java
com.hungry.mouse.framework.implementation.AndroidSound.java
com.hungry.mouse.framework.implementation.MultiTouchHandler.java
com.hungry.mouse.framework.implementation.SingleTouchHandler.java
com.hungry.mouse.framework.implementation.TouchHandler.java
com.hungry.mouse.main.AboutScreen.java
com.hungry.mouse.main.Animation.java
com.hungry.mouse.main.Assets.java
com.hungry.mouse.main.Background.java
com.hungry.mouse.main.Bomb.java
com.hungry.mouse.main.Cheese.java
com.hungry.mouse.main.Enemy.java
com.hungry.mouse.main.GameScreen.java
com.hungry.mouse.main.HelpScreen1.java
com.hungry.mouse.main.HelpScreen2.java
com.hungry.mouse.main.HelpScreen3.java
com.hungry.mouse.main.HelpScreen4.java
com.hungry.mouse.main.Kamikazi.java
com.hungry.mouse.main.LevelSelectorScreen.java
com.hungry.mouse.main.LoadingScreen.java
com.hungry.mouse.main.MainMenuScreen.java
com.hungry.mouse.main.Mouse.java
com.hungry.mouse.main.Projectile.java
com.hungry.mouse.main.Rewards.java
com.hungry.mouse.main.SampleGame.java
com.hungry.mouse.main.Settings.java
com.hungry.mouse.main.Sign.java
com.hungry.mouse.main.SplashLoadingScreen.java
com.hungry.mouse.main.Tile.java