1 = Object Class Reference =
5 `---------------`--------------------
7 -------------------------------------
8 x x position (on screen)
9 y y position (on screen)
12 x_offset drawing offset
13 y_offset drawing offset
14 heading movement heading in degrees
15 speed speed (in pixels/update)
16 rotation current rotation of the object
17 angular_velocity angular velocity of the object
18 image image of the Object
19 rects list of collision Rects
20 type type of Object (for collision)
21 max_updates maximum number of updates before Object self-collects
22 num_updates current number of updates
23 no_collide flag for if Object should not be colliding
24 collect flag to indicate if an Object should be collected
25 -------------------------------------
29 `----------------------`--------------------
31 --------------------------------------------
33 update() updates the Object's state
34 draw() draws the Object's image at (x, y)
35 collide(ids, object) method executed upon collision (undefined for Object class)
36 get_center() returns the center coordinates of the Object
37 set_origin() sets the drawing offset (sprite is offset by these amounts to the upper left)
38 unload() unloads any resources used and sets class to nil (undefined for Object class)
39 --------------------------------------------
42 This class is not designed to be instantiated directly, instead it should be
43 extended and serve as the base for all in-game objects.
44 An example object definition is as follows:
47 source~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50 MyObj.attr2 = "some value"
55 setmetatable(o, self)
\r
60 --other methods defined here
61 source~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~