Package games.mapacman.common

Examples of games.mapacman.common.Dot


              if (currentItem =='_') currentItem='*';
              GhostBlock.add(new Point(xpos,ypos));         
            }
            else if (currentItem =='+')
            {  // is SuperDot
              Dot sdot = new Superdot(xpos,ypos,dot_score,superdot_score,superdot_prob,this);
              dots[xpos][ypos]= sdot;
              world.add(sdot.getRPObject());
            }
            else if (currentItem =='P')
            {  // is Powerpill
              Dot pill = new Powerpill(xpos,ypos,dot_score,powerpill_score,powerpill_prob,this);
              dots[xpos][ypos]= pill;
              world.add(pill.getRPObject());
            }
            else if (currentItem =='F')
            {  // is Fruit
              Dot fruit = new Fruit(xpos,ypos,dot_score,fruit_score,fruit_prob,this);
              dots[xpos][ypos]= fruit;
              world.add(fruit.getRPObject());
            }
           
           
            //check for Dot at last because other Items can have Dot below
            if (currentItem =='*')
            {  // is DOT
              Dot dot = new Dot(xpos,ypos,dot_score,this);
              dots[xpos][ypos]= dot;
              world.add(dot.getRPObject());
            }
            else
            // ZoneChange Point
              if (currentItem>=48 && currentItem<=57)
              {
View Full Code Here


 
 
  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

    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

    {
    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

TOP

Related Classes of games.mapacman.common.Dot

Copyright © 2018 www.massapicom. 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.