コード例 #1
0
  public static void init() {

    WorldShapes.init();
    ImageLibrary.init();

    worldOne = new World();

    // Setting up arbitrary testing entities
    for (int i = -10; i < 10; i++) {
      for (int j = -10; j < 10; j++) {
        Entity e = new Entity(i * 10, j * 10, 5, ImageLibrary.randomImage());
        e.getParticle()
            .setVelocityVector(
                new Complex(Calculation.rand(-0.1f, 0.1f), Calculation.rand(-0.1f, 0.1f)));
        e.getParticle().setAngularVelocity(Calculation.rand(-1, 1));
        e.getParticle().setAngularVelocity(Calculation.rand(-100, 100));
        worldOne.Entity_HashMap.put(Calculation.rand(0, 1000) + "", e);
      }
    }

    worldOne.Entity_HashMap.put("player", new Entity(12, 12, 12, ImageLibrary.get("smile")));
    mainCamera =
        new POV(
            worldOne.Entity_HashMap.get("player").getParticle().getPositionVector(),
            Display.getWidth(),
            Display.getHeight(),
            0,
            5,
            worldOne);
  }
コード例 #2
0
 public static void updateWorld(World w) {
   for (Entity x : w.Entity_HashMap.values()) {
     x.getParticle().update();
   }
 }