Help with Classic library
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Help with Classic library
Hello, hoping someone can advise me what I'm doing wrong. I am using Classic from RXI as a library to use an object oriented structure to my project. I am clearly not understanding something fundamental. I have created two boxes but only one is being drawn....is there no way to draw all the boxes with one command as i am attempting here.
Re: Help with Classic library
Hello, welcome to the forums.
First, if you check the docs: https://github.com/rxi/classic you'll see that the syntax for creating an object is not to call the new() method: you should call the class instead. In your case:
Second, you should be calling the update() and draw() method of each object, not of the class:
That will probably suffice, haven't tested it. Anyway there are a few more minor additional problems.
First, if you check the docs: https://github.com/rxi/classic you'll see that the syntax for creating an object is not to call the new() method: you should call the class instead. In your case:
Code: Select all
player = Player()
box1 = Terrain(500, 550, 100, 50)
floor = Terrain(0, 575, 800, 25)
Code: Select all
function love.update(dt)
player:update(dt)
box1:update(dt)
floor:update(dt)
end
function love.draw()
player:draw()
box1:draw()
floor:draw()
end
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 8 guests