Package org.seattlegamer.spacegame.messages

Examples of org.seattlegamer.spacegame.messages.ComponentAddition


        random.nextInt(this.displayMode.getWidth()),
        random.nextInt(this.displayMode.getHeight()));

    Image player = this.resourceCache.getImage("replaceme_hardcoded_planet");

    this.bus.broadcast(new ComponentAddition(new Sprite(bus, playerEntityId, player)));
    this.bus.broadcast(new ComponentAddition(new Physics(bus, playerEntityId, position, 0, player.getWidth(null), player.getHeight(null))));
    this.bus.broadcast(new ComponentAddition(new ProjectileLauncher(bus, playerEntityId, this.resourceCache)));
    this.bus.broadcast(new ComponentAddition(new HeadsUpDisplay(bus, hudEntityId, playerEntityId, playerNumber)));
   
    //TODO: hack for testing. input will be assigned turn-based.
    if(playerNumber == 1) {
      this.bus.broadcast(new ComponentAddition(new PlayerInput(bus, playerEntityId)));
    }

    bus.send(new PlayerStatsReport(playerEntityId, name, STARTING_HEALTH), hudEntityId);

  }
View Full Code Here


    int projectileWidth = projectileImage.getWidth(null);
    int projectileHeight = projectileImage.getHeight(null);
   
    UUID projectileId = UUID.randomUUID();
   
    this.bus.broadcast(new ComponentAddition(new Sprite(this.bus, projectileId, projectileImage)));
   
    Physics physics = new Physics(this.bus, projectileId);
    this.bus.send(new PhysicsCloning(this.getEntityId(), physics), this.getEntityId());
   
    physics.setWidth(projectileWidth);
    physics.setHeight(projectileHeight);
   
    this.bus.broadcast(new ComponentAddition(physics));

    this.bus.send(new SpeedChange(0.4), projectileId);
   
    //TODO: weapon type will determine launch speed and launch image
View Full Code Here

  }
 
  private void loadStarField() {
    StarField starField = new StarField(this.bus, UUID.randomUUID(), this.displayMode);
    this.bus.broadcast(new ComponentAddition(starField));
  }
View Full Code Here

          random.nextInt(this.displayMode.getWidth()),
          random.nextInt(this.displayMode.getHeight()));
     
      UUID explosionEntityId = UUID.randomUUID();
      Image explosionImage = resourceCache.getImage("assets/explosion.png");
      this.bus.broadcast(new ComponentAddition(new Animation(bus, explosionEntityId, explosionImage, position)));
     
    }
   
    this.bus.broadcast(new AnimationStart());
   
View Full Code Here

      .addMenuEntry("New Game", this.getHardcodedNewGameMenuAction())
      .addMenuEntry("Exit", this.getExitGameMenuAction())
      .build(this.menuEntityId);
   
    for(Component component : menuComponents) {
      this.bus.broadcast(new ComponentAddition(component));
    }
 
    bus.send(new MenuSelectionChanged(0), this.menuEntityId);
   
  }
View Full Code Here

TOP

Related Classes of org.seattlegamer.spacegame.messages.ComponentAddition

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.