Skip to content

Equipment

Zachary-Ronayne edited this page Oct 20, 2020 · 2 revisions

Model

The generic Equipment model mostly keeps track of position and size for displaying and interacting on screen.

It stores position and size as lists. Do not directly access these fields, instead use the methods in the Controller, for example, x(), y(), width(), and height().

Controller

Mostly handles movement and positioning of the model. The majority of the functionality of Equipment will be implemented in sub classes of Equipment.

Update Function If you have an object equipment, you can override update to have some code run every frame. Remember to call super.update() so that any other functionality used by parent classes is also run. For example:

update(){
    super.update();
    // Code to update here
}