Draw func in class
I'm having an issue with making a class with a draw function.
Here's the class definition
Rectangle = class
constructor = function(x, y, w, h)
this.x = x
this.y = y
this.w = w
this.h = h
end
draw = function()
screen.drawRect(this.x, this.y, this.width, this.height, "rgb(255,255,255)")
end
end
and here's the declaration
player = new Rectangle(0, 50, 20, 20)
and here is the call
player.draw()
but the square just doesn't draw. It's really confusing...