Example usage for com.badlogic.gdx.math GridPoint2 GridPoint2

List of usage examples for com.badlogic.gdx.math GridPoint2 GridPoint2

Introduction

In this page you can find the example usage for com.badlogic.gdx.math GridPoint2 GridPoint2.

Prototype

public GridPoint2(int x, int y) 

Source Link

Document

Constructs a new 2D grid point.

Usage

From source file:com.github.antag99.chick.system.SpatialSystem.java

License:Open Source License

private void addEntity(int room, int x, int y, int entity) {
    EntitySet set = mRoom.get(room).partitions.get(lookup.set(x, y));
    if (set == null) {
        set = sets.obtain();/*w ww  .j a v  a2 s.  co  m*/
        mRoom.get(room).partitions.put(new GridPoint2(x, y), set);
    }
    set.edit().addEntity(entity);
}

From source file:com.gmail.emersonmx.tictactoe.GameScreen.java

License:Open Source License

private Actor createHash() {
    Group group = new Group();
    group.setName("hash");

    GridPoint2[] layout = new GridPoint2[] { new GridPoint2(179, 401), new GridPoint2(240, 462),
            new GridPoint2(301, 401), new GridPoint2(240, 340) };

    Sprite sprite = null;//from  w  w  w . j  av a2  s  .  com
    GridPoint2 point = null;
    for (int i = 0; i < layout.length; ++i) {
        point = layout[i];

        sprite = ttt.atlas.createSprite("hash_line");
        sprite.setCenter(point.x, point.y);
        if (i % 2 != 0) {
            sprite.rotate(90);
        }

        group.addActor(new SpriteActor("hash_line_" + i, sprite));
    }

    return group;
}

From source file:com.gmail.emersonmx.tictactoe.GameScreen.java

License:Open Source License

private GridPoint2[] createPlayerMarkLayout() {
    return new GridPoint2[] { new GridPoint2(118, 523), new GridPoint2(240, 523), new GridPoint2(362, 523),
            new GridPoint2(118, 401), new GridPoint2(240, 401), new GridPoint2(362, 401),
            new GridPoint2(118, 279), new GridPoint2(240, 279), new GridPoint2(362, 279) };
}

From source file:com.gmail.emersonmx.tictactoe.GameScreen.java

License:Open Source License

private Array<Rectangle> createPlayerMarkRectangles() {
    Array<Rectangle> rectangles = new Array<Rectangle>(10);

    float width, height;
    width = height = 108;/*from   w ww.j av a2s . c  o m*/

    GridPoint2 point = new GridPoint2(64, 469);
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            rectangles.add(new Rectangle(point.x, point.y, width, height));
            point.x += 122;
        }

        point.x = 64;
        point.y -= 122;
    }

    return rectangles;
}

From source file:com.gmail.emersonmx.tictactoe.GameScreen.java

License:Open Source License

private Actor createScoreSeparators() {
    Group group = new Group();
    group.setName("score_separators");

    GridPoint2[] layout = new GridPoint2[] { new GridPoint2(192, 87), new GridPoint2(288, 87) };

    GridPoint2 point = null;// w w  w  .ja v a 2 s.  c  o  m
    Sprite sprite = null;
    for (int i = 0; i < layout.length; ++i) {
        point = layout[i];

        sprite = ttt.atlas.createSprite("score_separator");
        sprite.setCenter(point.x, point.y);
        group.addActor(new SpriteActor("score_separator_" + i, sprite));
    }

    return group;
}

From source file:net.bplaced.therefactory.voraciousviper.model.Level.java

License:Open Source License

private static GridPoint2 getPoint(String word) {
    String[] point = word.replace("(", "").replace(")", "").split(",");
    return new GridPoint2(Integer.parseInt(point[0].trim()), Integer.parseInt(point[1].trim()));
}