Skip to content
maximusvladimir edited this page Jan 30, 2013 · 3 revisions

This is designed to be a utility to help developers.


Creating an entity and adding it to the grid.

Anybody could add an entity. It is really simple:

  1. Insure that the entity images are added and the sizes are multiple of 50's.
  2. Create a class for "the Entity".
  3. Have "the Entity" inherit Entity.
  4. Overload the constructor.
  5. Overload the init() method. Place setWidth(submarine image width / 50); and setHeight(subamrine image height / 50); in the init() method.
  6. Register the newly made entity in the EntityManager. This is done by calling registerEntity(); once.
  7. Construct a new entity. This would be done like so: "new MyEntity(this,new Location(0,0),myEntityId);"
  8. You're done!

Changing the weather

  1. Open NavalGame.java.
  2. Find when/where you wish to change the weather at.
  3. Type "getWorld().getWeather().setWeather(WeatherMode.);"
  4. Congrads! You just changed the weather!

Clone this wiki locally