-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__gmbaseobj.lua
More file actions
45 lines (40 loc) · 1.2 KB
/
__gmbaseobj.lua
File metadata and controls
45 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
gmbaseobj = Object:extend();
function gmbaseobj:new()
S = self;
S.sprite = GMSPRITES.lua;
S.x = 0;
S.y = 0;
-- drawing variables
S.sprite_width = S.sprite:getWidth();
S.sprite_height = S.sprite:getHeight();
S.sprite_alpha = 1;
S.x_scale = 1;
S.y_scale = 1;
S.orientation = 0;
S.x_offset = 0;
S.y_offset = 0;
S.x_shear = 0;
S.y_shear = 0;
gmbaseobj:create() -- Bump create event.
end
function gmbaseobj:create()-- The "Create Event"
-- Code in here gets only triggered on-creation
print("Hello! This is __gmbaseobj!")
end
function gmbaseobj:draw() -- The "Draw Event"
-- You probably shouldn't add stuff here. This only draws the self.sprite
love.graphics.draw( self.sprite,
self.x,
self.y,
self.orientation,
self.x_scale,
self.y_scale,
self.x_offset,
self.y_offset,
self.x_shear,
self.y_shear
);
end
function gmbaseobj:update(delta) -- The "Step Event"
-- This function gets called every game step.
end