Example usage for com.google.gwt.maeglin89273.game.mengine.physics Point Point

List of usage examples for com.google.gwt.maeglin89273.game.mengine.physics Point Point

Introduction

In this page you can find the example usage for com.google.gwt.maeglin89273.game.mengine.physics Point Point.

Prototype

public Point(double x, double y) 

Source Link

Usage

From source file:com.google.gwt.maeglin89273.game.ashinyballonthecross.client.tutorial.component.BlueMark.java

public BlueMark() {
    super(new Point(0, 0), 0, 100, 100);
    int offset = 3 * (200 + SpriteBlock.SPACING);
    this.spriteBlock = new SpriteBlock(offset, offset, 200, 200, ASBOTXConfigs.Utility.getButtonsSpriteSheet());
}

From source file:com.google.gwt.maeglin89273.game.ashinyballonthecross.client.tutorial.component.StepBoard.java

public StepBoard(Point leftTopCorner, double centerX) {
    super(leftTopCorner, 200, 420);
    this.titleLabel = new GameLabel(new Point(centerX, 30), TextAlign.CENTER, TextBaseline.MIDDLE, null,
            ASBOTXConfigs.Color.GRAY, ASBOTXConfigs.getCGFont(32));
    this.block = new SpriteBlock(0, 0, 200, 420,
            MEngine.getAssetManager().getSpriteSheet("images/tutorial_steps.png"));
}

From source file:com.google.gwt.maeglin89273.game.ashinyballonthecross.client.tutorial.component.TasksList.java

public TasksList(double centerX, double screenHeight) {
    super(new Point(centerX, 0), WIDTH, 0);
    this.screenHeight = screenHeight;
    block = new SpriteBlock(0, 0, 255, 0,
            MEngine.getAssetManager().getSpriteSheet("images/tutorial_tasks.png"));
}

From source file:com.google.gwt.maeglin89273.game.ashinyballonthecross.client.tutorial.component.TasksList.java

public void setup(int h, int blockY, int checkBoxesNum) {
    setEnabled(true);//from w w w .j a  v a 2 s . co m
    this.setHeight(h);
    this.setPositionAt(PositionType.NORTH, new Point(getX(), screenHeight - getHeight() - 10));
    block.setHeight(h);
    block.setY(blockY);
    boxes = new CheckBox[checkBoxesNum];
    double offsetY = getTopY() + 20;
    for (int i = 0; i < boxes.length; i++) {
        boxes[i] = new CheckBox(new Point(getLeftX() + BOX_X_OFFSET, offsetY + BOX_Y_SPACING * i));
    }
}

From source file:com.google.gwt.maeglin89273.game.ashinyballonthecross.client.tutorial.TutorialManager.java

public TutorialManager(JsonFile configs, double gameWidth, double gameHeight, int markNum,
        TaskHandler[] handlers) {// w  w w .  jav  a 2 s.  c  om
    this.detector = new TaskDetector(this);

    this.board = new StepBoard(new Point(10, 10), gameWidth / 2);

    this.taskCmpts = new StepComponent[2 + (markNum < 1 ? 1 : markNum)];
    this.taskCmpts[BUTTON_INDEX] = new NextStepButton(new Point(gameWidth - 130, gameHeight - 60), this);
    this.taskCmpts[LIST_INDEX] = new TasksList(gameWidth - 185, gameHeight);
    for (int i = 2; i < this.taskCmpts.length; i++) {
        this.taskCmpts[i] = new BlueMark();
    }

    this.parseSteps(configs, handlers);
}

From source file:com.google.gwt.maeglin89273.shared.test.volcanogame.component.FireBall.java

public FireBall(Spacial space, Point p, int radius) {
    super(new Point(p.getX(), p.getY() - radius), radius * 2, radius * 2);

    this.radius = radius;
    double h = 5 + Random.nextInt(21);
    double s = 80 + Random.nextInt(21);
    double l = 35 + Random.nextInt(16);
    ballColor = CssColor.make("hsl(" + h + "," + s + "%," + l + "%)");
    ballShadowColor = CssColor.make("hsl(" + h + "," + s + "%," + (l + 15) + "%)");
    this.space = space;

    aabb = new PixelAABB(this.position, width, height);

    BodyDef bodyDef = new BodyDef();
    CircleShape shape = new CircleShape();
    FixtureDef fixtureDef = new FixtureDef();
    Vec2 impulse = CoordinateConverter//from ww w.j  av a2 s  .c om
            .vectorPixelsToWorld(new Vector(-30 + 60 * Random.nextDouble(), -(175 + 50 * Random.nextDouble())));

    bodyDef.type = BodyType.DYNAMIC;
    bodyDef.position.set(CoordinateConverter.coordPixelsToWorld(position));

    body = space.getWorld().createBody(bodyDef);
    body.setLinearVelocity(impulse);
    body.applyLinearImpulse(impulse, body.getPosition());
    shape.m_radius = CoordinateConverter.scalerPixelsToWorld(radius);
    fixtureDef.shape = shape;
    fixtureDef.density = 4.3f;
    fixtureDef.restitution = 0.2f;
    fixtureDef.friction = 0.8f;
    body.createFixture(fixtureDef);

}

From source file:com.google.gwt.maeglin89273.shared.test.volcanogame.component.Volcano.java

public Point getLeftCraterPoint() {
    return new Point(position.getX() - CRATER_WIDTH / 2, getTopY());
}

From source file:com.google.gwt.maeglin89273.shared.test.volcanogame.component.Volcano.java

public Point getRightCraterPoint() {
    return new Point(position.getX() + CRATER_WIDTH / 2, getTopY());
}

From source file:com.google.gwt.maeglin89273.shared.test.volcanogame.component.VolcanoWorld.java

public VolcanoWorld(int width, int height) {
    super(new Point(0, 0), width, height);
    this.background = MEngine.getAssetManager().getSpriteSheet("volcano_background.png");
    this.clouds = MEngine.getAssetManager().getSpriteSheet("clouds.png");
    world = new World(new Vec2(0, -10f), true);
    volcano = new Volcano(this, new Point(250, 425));

}

From source file:com.google.gwt.maeglin89273.shared.test.volcanogame.component.VolcanoWorld.java

public void erupt() {
    add(new FireBall(this,
            new Point(volcano.getLeftCraterPoint().getX() + Random.nextInt(Volcano.CRATER_WIDTH + 1),
                    volcano.getTopY()),/*from   w ww. ja  va2s.co  m*/
            2 + Random.nextInt(5)));
}