Java 类org.newdawn.slick.AppGameContainer 实例源码

项目:Progetto-C    文件:PacmanGame.java   
/**
 * This method starts the game 
 * @param mode identify the modality of the game 
 */
public void startGame(String mode){
    try
    {
        this.mode = mode;
        MazeView vl = new MazeView(this, mode);
        AppGameContainer app = new AppGameContainer(vl);
        app.setDisplayMode(608, 704, false);

        if(mode.equals("extreme"))
            app.setTargetFrameRate(260);
        else 
            app.setTargetFrameRate(60);

        app.setShowFPS(false);
        app.start();
    }
    catch (SlickException e)
    {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:MainMenu.java   
@Override
public void update(GameContainer gc, StateBasedGame sbg, int i) throws SlickException {
    if (shouldToggleFullscreen) {
        shouldToggleFullscreen = false;
        boolean fs = !gc.isFullscreen();
        AppGameContainer agc = (AppGameContainer)gc;
        agc.setDisplayMode(fs ? agc.getScreenWidth() : Application.DISPLAY_WIDTH,
                           fs ? agc.getScreenHeight() : Application.DISPLAY_HEIGHT, fs);
    }
    if (gc.getInput().isKeyPressed(Input.KEY_ENTER)) {
        click.play(1.0f, CLICK_VOLUME);
        mainMenu.fade(1000, 0.0f, true);
        sbg.enterState(Application.GAME, new FadeOutTransition(Color.black, 1000), new EmptyTransition());
    }
    if (gc.getInput().isKeyPressed(Input.KEY_C)) {
        sbg.enterState(Application.CREDITS);
    }
}
项目:BaseClient    文件:StateBasedTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new StateBasedTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:ImageCornerTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    boolean sharedContextTest = false;

    try {
        AppGameContainer container = new AppGameContainer(new ImageCornerTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:InkscapeTest.java   
/**
 * Entry point to our simple test
 * 
 * @param argv The arguments passed in
 */
public static void main(String argv[]) {
    try {
        Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
        Renderer.setLineStripRenderer(Renderer.QUAD_BASED_LINE_STRIP_RENDERER);

        AppGameContainer container = new AppGameContainer(new InkscapeTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:GeomUtilTileTest.java   
/**
 * Entry point to our test
 * 
 * @param argv
 *            The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(
                new GeomUtilTileTest());
        container.setDisplayMode(800, 600, false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:AntiAliasTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new AntiAliasTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:GradientTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);

        AppGameContainer container = new AppGameContainer(new GradientTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:SoundURLTest.java   
/**
 * Entry point to the sound test
 * 
 * @param argv The arguments provided to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new SoundURLTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:ImageOutTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new ImageOutTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:ImageMemTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new ImageMemTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:InputProviderTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new InputProviderTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:ImageBufferEndianTest.java   
/**
 * Entry point to the test
 * 
 * @param args The arguments passed into the test
 */
public static void main(String[] args) {
   try {
      AppGameContainer container = new AppGameContainer(new ImageBufferEndianTest());
      container.setDisplayMode(800,600,false);
      container.start();
   } catch (SlickException e) {
      e.printStackTrace();
   }
}
项目:trashjam2017    文件:PackedSheetTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new PackedSheetTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:UnicodeFontTest.java   
/**
 * Entry point to our simple test
 * 
 * @param args The arguments supplied to the test
 * @throws SlickException Indicates a failure loading or processing resources 
 * @throws IOException Indicates a failure loading the font
 */
public static void main(String[] args) throws SlickException, IOException {
    Input.disableControllers();
    AppGameContainer container = new AppGameContainer(new UnicodeFontTest());
    container.setDisplayMode(512, 600, false);
    container.setTargetFrameRate(20);
    container.start();
}
项目:Spark    文件:SlickEngine.java   
public final void Initialize()
{
    // Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
    try
    {
        if (AppGameContainer.getBuildVersion() < 206)
        {
            System.err
                    .println("Your slick.jar is outdated!  Please reinstall the game.");
            JOptionPane
                    .showMessageDialog(null,
                            "Your slick.jar is outdated!  Please reinstall the game.");
            System.exit(0);
            return;
        }

        slickResources = new SlickResources(game);
        slickGame = new SlickGame(game, this);

        container = new AppGameContainer(slickGame);

        // Setup the display
        if (game.gameOptions.displayWindowed == true)
            container.setDisplayMode(game.ResolutionX, game.ResolutionY,
                    false);
        else
            container.setDisplayMode(game.ResolutionX, game.ResolutionY,
                    true);

        container.start();
    }
    catch (Exception e)
    {
        game.throwException(e);
    }
}
项目:Progetto-C    文件:ClipTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new ClipTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:TransitionTest.java   
/**
 * Entry point to our test
 * 
 * @param argv
 *            The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(
                new TransitionTest());
        container.setDisplayMode(800, 600, false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:Progetto-C    文件:Bootstrap.java   
/**
 * Start the game as an application
 * 
 * @param game The game to be started
 * @param width The width of the window
 * @param height The height of the window
 * @param fullscreen True if the window should be fullscreen
 */
public static void runAsApplication(Game game, int width, int height, boolean fullscreen) {
    try {
        AppGameContainer container = new AppGameContainer(game, width, height, fullscreen);
        container.start();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:FontPerformanceTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed in the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new FontPerformanceTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:GUITest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new GUITest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:ParticleTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new ParticleTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:Progetto-C    文件:GUITest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new GUITest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:MorphShapeTest.java   
/**
 * Entry point to our test
 * 
 * @param argv
 *            The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(
                new MorphShapeTest());
        container.setDisplayMode(800, 600, false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:FlashTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new FlashTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:ImageGraphicsTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        GraphicsFactory.setUseFBO(false);

        AppGameContainer container = new AppGameContainer(new ImageGraphicsTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:InputProviderTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new InputProviderTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:TileMapTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new TileMapTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:GradientImageTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new GradientImageTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:ImageReadTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new ImageReadTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:SoundTest.java   
/**
 * Entry point to the sound test
 * 
 * @param argv The arguments provided to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new SoundTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:GeomTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);

        AppGameContainer container = new AppGameContainer(new GeomTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:PedigreeTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new PedigreeTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:ImageBufferEndianTest.java   
/**
 * Entry point to the test
 * 
 * @param args The arguments passed into the test
 */
public static void main(String[] args) {
   try {
      AppGameContainer container = new AppGameContainer(new ImageBufferEndianTest());
      container.setDisplayMode(800,600,false);
      container.start();
   } catch (SlickException e) {
      e.printStackTrace();
   }
}
项目:trashjam2017    文件:FontTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed in the test
 */
public static void main(String[] argv) {
    try {
        container = new AppGameContainer(new FontTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:Progetto-C    文件:AlphaMapTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments to pass into the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new AlphaMapTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:GUITest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new GUITest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:BaseClient    文件:SoundPositionTest.java   
/**
 * Entry point to the sound test
 * 
 * @param argv The arguments provided to the test
 */
public static void main(String[] argv) {
    try {
        AppGameContainer container = new AppGameContainer(new SoundPositionTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:ShapeTest.java   
/**
 * Entry point to our test
 * 
 * @param argv The arguments passed to the test
 */
public static void main(String[] argv) {
    try {
        Renderer.setRenderer(Renderer.VERTEX_ARRAY_RENDERER);
        AppGameContainer container = new AppGameContainer(new ShapeTest());
        container.setDisplayMode(800,600,false);
        container.start();
    } catch (SlickException e) {
        e.printStackTrace();
    }
}
项目:trashjam2017    文件:InputTest.java   
/**
 * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
 */
public void init(GameContainer container) throws SlickException {
    if (container instanceof AppGameContainer) {
        app = (AppGameContainer) container;
    }

    input = container.getInput();
    x = 300;
    y = 300;
}