Пример #1
0
 public void movePlayer(int direction, Player player, ZoneFactory zoneFactory)
 {
     if (direction == 0)
     {
         upFlag = true;
         player.moveUp(checkCollision(player.getMoveSpeed(), direction, player, zoneFactory.getCurrentZone()));
     }
     else if (direction == 1)
     {
         downFlag = true;
         player.moveDown(checkCollision(player.getMoveSpeed(), direction, player, zoneFactory.getCurrentZone()));
     }
     else if (direction == 2)
     {
         rightFlag = true;
         player.moveRight(checkCollision(player.getMoveSpeed(), direction, player, zoneFactory.getCurrentZone()));
     }
     else if (direction == 3)
     {
         leftFlag = true;
         player.moveLeft(checkCollision(player.getMoveSpeed(), direction, player, zoneFactory.getCurrentZone()));
     }
     updateDrawLocations(player, zoneFactory.getCurrentZone());
     transitionHandler.checkTransitions(player, zoneFactory);
 }
Пример #2
0
 public void checkTransitions(Player player, ZoneFactory zoneFactory)
 {
     int transNum = isTransition(player, zoneFactory.getCurrentZone());
     if (transNum != 0 && transNum != 1)
     {
         transitionZones(player, zoneFactory, zoneFactory.getCurrentZone().getZoneNumber(), transNum);
     }
 }
Пример #3
0
 public GameInit(ContentManager content)
 {
     player = new Player();
     contentHandler = new ContentHandler(content);
     paintHandler = new PaintHandler(this);
     inventoryPaintHandler = new InventoryPaintHandler(this);
     keyHandler = new KeyHandler(this);
     inventoryKeyHandler = new InventoryKeyHandler(this);
     chatPaintHandler = new ChatPaintHandler(this);
     chatKeyHandler = new ChatKeyHandler(this);
     gameState = new GameState();
     zoneFactory = new ZoneFactory();
 }
Пример #4
0
 // need to work on this stuff
 private void transitionZones(Player player, ZoneFactory zoneFactory, int zoneNumber, int transitionNumber)
 {
     Console.WriteLine("transitioning");
     Console.WriteLine(transitionNumber);
     switch (zoneNumber)
     {
         case -1:
             break;
         case -2:
             break;
         case -3:
             break;
         case -4:
             testTileZoneTransition(player, zoneFactory, transitionNumber);
             break;
         default:
             Console.WriteLine("default");
             break;
     }
     gameInit.getPaintHandler().updateZoneImages(gameInit.getContentHandler().getZoneContentHandler().getZoneImages()[zoneFactory.getCurrentZone().getZoneNumber()]);
     gameInit.getKeyHandler().getMovementHandler().updateDrawLocations(player, zoneFactory.getCurrentZone());
 }
Пример #5
0
 private void testTileZoneTransition(Player player, ZoneFactory zoneFactory, int transitionNumber)
 {
     Zone currentZone;
     switch (transitionNumber)
     {
         case 2:
             player.upOneLevel();
             break;
         case 3:
             player.downOneLevel();
             break;
         default:
             break;
     }
 }