/** * @see org.newdawn.slick.Game#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { font = new AngelCodeFont("testdata/perffont.fnt","testdata/perffont.png"); for (int j=0;j<2;j++) { int lineLen = 90; for (int i=0;i<text.length();i+=lineLen) { if (i+lineLen > text.length()) { lineLen = text.length() - i; } lines.add(text.substring(i, i+lineLen)); } lines.add(""); } }
/** * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { LoadingList.setDeferredLoading(true); new Sound("testdata/cbrown01.wav"); new Sound("testdata/engine.wav"); sound = new Sound("testdata/restart.ogg"); new Music("testdata/testloop.ogg"); music = new Music("testdata/SMB-X.XM"); new Image("testdata/cursor.png"); new Image("testdata/cursor.tga"); new Image("testdata/cursor.png"); new Image("testdata/cursor.png"); new Image("testdata/dungeontiles.gif"); new Image("testdata/logo.gif"); image = new Image("testdata/logo.tga"); new Image("testdata/logo.png"); new Image("testdata/rocket.png"); new Image("testdata/testpack.png"); font = new AngelCodeFont("testdata/demo.fnt", "testdata/demo_00.tga"); }
@Override public void initStatesList(GameContainer gc) throws SlickException { // First initialise our default font. We need to draw with display list // caching disabled defaultFont = new AngelCodeFont( "org/newdawn/slick/data/defaultfont.fnt", "org/newdawn/slick/data/defaultfont.png", false); addState(new SplashScreen()); addState(new Game()); addState(new Grace()); addState(new Pause()); addState(new Lose()); addState(new Win()); addState(new HighScoreState()); }
@Override public void init(GameContainer container, StateBasedGame game) throws SlickException { fontImage = new Image("res/font/lcd_solid_9_00.png"); fontImage.setFilter(Image.FILTER_NEAREST); font = new AngelCodeFont("res/font/lcd_solid_9.fnt", fontImage); backButtonImage = new Image("res/img/ui/backButton.png"); backButtonImage.setFilter(Image.FILTER_NEAREST); backButton = new Button(80f, 160f, backButtonImage.getWidth(), backButtonImage.getHeight(), backButtonImage); dealWithIt = new Image("res/img/ui/dealwithit.png"); dealWithIt.setFilter(Image.FILTER_NEAREST); dealWithItXPos = 36f; dealWithItYPos = -20f; dealWithItYTarget = 72f; printTheEnd = 0; printTheEndTarget = 1000; // Sprite sheep strikes back SpriteSheet spriteSheep = new SpriteSheet("res/img/character/bartender alpha.png", 16, 16); characterImage = spriteSheep.getSprite(3, 0); characterImage.setFilter(Image.FILTER_NEAREST); bookImage = new Image("res/img/items/book.png"); bookImage.setFilter(Image.FILTER_NEAREST); }
@Override public void init(GameContainer container, StateBasedGame game) throws SlickException { fontImage = new Image("res/font/lcd_solid_9_00.png"); fontImage.setFilter(Image.FILTER_NEAREST); font = new AngelCodeFont("res/font/lcd_solid_9.fnt", fontImage); startButtonImage = new Image("res/img/ui/startButton.png"); startButtonImage.setFilter(Image.FILTER_NEAREST); creditsButtonImage= new Image("res/img/ui/creditsButton.png"); creditsButtonImage.setFilter(Image.FILTER_NEAREST); quitButtonImage= new Image("res/img/ui/quitButton.png"); quitButtonImage.setFilter(Image.FILTER_NEAREST); startButton = new Button(80f, 120f, startButtonImage.getWidth(), startButtonImage.getHeight(), startButtonImage); creditsButton = new Button(80f, 140f, creditsButtonImage.getWidth(), creditsButtonImage.getHeight(), creditsButtonImage); quitButton = new Button(80f, 160f, quitButtonImage.getWidth(), quitButtonImage.getHeight(), quitButtonImage); }
/** * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { testImage = new Image("testdata/logo.png"); preloaded = new Image("testdata/logo.png"); testFont = new AngelCodeFont("testdata/hiero.fnt","testdata/hiero.png"); target = new Image(400,300); cut = new Image(100,100); gTarget = target.getGraphics(); offscreenPreload = preloaded.getGraphics(); offscreenPreload.drawString("Drawing over a loaded image", 5, 15); offscreenPreload.setLineWidth(5); offscreenPreload.setAntiAlias(true); offscreenPreload.setColor(Color.blue.brighter()); offscreenPreload.drawOval(200, 30, 50, 50); offscreenPreload.setColor(Color.white); offscreenPreload.drawRect(190,20,70,70); offscreenPreload.flush(); if (GraphicsFactory.usingFBO()) { using = "FBO (Frame Buffer Objects)"; } else if (GraphicsFactory.usingPBuffer()) { using = "Pbuffer (Pixel Buffers)"; } System.out.println(preloaded.getColor(50,50)); }
/** * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { image = new Image("testdata/rocket.png"); back = new Image("testdata/sky.jpg"); font = new AngelCodeFont("testdata/hiero.fnt","testdata/hiero.png"); SpriteSheet sheet = new SpriteSheet("testdata/homeranim.png", 36, 65); homer = new Animation(sheet, 0,0,7,0,true,150,true); }
/** * @see org.newdawn.slick.Game#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { font = new AngelCodeFont("testdata/demo2.fnt","testdata/demo2_00.tga"); font2 = new AngelCodeFont("testdata/hiero.fnt","testdata/hiero.png"); image = new Image("testdata/demo2_00.tga", false); widthFont = new AngelCodeFont("testdata/courier14_h2.fnt","testdata/courier14_h2.png",true); }
@Override public void init(GameContainer container, StateBasedGame game) throws SlickException { fontImage = new Image("res/font/lcd_solid_9_00.png"); fontImage.setFilter(Image.FILTER_NEAREST); font = new AngelCodeFont("res/font/lcd_solid_9.fnt", fontImage); backButtonImage = new Image("res/img/ui/backButton.png"); backButtonImage.setFilter(Image.FILTER_NEAREST); backButton = new Button(80f, 160f, backButtonImage.getWidth(), backButtonImage.getHeight(), backButtonImage); }
@Override public void init(GameContainer container, StateBasedGame game) throws SlickException { // Start the font fontImage = new Image("res/font/lcd_solid_9_00.png"); fontImage.setFilter(Image.FILTER_NEAREST); font = new AngelCodeFont("res/font/lcd_solid_9.fnt", fontImage); // Start the map map = new Map("res/map/dungeon.tmx"); // Start the time currentTime = 0; // Sound piano = new Sound("res/sfx/piano.wav"); playedFirstPiano = false; playedSecondPiano = false; // Create the Entities character = new Character(27, 27); book = new Book(4, 1); //book = new Book(25, 27); enemy = new Enemy[7]; enemy[0] = new Enemy(2, 6); enemy[1] = new Enemy(2, 18); enemy[2] = new Enemy(13, 15); enemy[3] = new Enemy(10, 2); enemy[4] = new Enemy(27, 2); enemy[5] = new Enemy(23, 15); enemy[6] = new Enemy(14, 25); }
/** * @see org.newdawn.slick.state.BasicGameState#init(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame) */ public void init(GameContainer container, StateBasedGame game) throws SlickException { this.game = game; font = new AngelCodeFont("testdata/demo2.fnt","testdata/demo2_00.tga"); }
/** * @see org.newdawn.slick.state.BasicGameState#init(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame) */ public void init(GameContainer container, StateBasedGame game) throws SlickException { font = new AngelCodeFont("testdata/demo2.fnt","testdata/demo2_00.tga"); this.game = game; }
/** * @see org.newdawn.slick.state.BasicGameState#init(org.newdawn.slick.GameContainer, org.newdawn.slick.state.StateBasedGame) */ public void init(GameContainer container, StateBasedGame game) throws SlickException { this.game = game; font = new AngelCodeFont("testdata/demo2.fnt","testdata/demo2_00.tga"); image = new Image("testdata/logo.tga"); }
/** * @see org.newdawn.slick.Game#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { font = new AngelCodeFont("testdata/demo2.fnt","testdata/demo2_00.tga"); font2 = new AngelCodeFont("testdata/hiero.fnt","testdata/hiero.png"); image = new Image("testdata/demo2_00.tga", false); }
/** * @see org.newdawn.slick.Game#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { image = new Image("testdata/sky.jpg"); font = new AngelCodeFont("testdata/hiero.fnt","testdata/hiero.png"); }
/** * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { font = new AngelCodeFont("testdata/distance.fnt", "testdata/distance-dis.png"); container.getGraphics().setBackground(Color.black); }