Finished ParticleSystem and delta-animation support.
[luagame.git] / base / Line.lua
blobb1010779fb4c2bef8fe555f72aff4f4c32ffb57f
1 --the Line class
3 Line = Object:new()
5 Line.type = "Line"
6 Line.x1 = 0
7 Line.y1 = 0
8 Line.x2 = 0
9 Line.y2 = 0
10 Line.r = 0
11 Line.g = 0
12 Line.b = 0
13 Line.a = 255
15 function Line:new(o)
16 o = o or {}
17 setmetatable(o, self)
18 self.__index = self
19 return o
20 end
22 --updates the object's state
23 function Line:update(delta)
24 Object.update(self, delta)
25 end
27 --default draw routine
28 function Line:draw()
29 draw_line(self.x+self.x1,self.y+self.y1,self.x+self.x2,self.y+self.y2,self.r,self.g,self.b,self.a)
30 end
32 --there is no predefined collision behavior
33 -- "ids" is the list of Rect ids that have been collided with
34 -- "type" is the type of the Object that is colliding
35 function Line:collide(type, ids)
37 end