-
Notifications
You must be signed in to change notification settings - Fork 0
Objects
James McNair edited this page Apr 2, 2019
·
1 revision
Objects are used in cases where all other methods have been exhausted. So the code required cannot be done in an Interactable. Reasons for using an object:
- Custom rending method
- Rotational support
All default objects are contained in the com.booksaw.corruption.object package.
- Create the class:
public class Foo extends GameObject - Edit all implementable methods.
- Create
toStringmethod to get the file output. - Make the constructor
Foo(String reference)where the reference is the line from which the object can be loaded from. - Make the constructor
Foo(Point p)or similar for creating new objects.
- In
ObjectListadd the object to the enum and alter all methods to include references to the new object. - In
LevelManagerfind the private methodpublic void makeObject(String ref)and modify with a custom reference for the object (should be the same as the reference intoString