Examples of Dot


Examples of games.mapacman.common.Dot

 
 
  public Dot eatDot(int x, int y) {
    if (dots[x][y]!= null)
    {
      Dot res = dots[x][y];
      dots[x][y] = null;
      return res;
    }
    return null;
View Full Code Here

Examples of games.mapacman.common.Dot

    int newY = object.getInt("y")+y;
   
    // if no movement or no collision
    if ( (x==0 && y==0) || collisionType == consts.COLLISION_NONE || collisionType == consts.COLLISION_GHOSTBLOCK)
    {   
      Dot dot;
      if ((dot=eatDot(newX,newY))!=null)
      {
        dot.eaten(object);
        dot.addStats(world.getStats());
        object.put("score",object.getInt("score")+dot.getScore());
        dot.setRespawnTime();
        respawnDots.add(dot);
        world.modify(dot.getRPObject());
      }
      else
      {
        for (ZoneChangePoint zonechange : zoneChangePoints)
        {
          if (zonechange.isPlacedAt(newX,newY))
          { // add to change Zone atfer turn
            zoneChangeNotes.add(new zoneChangeNote(object,zonechange));
          }
        }
      }
      object.put("x",newX);
      object.put("y",newY);
    }
    else
   
      switch (collisionType)
      {
      case consts.COLLISION_WALL :
      case consts.COLLISION_PLAYER : object.put("dir",consts.DIR_NONE);break;
      case consts.COLLISION_GHOST :  
        if (object.getInt("power")>0)
        { // Player is in Powermode
          object.put("x",newX);
          object.put("y",newY);
          killGhostAt(newX,newY);
          Dot dot;
          if ((dot=eatDot(newX,newY))!=null)
          {
            dot.eaten(object);
            dot.addStats(world.getStats());
            object.put("score",object.getInt("score")+dot.getScore());
            dot.setRespawnTime();
            respawnDots.add(dot);
            world.modify(dot.getRPObject());
          }
        }
        else
        {
          object.put("x",newX);
View Full Code Here

Examples of games.mapacman.common.Dot

    {
    int x = object.getInt("x");
    int y = object.getInt("y");
    if (object.get("type").equals(consts.TYPE_DOT))
    {
      dots[x][y]= new Dot(object);
    }
    else if (object.get("type").equals(consts.TYPE_SUPERDOT))
    {
      dots[x][y]= new Superdot(object);
    }
View Full Code Here

Examples of jofc2.model.elements.LineChart.Dot

    List<Dot> values = new ArrayList<Dot>();
    for (Iterator itCategories = model.getCategories().iterator(); itCategories
        .hasNext();) {
      Comparable category = (Comparable) itCategories.next();
      Number value = model.getValue(serie, category);
      Dot d = new Dot(value);
      d.setDotSize(1);
      values.add(d);
    }
    e.addDots(values);
    return e;
  }
View Full Code Here

Examples of net.sf.arianne.marboard.client.entity.shape.Dot

    String rpclass = rpobject.getRPClass().getName();

    if (rpclass.equals("user")) {
      return new User(rpobject);
    } else if (rpclass.equals("dot")) {
      return new Dot(rpobject);
    } else if (rpclass.equals("rectangle")) {
      return new Rectangle(rpobject);
    } else if (rpclass.equals("straight_line")) {
      return new StraightLine(rpobject);
    } else if (rpclass.equals("oval")) {
View Full Code Here

Examples of net.sf.arianne.marboard.server.entity.shape.Dot

    String rpclass = object.getRPClass().getName();

    if (rpclass.equals("user")) {
      return new User(object);
    } else if (rpclass.equals("dot")) {
      return new Dot(object);
    } else if (rpclass.equals("rectangle")) {
      return new Rectangle(object);
    } else if (rpclass.equals("straight_line")) {
      return new StraightLine(object);
    } else if (rpclass.equals("circle")) {
View Full Code Here

Examples of net.sf.arianne.marboard.server.entity.shape.Dot

    MarboardZone zone = new MarboardZone("initial_zone");
    super.addRPZone(zone);

    for (int i = 0; i < 20; i++) {
      Shape shape = new Dot(Color.BLACK.getRGB(), i, i * 25 + 25, i * 25 + 25, i);
      zone.add(shape);
    }

    Shape shape = new Dot(Color.RED.getRGB(), 10, 50, 25, 30);
    zone.add(shape);
  }
View Full Code Here

Examples of net.sf.arianne.marboard.server.entity.shape.Dot

   * @param action the action to be executed
   */
  @Override
  protected void perform(User user, RPAction action) {
    MarboardZone zone = user.getZone();
    Shape shape = new Dot(action.getInt("color"), action.getInt("thickness"), action.getInt("x"), action.getInt("y"));
    zone.add(shape);
  }
View Full Code Here

Examples of net.sf.arianne.marboard.server.entity.shape.Dot

  @Test
  public void testFixZIndexForShape() {
    MarboardZone zone = new MarboardZone("testFixZIndexForShape");
    MarboardWorld.get().addRPZone(zone);

    Shape shape = new Dot(0, 0, 0, 0);
    assertFalse(shape.has("z"));

    zone.add(shape);
    assertThat(shape.get("z"), equalTo("1"));

    shape = new Dot(2, 2, 2, 2, 20);
    assertTrue(shape.has("z"));

    zone.add(shape);
    assertThat(shape.get("z"), equalTo("20"));

    shape = new Dot(3, 3, 3, 3);
    assertFalse(shape.has("z"));

    zone.add(shape);
    assertThat(shape.get("z"), equalTo("21"));
   
  }
View Full Code Here

Examples of net.sf.arianne.marboard.server.entity.shape.Dot

  @Test
  public void testFixAllZIndicesForAllOtherShapesAbove() {
    MarboardZone zone = new MarboardZone("testFixAllZIndicesForAllOtherShapesAbove");
    MarboardWorld.get().addRPZone(zone);

    zone.add(new Dot(1, 1, 1, 1, 1));
    zone.add(new Dot(2, 2, 2, 2, 2));
    zone.add(new Dot(4, 4, 4, 4, 3));
    zone.add(new Dot(5, 5, 5, 5, 4));
    zone.add(new Dot(6, 6, 6, 6, 5));

    zone.add(new User("testuser"));
   
    zone.fixAllZIndicesForAllOtherShapesAbove(3, new Dot(3, 3, 3, 3, 3));

    for (RPObject object : zone) {
      assertEquals(object.get("x"), object.get("z"));
    }

    Shape shape = new Dot(7, 7, 7, 7);
    zone.add(shape);
    assertThat(shape.get("z"), equalTo("7"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.