Help On Classes

I’ve never made a game in Lua but I’m working on it right now but I need help:
When I make a new class and add my code to it. It doesn’t work it just shows a black screen or lets say I draw a line in main but then I add a new class and add a sprite of a plane. When I start my code it only draws out a line but no airplane. How can I make it so it doesn’t only do the things on main but also classes?

Sounds like you need to read up on how classes work. It’s hard to say what you’re doing wrong without seeing anything.

This is a example:

-- Example

-- Use this function to perform your initial setup
function setup()
    print("Hello World!")

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(40, 40, 50)
    -- This sets the line thickness
    -- Do your drawing here 
--Class name:Photo
Photo= class()
function Photo:draw()
    sprite("Space Art:Green Ship",100,100,100,100)

@magicskillz - you need to learn about classes. Right now, you know absolutely nothing about them, so you can’t hope to use them in a program.

I’m not being unkind, just trying to save you a lot of wasted effort.

I’ve written about them here and here.

Or here:
Create this by the Photo class:
function Photo:init() end
Then do in Main connect the class:

-- In setup
Ph = Photo()
-- In draw