List of usage examples for com.badlogic.gdx.math GridPoint2 GridPoint2
public GridPoint2()
From source file:net.bplaced.therefactory.voraciousviper.model.Tile.java
License:Open Source License
Tile(Sprite sprite, TileType type) {
this.sprite = sprite;
this.type = type;
position = new GridPoint2();
}
From source file:net.bplaced.therefactory.voraciousviper.model.Viper.java
License:Open Source License
public Viper(Level level, TextureAtlas textureAtlas) { this.level = level; nextHeadPosition = new GridPoint2(); currentBodyPosition = new GridPoint2(); nextBodyPosition = new GridPoint2(); movementVector = new GridPoint2(1, 0); movementDirection = MovementDirection.Horizontal; color = Green.ordinal();/*from w w w. jav a 2 s. c o m*/ sprites = new Sprite[][] { new Sprite[] { textureAtlas.createSprite("Head.X.1.Green"), textureAtlas.createSprite("Head.X.2.Green"), textureAtlas.createSprite("Head.Y.1.Green"), textureAtlas.createSprite("Head.Y.2.Green"), textureAtlas.createSprite("Tail.X.Green"), textureAtlas.createSprite("Tail.Y.Green"), textureAtlas.createSprite("Body.Green") }, new Sprite[] { textureAtlas.createSprite("Head.X.1.Blue"), textureAtlas.createSprite("Head.X.2.Blue"), textureAtlas.createSprite("Head.Y.1.Blue"), textureAtlas.createSprite("Head.Y.2.Blue"), textureAtlas.createSprite("Tail.X.Blue"), textureAtlas.createSprite("Tail.Y.Blue"), textureAtlas.createSprite("Body.Blue") }, new Sprite[] { textureAtlas.createSprite("Head.X.1.Purple"), textureAtlas.createSprite("Head.X.2.Purple"), textureAtlas.createSprite("Head.Y.1.Purple"), textureAtlas.createSprite("Head.Y.2.Purple"), textureAtlas.createSprite("Tail.X.Purple"), textureAtlas.createSprite("Tail.Y.Purple"), textureAtlas.createSprite("Body.Purple") } }; head = new TileFlipable(sprites[Green.ordinal()][Head_X_1.ordinal()]); tail = new TileFlipable(sprites[Green.ordinal()][Tail_X.ordinal()]); body = new Array<Tile>(); }
From source file:net.mwplay.cocostudio.ui.particleutil.LyU.java
License:Apache License
public static GridPoint2 parsePoint(String vector) { GridPoint2 res = new GridPoint2(); res.x = Integer.parseInt(vector.substring(vector.indexOf('{') + 1, vector.indexOf(',')).trim()); res.y = Integer.parseInt(vector.substring(vector.indexOf(',') + 1, vector.indexOf('}')).trim()); return res;/* w ww . j av a 2 s . co m*/ }