@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); // TODO: Initialize the HUD viewport hudViewport = new ScreenViewport(); // TODO: Initialize the SpriteBatch batch = new SpriteBatch(); // TODO: Initialize the BitmapFont font = new BitmapFont(); // TODO: Give the font a linear TextureFilter font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); icicles = new Icicles(iciclesViewport); // TODO: Set top score to zero topScore = 0; }
public Level() { viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); gigaGal = new GigaGal(new Vector2(50, 50), this); platforms = new Array<Platform>(); enemies = new DelayedRemovalArray<Enemy>(); bullets = new DelayedRemovalArray<Bullet>(); explosions = new DelayedRemovalArray<Explosion>(); powerups = new DelayedRemovalArray<Powerup>(); exitPortal = new ExitPortal(new Vector2(200, 200)); gameOver = false; victory = false; score = 0; }
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); hudViewport = new ScreenViewport(); batch = new SpriteBatch(); font = new BitmapFont(); font.getRegion().getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); player = new Player(iciclesViewport); icicles = new Icicles(iciclesViewport, difficulty); Gdx.input.setInputProcessor(this); topScore = 0; }
public MyScreenAdapter() { System.out.println("ScreenAdapter Reset."); cam = new OrthographicCamera(); batch = new SpriteBatch(); shape = new ShapeRenderer(); viewport = new ExtendViewport(VIEWPORT_WIDTH, VIEWPORT_HEIGHT, cam); viewport.apply(); //reset camera cam.zoom = 1; setZoomTarget(1); //set this as input processor for mouse wheel scroll events Gdx.input.setInputProcessor(this); //debug toggleVsync(); // }
@Override public void show() { AssetManager am = new AssetManager(); Assets.instance.init(am); batch = new SpriteBatch(); gameplayViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); // TODO: Comment out the debug level // level = new Level(gameplayViewport); // level.initializeDebugLevel(); // TODO: Ask the LevelLoader to load Level1 level = LevelLoader.load("Level1", gameplayViewport); chaseCam = new ChaseCam(gameplayViewport.getCamera(), level.getGigaGal()); }
@Override public void show() { if (arcadeWorld == null || reInit) { AL.getAudioManager().registerSound("sword_1", levelAssets.sword_1); AL.getAudioManager().registerSound("sword_2", levelAssets.sword_2); AL.getAudioManager().registerSound("sword_3", levelAssets.sword_3); AL.getAudioManager().registerSound("sword_4", levelAssets.sword_4); AL.getAudioManager().registerSound("rocketlauncher", levelAssets.rocketLauncher); AL.getAudioManager().registerSound("boom", levelAssets.boom); spriteBatch = new SpriteBatch(); font = new BitmapFont(); camera = new PerspectiveCamera(); camera.far = 1000; camera.position.set(new Vector3(-.5f, -.5f, 35)); camera.rotateAround(new Vector3(-.5f, -.5f, 0), Vector3.X, rot); camera.fieldOfView = 15; camera.update(); viewport = new ExtendViewport(1920, 1080, camera); viewport.apply(); uiCamera = new OrthographicCamera(); uiViewport = new FitViewport(1920, 1080, uiCamera); uiStage = new Stage(uiViewport); map = levelAssets.get(mapName); arcadeWorld = new ArcadeWorld(map, rot, camera, levelAssets); initUI(); reInit = false; playerEnt = -1; spawnPlayer(); enemies = arcadeWorld.spawnEnemies(playerEnt); arcadeWorld.setDebug(AL.getMiscellaneousConfig().debug()); } Gdx.input.setInputProcessor(this); }
@Override public void create () { // When game is started // Graphics spriteBatch = new SpriteBatch(); // Audio musicManager = new MusicManager(); soundManager = new SoundManager(); // Setting Cameras to the size of the game window cam = new OrthographicCamera(WIDTH, HEIGHT); viewport = new ExtendViewport(WIDTH, HEIGHT, cam); cam.position.set(cam.viewportWidth / 2f, cam.viewportHeight / 2f, 0); cam.update(); // commit cam changes from translate // Start Keyboard Input input = new GameInputProcessor(); Gdx.input.setInputProcessor(input); // Start Image Manager imageManager = new ImageManager(); // Start Game State Manager gsm = new GameStateManager(this); }
@Override public void create () { batch = new SpriteBatch(); assetManager = new AssetManager(); viewport = new ExtendViewport(512, 854); atlas = new TextureAtlas("retro-normal-font/retro-normal-font.atlas"); skin = new Skin(Gdx.files.internal("retro-normal-font/retro-normal-font.json"), atlas); loadAssets(); playServices.signIn(); setScreen(new MainMenuView(this)); }
public PlayScreen(QuackHack game) { this.game = game; gamecam = new OrthographicCamera(); gamePort = new ExtendViewport(QuackHack.V_WIDTH * 4 / QuackHack.PPM, QuackHack.V_HEIGHT * 4 / QuackHack.PPM, gamecam); hud = new Hud(game); maploader = new TmxMapLoader(); map = maploader.load("Tunnelv0.tmx"); renderer = new OrthogonalTiledMapRenderer(map, 1 / QuackHack.PPM); gameMusic = Gdx.audio.newMusic(Gdx.files.internal("Airborn.wav")); gameMusic.setLooping(true); gameMusic.play(); gamecam.position.set(gamePort.getMinWorldWidth() / 2, gamePort.getMinWorldHeight() / 2, 0); world = new World(new Vector2(0, -100), true); //b2dr = new Box2DDebugRenderer(); new B2WorldCreator(world, map, this); world.setContactListener(new WorldContactListener()); game.getServer().registerNetListener(this); rayHandler = rayHandlerGenerator(); for(Connection c: game.getServer().getPlayers()) { System.out.println("New Player! id: "+game.getServer().getPlayerType(c.getID()).toString()); players.put(c.getID(), new Player(c.getID(), world, this, game.getServer().getPlayerType(c.getID()))); } game.getServer().sendCommand(NetCommand.PLAYER_JOIN); //http://www.badlogicgames.com/forum/viewtopic.php?f=17&t=1795 rbg = new ParallaxBackground(new ParallaxLayer[]{ new ParallaxLayer(new TextureRegion(new Texture(Gdx.files.internal("blue_grass.png"))),new Vector2(0.5f, 0.5f),new Vector2(0, 300)), //new ParallaxLayer(atlas.findRegion("bg2"),new Vector2(1.0f,1.0f),new Vector2(0, 500)), }, 800, 480,new Vector2(150,0)); }
public Hud(QuackHack game){ this.game = game; worldTimer = 10; timeCount = 0; score = 0; viewport = new ExtendViewport(960*4, 640*4, new OrthographicCamera()); stage = new Stage(viewport, game.batch); Table table = new Table(); table.top(); table.setFillParent(true); FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/BEBAS.ttf")); FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter(); parameter.size = 150*4; countdownLabel = new Label(String.format("%d", worldTimer), new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); parameter.size = 24*4; timeLabel = new Label("GAME STARTS IN ", new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); parameter.size = 80*4; nameLabel = new Label("GAME FULL OF ANIMALS", new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); parameter.size = 30*4; playerLabel = new Label(String.format("%d ", game.getServer().getPlayers().length) + " PLAYERS WAITING", new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); table.add(nameLabel).expandX().padTop(450); table.row(); table.add(timeLabel).expandX().padTop(55); table.row(); table.add(countdownLabel).expandX().pad(30); table.row(); table.add(playerLabel).expandX(); stage.addActor(table); }
public LobbyHUD(QuackHack game){ this.game = game; this.reset(); viewport = new ExtendViewport(960*4, 640*4, new OrthographicCamera()); stage = new Stage(viewport, game.batch); Table table = new Table(); table.top(); table.setFillParent(true); FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fonts/BEBAS.ttf")); FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter(); parameter.size = 150*4; countdownLabel = new Label(String.format("%d", worldTimer), new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); parameter.size = 24*4; timeLabel = new Label("GAME STARTS IN ", new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); parameter.size = 80*4; nameLabel = new Label("Please wait...", new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); parameter.size = 30*4; playerLabel = new Label(String.format("%d ", game.getServer().getPlayers().length) + " PLAYERS WAITING", new Label.LabelStyle(generator.generateFont(parameter), Color.WHITE)); table.add(nameLabel).expandX().padTop(450); table.row(); table.add(timeLabel).expandX().padTop(55); table.row(); table.add(countdownLabel).expandX().pad(30); table.row(); table.add(playerLabel).expandX(); stage.addActor(table); }
private void createStage(final boolean initiallyEmptyStage) { if (initiallyEmptyStage) { stage = new Stage(); stage.addActor(stageBuilder.createRootGroup(null)); } else { stage = stageBuilder.build(fileName, new ExtendViewport(width, height)); } stage.setDebugAll(true); }
/** * Sets up the world camera according to the data computed in setupMapBoundsAndDimensions() method */ private void setupCamera() { //Centers worldCamera on map worldCamera.translate(mapPartCenter.x, mapPartCenter.y); //Maximizes the map size on screen worldCamera.viewportWidth = mapPartPixWidth; worldCamera.viewportHeight = mapPartPixHeight; worldViewport = new ExtendViewport(mapPartPixWidth, mapPartPixHeight, worldCamera); }
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); player = new Player(iciclesViewport); // TODO: Initialize icicles icicles = new Icicles(iciclesViewport); }
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); player = new Player(iciclesViewport); icicles = new Icicles(iciclesViewport); }
@Override public void show() { iciclesViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); player = new Player(iciclesViewport); icicle = new Icicle(new Vector2(Constants.WORLD_SIZE / 2, Constants.WORLD_SIZE / 2)); }
@Override public void show() { AssetManager am = new AssetManager(); Assets.instance.init(am); batch = new SpriteBatch(); gameplayViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); level = new Level(gameplayViewport); chaseCam = new ChaseCam(gameplayViewport.getCamera(), level.getGigaGal()); }
@Override public void show() { renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE); ball = new BouncingBall(viewport); Gdx.input.setInputProcessor(ball); }
@Override public void show() { renderer = new ShapeRenderer(); renderer.setAutoShapeType(true); viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE); ball = new BouncingBall(viewport); balls = new Array<BouncingBall>(); for (int i = 0; i < BALL_COUNT; i++) { balls.add(new BouncingBall(viewport)); } Gdx.input.setInputProcessor(this); }
@Override public void show() { renderer = new ShapeRenderer(); viewport = new ExtendViewport(WORLD_SIZE, WORLD_SIZE); avalanche = new Avalanche(); }
@Override public void create() { // TODO: Initialize the ShapeRenderer and ExtendViewport renderer = new ShapeRenderer(); viewport = new ExtendViewport(WORLD_WIDTH, WORLD_HEIGHT); }
@Override public void show() { AssetManager am = new AssetManager(); Assets.instance.init(am); batch = new SpriteBatch(); gameplayViewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); level = new Level(gameplayViewport); level.initializeDebugLevel(); // level = LevelLoader.load("Level1", gameplayViewport); chaseCam = new ChaseCam(gameplayViewport.getCamera(), level.getGigaGal()); }
@Override public void show() { AssetManager am = new AssetManager(); Assets.instance.init(am); level = new Level(); batch = new SpriteBatch(); viewport = new ExtendViewport(Constants.WORLD_SIZE, Constants.WORLD_SIZE); }