-
Notifications
You must be signed in to change notification settings - Fork 3
Developer help
maximusvladimir edited this page Jan 30, 2013
·
3 revisions
Anybody could add an entity. It is really simple:
- Insure that the entity images are added and the sizes are multiple of 50's.
- Create a class for "the Entity".
- Have "the Entity" inherit Entity.
- Overload the constructor.
- Overload the init() method. Place setWidth(submarine image width / 50); and setHeight(subamrine image height / 50); in the init() method.
- Register the newly made entity in the EntityManager. This is done by calling registerEntity(); once.
- Construct a new entity. This would be done like so: "new MyEntity(this,new Location(0,0),myEntityId);"
- You're done!
- Open NavalGame.java.
- Find when/where you wish to change the weather at.
- Type "getWorld().getWeather().setWeather(WeatherMode.);"
- Congrads! You just changed the weather!