List of usage examples for com.badlogic.gdx.utils Array Array
public Array()
From source file:at.therefactory.jewelthief.Game.java
License:Open Source License
public Game(Player player) { font = JewelThief.getInstance().getFont(); prefs = JewelThief.getInstance().getPreferences(); bundle = JewelThief.getInstance().getBundle(); soundEnabled = prefs.getBoolean(PrefsKeys.ENABLE_SOUND); font.setColor(Color.BLACK);//from w w w .j av a2 s . c o m this.player = player; enemies = new Array<Enemy>(); newEnemies = new Array<Enemy>(); jewels = new Array<Jewel>(); loadAssets(); initGuiElements(); resetGame(); }
From source file:br.cefetmg.games.minigames.CollectItens.java
public CollectItens(BaseScreen screen, GameStateObserver observer, float difficulty) { super(screen, difficulty, 10000, TimeoutBehavior.FAILS_WHEN_MINIGAME_ENDS, observer); this.characters = new Array<Sprite>(); this.texturaFundo = this.screen.assets.get("collect-itens/fundo.png", Texture.class); this.toothpasteTexture = this.screen.assets.get("collect-itens/toothpaste.png", Texture.class); this.toothbrushTexture = this.screen.assets.get("collect-itens/toothbrush.png", Texture.class); this.lollipopTexture = this.screen.assets.get("collect-itens/lollipop.png", Texture.class); this.candyTexture = this.screen.assets.get("collect-itens/candy.png", Texture.class); this.goodMouthTexture = this.screen.assets.get("collect-itens/bocaboa.png", Texture.class); this.badMouthTexture = this.screen.assets.get("collect-itens/bocaruim.png", Texture.class); this.enemiesAppearing = screen.assets.get("collect-itens/aperta.mp3", Sound.class); this.friendsAppearing = screen.assets.get("collect-itens/aperta.mp3", Sound.class); this.collectGoodItem = screen.assets.get("collect-itens/pegaitembom.mp3", Sound.class); this.collectBadItem = screen.assets.get("collect-itens/pegaitemruim.mp3", Sound.class); this.venceu = screen.assets.get("collect-itens/aplausos.mp3", Sound.class); this.perdeu = screen.assets.get("collect-itens/game-over.mp3", Sound.class); this.boca = new Sprite(goodMouthTexture); this.fundo = new Sprite(texturaFundo); this.boca.setOriginCenter(); this.friendsCollected = 0; this.spawnedCharacters = 0; this.friends = 0; this.quantAtualToothbrush = 0; this.quantAtualToothpaste = 0; scheduleCharactersSpawn();/* w w w .j av a 2 s . c o m*/ }
From source file:br.cefetmg.games.minigames.EscoveOsDentes.java
public EscoveOsDentes(BaseScreen screen, GameStateObserver observer, float difficulty) { super(screen, difficulty, 10000, TimeoutBehavior.FAILS_WHEN_MINIGAME_ENDS, observer); this.Escovar = new Array<Escova>(); this.Tooths = new Array<Sprite>(); this.toothTexture = this.screen.assets.get("escove-os-dentes/toothdirty.png", Texture.class); this.dente = this.screen.assets.get("escove-os-dentes/toothclean.png", Texture.class); this.bolhas = this.screen.assets.get("escove-os-dentes/brush2.png", Texture.class); this.fundo = this.screen.assets.get("escove-os-dentes/fundo.png", Texture.class); this.EscovaTexture = this.screen.assets.get("escove-os-dentes/brush1.png", Texture.class); this.BrushingSound = this.screen.assets.get("escove-os-dentes/escovar.mp3", Sound.class); this.itsCleanSound = this.screen.assets.get("escove-os-dentes/limpo.wav", Sound.class); this.escova = new Sprite(EscovaTexture); this.fundo2 = new Sprite(fundo); this.escova.setOriginCenter(); this.cleanTooth = 0; this.spawnedTooth = 0; this.escova.setScale((float) 0.25); this.escova.rotate(30); this.fundo2.setOriginCenter(); this.fundo2.setSize(super.screen.viewport.getWorldWidth(), super.screen.viewport.getWorldHeight()); scheduleEnemySpawn();/*from ww w .ja va 2 s .c o m*/ }
From source file:br.cefetmg.games.minigames.FleeTheTartarus.java
public FleeTheTartarus(BaseScreen screen, GameStateObserver observer, float difficulty) { super(screen, difficulty, 10000, TimeoutBehavior.FAILS_WHEN_MINIGAME_ENDS, observer); this.backgroundTexture = this.screen.assets.get("flee-the-tartarus/fundo.png", Texture.class); this.background = new Sprite(this.backgroundTexture); this.background.setOriginCenter(); float novaEscala = 1.4f; float escalaX = novaEscala * Gdx.graphics.getWidth(); float escalaY = novaEscala * Gdx.graphics.getHeight(); this.background.setSize(escalaX, escalaY); this.enemies = new Array<Tartarus>(); this.tartarusTexture = this.screen.assets.get("flee-the-tartarus/spritecarie.png", Texture.class); this.toothTexture = this.screen.assets.get("flee-the-tartarus/dente.png", Texture.class); this.deadToothTexture = this.screen.assets.get("flee-the-tartarus/dente-morto.png", Texture.class); this.tooth = new Tooth(toothTexture); this.tooth.setOriginCenter(); this.tooth.setScale(0.7f); this.tartarusAppearingSound = new Array<Sound>(3); this.tartarusAppearingSound.addAll(screen.assets.get("flee-the-tartarus/aperta2.mp3", Sound.class), screen.assets.get("flee-the-tartarus/aperta2.mp3", Sound.class), screen.assets.get("flee-the-tartarus/aperta2.mp3", Sound.class)); this.venceu = screen.assets.get("flee-the-tartarus/venceu.mp3", Sound.class); this.perdeu = screen.assets.get("flee-the-tartarus/game-over.mp3", Sound.class); super.timer.scheduleTask(new Timer.Task() { @Override// ww w . j a va 2 s . co m public void run() { spawnEnemy(); } }, 0, this.spawnInterval / 1000f); }
From source file:br.cefetmg.games.minigames.Gallows.java
public Gallows(BaseScreen screen, GameStateObserver observer, float difficulty) { super(screen, difficulty, 15000, TimeoutBehavior.FAILS_WHEN_MINIGAME_ENDS, observer); this.mouseTexture = this.screen.assets.get("Gallows/mousePointer.png", Texture.class); this.mousePointer = new Sprite(mouseTexture); this.mousePointer.setOriginCenter(); this.mousePointer.setScale(0.3f); this.gallowTexture = super.screen.assets.get("Gallows/spriteTooth.png", Texture.class); new Gallow(gallowTexture); this.tentativas = 0; this.tracoTexture = this.screen.assets.get("Gallows/traco.png", Texture.class); this.traco = new Sprite(tracoTexture); this.traco.setScale(0.6f); this.tracoBrancoTexture = this.screen.assets.get("Gallows/tracoBranco.png", Texture.class); this.tracoBranco = new Sprite(tracoBrancoTexture); this.tracoBranco.setScale(0.6f); this.letrasTexture = super.screen.assets.get("Gallows/letras.png", Texture.class); new Letters(letrasTexture); this.letters = new Array<StructSprite>(); colocaLetrasNoArray();//from w w w. java2s .c o m this.word = escolhePalavra(); this.letrasCertas = new Array<Sprite>(); this.qtdLetrasAcertadas = 0; for (int i = 0; i < word.length(); i++) { if (word.charAt(i) != ' ') { qtdLetrasAcertadas++; } } this.somDenteQuebrando = this.screen.assets.get("Gallows/denteQuebrando.mp3", Sound.class); this.somSucesso = this.screen.assets.get("Gallows/sucesso.mp3", Sound.class); }
From source file:br.cefetmg.games.minigames.PutTheBraces.java
public PutTheBraces(BaseScreen screen, GameStateObserver observer, float difficulty) { super(screen, difficulty, 10000, TimeoutBehavior.FAILS_WHEN_MINIGAME_ENDS, observer); this.toothTexture = super.screen.assets.get("put-the-braces/tooth.png", Texture.class); this.breteTexture = super.screen.assets.get("put-the-braces/brete.png", Texture.class); this.breteSound = super.screen.assets.get("put-the-braces/metal.mp3", Sound.class); teeth = new Array<Tooth>(); numberOfBracedTeeth = 0;// w w w . ja va 2 s . co m brete = new Sprite(breteTexture); brete.setOriginCenter(); this.initializeTeeth(); }
From source file:br.cefetmg.games.minigames.SaveTheTeeth.java
public SaveTheTeeth(BaseScreen screen, GameStateObserver observer, float difficulty) { super(screen, difficulty, 10000, TimeoutBehavior.WINS_WHEN_MINIGAME_ENDS, observer); this.MouthTexture = super.screen.assets.get("save-the-teeth/boca-spritesheet.png", Texture.class); this.CursorTexture = super.screen.assets.get("save-the-teeth/cursor.png", Texture.class); this.BadFoodSpritesheet = super.screen.assets.get("save-the-teeth/bad.png", Texture.class); this.BadFoodTextures = TextureRegion.split(BadFoodSpritesheet, Food.BAD_WIDTH, Food.BAD_HEIGHT); this.GoodFoodSpritesheet = super.screen.assets.get("save-the-teeth/good.png", Texture.class); this.GoodFoodTextures = TextureRegion.split(GoodFoodSpritesheet, Food.GOOD_WIDTH, Food.GOOD_HEIGHT); this.food = new Array<Food>(); this.mouthFrames = TextureRegion.split(MouthTexture, Mouth.FRAME_WIDTH, Mouth.FRAME_HEIGHT); this.mouth = new Mouth(mouthFrames[0][0], mouthFrames[0][1], mouthFrames[0][2], 2); this.cursor = new Cursor(CursorTexture); this.backGroundSound = screen.assets.get("save-the-teeth/fundo.wav", Sound.class); this.backGroundTexture = super.screen.assets.get("save-the-teeth/background.jpg", Texture.class); this.bg = new Sprite(backGroundTexture); this.bg.setSize(super.screen.viewport.getWorldWidth(), super.screen.viewport.getWorldHeight()); super.timer.scheduleTask(new Timer.Task() { @Override//from ww w. j a va 2 s .c o m public void run() { throwFood(); } }, 0, this.foodSpawnInterval / 1000f); backGroundSound.play(); }
From source file:br.cefetmg.games.minigames.OrientacaoSnake.java
public SnakeCaries(BaseScreen screen, GameStateObserver observer, float difficulty) { super(screen, difficulty, 11000, TimeoutBehavior.FAILS_WHEN_MINIGAME_ENDS, observer); this.enemies = new Array<Sprite>(); this.fundoTexture = this.screen.assets.get("snake-caries/fundo.png", Texture.class); this.cariesTexture = this.screen.assets.get("snake-caries/carie.png", Texture.class); this.setaTopTexture = this.screen.assets.get("snake-caries/seta-cima.png", Texture.class); this.setaRightTexture = this.screen.assets.get("snake-caries/seta-direita.png", Texture.class); this.setaDownTexture = this.screen.assets.get("snake-caries/seta-baixo.png", Texture.class); this.setaLeftTexture = this.screen.assets.get("snake-caries/seta-esquerda.png", Texture.class); this.snakeTexture = this.screen.assets.get("snake-caries/snake.png", Texture.class); this.setaPretaTexture = this.screen.assets.get("snake-caries/pressionado.png", Texture.class); this.cariesDyingSound = this.screen.assets.get("snake-caries/carie-morrendo.wav", Sound.class); this.enemiesKilled = 0; this.fundo = new Sprite(fundoTexture); this.fundo.setPosition(0, 0); generateSetas();/* w ww . j a v a2s .co m*/ generateSnake(); spawnEnemies(); this.orientacao = OrientacaoSnake.Right; }
From source file:br.com.raphaelbruno.game.zombieinvaders.vr.model.Word.java
License:Apache License
private void init() { float centerX = 0f; float centerY = ((((float) words.length) * FONT_HEIGHT) - FONT_HEIGHT) / 2f; nodes.clear();//w ww. ja v a2s.c o m nodesPosition = new Array<Vector3>(); if (words != null && words.length > 0) { for (int y = 0; y < words.length; y++) { String[] word = translateSpecialCharacters(words[y]); centerX = (((float) word.length) * FONT_WIDTH) / 2f; for (int x = 0; x < word.length; x++) { String letter = String.valueOf(word[x]); Node node = model.getNode(letter); if (node != null) { Vector3 position = new Vector3((FONT_WIDTH * x) - centerX, (-FONT_HEIGHT * y) + centerY, 0); node = node.copy(); node.globalTransform.setTranslation(position); nodes.add(node); nodesPosition.add(position.cpy()); } } } } }
From source file:ca.hiphiparray.amazingmaze.MapFactory.java
License:Open Source License
/** * Constructor for creation of a map factory. * * @param game The {@link AmazingMazeGame} instance to get resources from. * @param seed The seed to use for generation by this factory. * @param width The width of the maps (in tiles) generated by this factory. * @param height The height of the maps (in tiles) generated by this factory. * @param tileSize The side length (in pixels) of the tiles. *///from w w w . j a v a2s . c om public MapFactory(final AmazingMazeGame game, long seed, int width, int height, int tileSize) { this.assets = game.assets; this.random = new Random(seed); this.width = width; this.height = height; this.gateLocations = new Array<Point>(); this.gateOn = new ArrayList<Circuit>(); }