Package pl.edu.pw.elka.mmarkiew.model.entities

Examples of pl.edu.pw.elka.mmarkiew.model.entities.Entity


    else
    {
      // Create appropriate entity and possibly hide it behind destructive block
      if ( GameEntities.getEnumEntity("" + charAt) != GameEntities.UNDEFINED)
      {
        Entity e = EntityFactory.createEntity( GameEntities.getEnumEntity("" + charAt),
              (int) GameMap.getPositionCenterFromTile(i), (int) GameMap.getPositionCenterFromTile(j));
       
        // If it's enemy add it into map else if it's bonus add it into map and hide it
        if (e instanceof Enemy)
        {
View Full Code Here


   
    // If Player is like a ghost and plan into non EmptyBlock it stops expanding
    if (blocks.getBlock(xR, yR) instanceof BrickBlock)
    {
      blocks.setBlock(BlockFactory.createElement(GameBlock.EMPTY), xR, yR);
      Entity blen = EntityFactory.createEntity(GameEntities.DESTROYING_BRICK, xR, yR);
      map.addEnemy(blen);
      return;
    }
   
    /*
     * Makes cross of enemy explosion entities
     * Stops on non EmptyBlock
     */
    for (int i = 0; i < 4; ++i)
    {
      x = xR;
      y = yR;
     
      destroyedBrickAnimation:
      for (int j = 1; j <= b.getArea(); ++j)
      {
       
        /*
         * Way to 'recurse'
         */
        switch (i)
        {
          case 0: x = xR;    y = yR - j; break;
          case 1: x = xR;    y = yR + j; break;
          case 2: x = xR - j; y = yR;    break;
          case 3: x = xR + j; y = yR;    break;
        }
       
        if (blocks.getBlock(x, y) instanceof StoneBlock)
        {
          break;
        }
        else if (blocks.getBlock(x, y) instanceof BrickBlock)
        {
          Entity blen = EntityFactory.createEntity(GameEntities.DESTROYING_BRICK, x, y);
          blocks.setBlock(BlockFactory.createElement(GameBlock.EMPTY), x, y);
          map.addEnemy(blen);
          break;
        }
        else if (blocks.getBlock(x, y) instanceof EmptyBlock)
        {
          Entity blen = EntityFactory.createEntity(GameEntities.EXPLOSION, x, y);

          /*
           * Stops on brick which is dying
           */
          for (Entity e : map.getEntities())
View Full Code Here

TOP

Related Classes of pl.edu.pw.elka.mmarkiew.model.entities.Entity

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.