HELP!!!!!!!!!

So I have 2 tabs my main and my Sig tab
My sig tab is this

Sig = class()

function Sig:init(x)
    -- you can accept and set parameters here
    self.x = x
    displayMode(FULLSCREEN)
    img = image(16, 16)
    img:set(1,16,254,254,254,1)
    img:set(2,5,177,177,177,78)
    img:set(2,6,159,159,159,96)
    img:set(2,7,145,145,145,110)
    img:set(2,8,143,143,143,112)
    img:set(2,9,145,145,145,110)
    img:set(2,10,159,159,159,96)
    img:set(2,11,177,177,177,78)
    img:set(3,4,175,175,175,80)
    img:set(3,5,153,153,153,102)
    img:set(3,6,0,0,0,255)
    img:set(3,7,0,0,0,255)
    img:set(3,8,0,0,0,255)
    img:set(3,9,0,0,0,255)
    img:set(3,10,0,0,0,255)
    img:set(3,11,153,153,153,102)
    img:set(3,12,175,175,175,80)
    img:set(4,3,175,175,175,80)
    img:set(4,4,154,154,154,101)
    img:set(4,5,0,0,0,255)
    img:set(4,8,0,0,0,255)
    img:set(4,11,0,0,0,255)
    img:set(4,12,154,154,154,101)
    img:set(4,13,175,175,175,80)
    img:set(5,2,177,177,177,78)
    img:set(5,3,153,153,153,102)
    img:set(5,4,0,0,0,255)
    img:set(5,7,0,0,0,255)
    img:set(5,8,0,0,0,255)
    img:set(5,9,0,0,0,255)
    img:set(5,12,0,0,0,255)
    img:set(5,13,153,153,153,102)
    img:set(5,14,178,178,178,77)
    img:set(6,2,159,159,159,96)
    img:set(6,3,0,0,0,255)
    img:set(6,8,0,0,0,255)
    img:set(6,13,0,0,0,255)
    img:set(6,14,159,159,159,96)
    img:set(7,2,145,145,145,110)
    img:set(7,3,0,0,0,255)
    img:set(7,5,0,0,0,255)
    img:set(7,11,0,0,0,255)
    img:set(7,13,0,0,0,255)
    img:set(7,14,146,146,146,109)
    img:set(8,2,143,143,143,112)
    img:set(8,3,0,0,0,255)
    img:set(8,4,0,0,0,255)
    img:set(8,5,0,0,0,255)
    img:set(8,6,0,0,0,255)
    img:set(8,8,255,0,0,255)
    img:set(8,10,0,0,0,255)
    img:set(8,11,0,0,0,255)
    img:set(8,12,0,0,0,255)
    img:set(8,13,0,0,0,255)
    img:set(8,14,144,144,144,111)
    img:set(9,2,145,145,145,110)
    img:set(9,3,0,0,0,255)
    img:set(9,5,0,0,0,255)
    img:set(9,11,0,0,0,255)
    img:set(9,13,0,0,0,255)
    img:set(9,14,146,146,146,109)
    img:set(10,2,159,159,159,96)
    img:set(10,3,0,0,0,255)
    img:set(10,8,0,0,0,255)
    img:set(10,13,0,0,0,255)
    img:set(10,14,159,159,159,96)
    img:set(11,2,177,177,177,78)
    img:set(11,3,153,153,153,102)
    img:set(11,4,0,0,0,255)
    img:set(11,7,0,0,0,255)
    img:set(11,8,0,0,0,255)
    img:set(11,9,0,0,0,255)
    img:set(11,12,0,0,0,255)
    img:set(11,13,153,153,153,102)
    img:set(11,14,178,178,178,77)
    img:set(12,3,175,175,175,80)
    img:set(12,4,154,154,154,101)
    img:set(12,5,0,0,0,255)
    img:set(12,8,0,0,0,255)
    img:set(12,11,0,0,0,255)
    img:set(12,12,154,154,154,101)
    img:set(12,13,175,175,175,80)
    img:set(13,4,175,175,175,80)
    img:set(13,5,153,153,153,102)
    img:set(13,6,0,0,0,255)
    img:set(13,7,0,0,0,255)
    img:set(13,8,0,0,0,255)
    img:set(13,9,0,0,0,255)
    img:set(13,10,0,0,0,255)
    img:set(13,11,153,153,153,102)
    img:set(13,12,175,175,175,80)
    img:set(14,5,159,159,159,96)
    img:set(14,6,159,159,159,96)
    img:set(14,7,146,146,146,109)
    img:set(14,8,144,144,144,111)
    img:set(14,9,146,146,146,109)
    img:set(14,10,159,159,159,96)
    img:set(14,11,178,178,178,77)
    startPos = {x=10, y=HEIGHT/2}

    tween(5, startPos, {x=WIDTH+50,y=HEIGHT/2},tween.easing.linear)

end 
   



function Sig:drawsig(d)
    -- Codea does not automatically call this method
    pushMatrix()
    pushStyle()
    background(0, 0, 0, 255)
 fill(127, 127, 127, 255) 
 ellipse(startPos.x,startPos.y,65)
fill(0, 0, 0, 255)
 fontSize(40)
text("PRESICION GAMING",WIDTH/2,HEIGHT/2)
  sprite(img, startPos.x+3, startPos.y+3,100)  
fill(0, 34, 255, 255)
if ElapsedTime>= 5 then
    text("PRECISION GAMING",WIDTH/2,HEIGHT/2)
    end
end
popStyle()
popMatrix()
function Sig:touched(touch)
    -- Codea does not automatically call this method
end

How would I make this work with the main class draw because if I put it in there right now it justs shows the biggining of it and not
The whole thing out

This is from @aciolino really cleans up the main.lua may make yourlife a lot easier. Otherwise your main file will be huge. I cant even find your Sig:drawsig() in the main draw.


--
-- Main.lua
-- 
-- Sample of Cofender's main()
function setup()

    displayMode(FULLSCREEN)
     -- define consts
    GAMESTATE_MENU = 1
    GAMESTATE_PLAYING = 2
    GAMESTATE_SHIPEXPLODE = 3
    GAMESTATE_LEVELCOMPLETE=5
    GAMESTATE_ENDED = 4
    GAMESTATE_SPLASH =6
    GAMESTATE_OPTIONS =7
    GAMESTATE_PAUSED = 8

    GAMESTATES = { ScreenTitle, ScreenGame, ScreenShipExplode, ScreenEnd, 
    ScreenLevelComplete, ScreenSplash, ScreenOptions , ScreenPaused }

    ScreenSplash:init()

    GAMESTATE = GAMESTATE_SPLASH 


end


-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(0, 0, 0, 255) 

    --state machine
    GAMESTATES[GAMESTATE]:draw()
end

function touched(touch)
    --state machine
    GAMESTATES[GAMESTATE]:touched(touch)      
end

--to send keys to proper screen for processing
function keyboard(key)
    GAMESTATES[GAMESTATE]:keyboard(key)      
end

My main is this

-- minez
supportedOrientations(LANDSCAPE_ANY)
displayMode(FULLSCREEN)
function setup()
    parameter.boolean("main",true)
    parameter.boolean("map",false)
    parameter.boolean("info",false)
    parameter.boolean("weapons",false)
    parameter.boolean("towns",false)
    parameter.boolean("items",false)
    parameter.boolean("armor",false)
    parameter.boolean("health",false)
    parameter.boolean("food",false)
    parameter.boolean("tools")
    parameter.boolean("achevements",false)
    parameter.boolean("mapzoom",false)
    parameter.boolean("developer",false)
    parameter.boolean("Minez",false)
    parameter.boolean("Wasted",false)
    parameter.boolean("Ghostcraft",false)
    parameter.boolean("LMS",false)
    parameter.boolean("Smash",false)
    parameter.boolean("wmap",false)
    parameter.boolean("witems",false)
    parameter.boolean("winfo",false)
    parameter.boolean("wlinks",false)
    parameter.boolean("wspawn",false)
    parameter.boolean("wguns",false)
    parameter.boolean("warmor",false)
    parameter.boolean("wshop",false)
    parameter.boolean("wexp",false)
    parameter.boolean("wachevement",false)
    parameter.boolean("",false)
    parameter.boolean("",false)
end
  dy=HEIGHT/2
  dx=WIDTH/2
  dxm=WIDTH/2
  dym=HEIGHT/2
  dyf=HEIGHT/2
  dxf=WIDTH/2


-- This function gets called once every frame
function draw()
   
        if CurrentTouch.tapCount==3 then
            close()
            end
         if ElapsedTime<=5 then

            else
        if main== true then
            background(0, 0, 0, 255)
            sprite("Documents:mineza",WIDTH/1/4,HEIGHT*3/4,WIDTH/2,HEIGHT/2)
            sprite("Documents:wasted",WIDTH*3/4,HEIGHT*3/4,WIDTH/2,HEIGHT/2)
            sprite("Documents:smash",WIDTH/1/4,HEIGHT/1/4,WIDTH/2,HEIGHT/2)
            else
                background(0, 0, 0, 255)
                end
            if main==true and 
            CurrentTouch.x<=WIDTH/2 and
            CurrentTouch.y>=HEIGHT/2 then 
            Minez=true wasted=false
            end
            if main==true and
            CurrentTouch.x>=WIDTH/2 and
            CurrentTouch.y>=HEIGHT/2 then
            Wasted=true
            end
            if main==true and
            CurrentTouch.x<=WIDTH/2 and
            CurrentTouch.y<=HEIGHT/2 then
            Smash=true
            end
            if main==true and
            CurrentTouch.x>=WIDTH/2 and
            CurrentTouch.y<=HEIGHT/2 then
            Ghostcraft=true
            end
    end
--minez--
            if Minez == true then
                main=false
        if items or info or armor or health or weapons or food or tools or map == true then
                background(252, 242, 5, 255)
            else
    sprite("Documents:MINEZ",WIDTH/2,HEIGHT/2)
   end 
    
    if CurrentTouch.x <= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then map=true 
       end
    if CurrentTouch.x >= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then map=false
       end
    if CurrentTouch.x <= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then info=false
       end
    if CurrentTouch.x >= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then info=true
       end
    if CurrentTouch.x >= WIDTH/5+WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then info=false
       end
    if CurrentTouch.x >= WIDTH/5+WIDTH/5 and CurrentTouch.x <= WIDTH/5 + WIDTH/5 + WIDTH/5 and
       CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then towns=true
       end
    if CurrentTouch.x <= WIDTH/5+WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
      CurrentTouch.tapCount==1 then towns=false
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then towns=false
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then items=true 
       end
    if CurrentTouch.x <= WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then items=false 
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5+ WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then items=false 
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then achevements=true 
       end
    if CurrentTouch.x <= WIDTH/5 + WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then achevements=false
       end
    if items or server or map or achevements or info or towns or minez == true then
        tools=false
        health=false
        food=false
        weapons=false
        armor=false
        end
    
    if map== true then Map()
       end
    if info== true then Info()
       end
    if server== true then Server()
       end
    if towns== true then Towns()
       end
    if items== true then Items()
       end
    if achevements== true then Achevements()
       end
    if weapons== true then Weapons()
       end
    if armor == true then Armor()
       end
    if health== true then Health()
       end
    if tools== true then Tools()
       end
    if food == true then Food()
       end
    if mapzoom== true then MapZoom()
       end
    
    strokeWidth(1)
    fill(244, 40, 35, 255)
      
    sprite("Documents:black",WIDTH/2,HEIGHT-10,WIDTH,20)
    noFill() rect(0,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5+WIDTH/5,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5+WIDTH/5+WIDTH/5,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5+WIDTH/5+WIDTH/5+WIDTH/5,HEIGHT-20,WIDTH/5,20)
    fill(244, 40,35, 255)
    text("Map",WIDTH*1/5*1/2,HEIGHT-8)
    text("info",WIDTH*2/5*3/4,HEIGHT-8)
    text("towns",WIDTH*3/5*5/6,HEIGHT-8)
    text("items",WIDTH*4/5*7/8,HEIGHT-8)
    text("Links",WIDTH*9/10,HEIGHT-8)
    if developer==true then Developer()
    end  
  end
--minez--
--wasted--
         if Wasted==true then
            main=false
            if witems or winfo or warmor or health or wguns or food or tools or wmap == true then
                background(252, 242, 5, 255)
            else
    sprite("Documents:MINEZ",WIDTH/2,HEIGHT/2)
   end 
    
    if CurrentTouch.x <= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then wmap=true 
       end
    if CurrentTouch.x >= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then wmap=false
       end
    if CurrentTouch.x <= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then winfo=false
       end
    if CurrentTouch.x >= WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then winfo=true
       end
    if CurrentTouch.x >= WIDTH/5+WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then winfo=false
       end
    if CurrentTouch.x >= WIDTH/5+WIDTH/5 and CurrentTouch.x <= WIDTH/5 + WIDTH/5 + WIDTH/5 and
       CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then wspawn=true
       end
    if CurrentTouch.x <= WIDTH/5+WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
      CurrentTouch.tapCount==1 then wspawn=false
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then wspawn=false
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then witems=true 
       end
    if CurrentTouch.x <= WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then witems=false 
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5+ WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then witems=false 
       end
    if CurrentTouch.x >= WIDTH/5 + WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then wachevements=true 
       end
    if CurrentTouch.x <= WIDTH/5 + WIDTH/5 + WIDTH/5 + WIDTH/5 and CurrentTouch.y>= HEIGHT-20 and 
       CurrentTouch.tapCount==1 then wachevements=false
       end
    if witems or wserver or wmap or wachevements or winfo or wspawn or minez == true then
        tools=false
        health=false
        food=false
        wguns=false
        warmor=false
        end
    
    if wmap== true then Wmap()
       end
    if winfo== true then Info()
       end
    if wserver== true then Server()
       end
    if wspawn== true then Towns()
       end
    if witems== true then Witems()
       end
    if wachevements== true then Achevements()
       end
    if wguns== true then Wguns()
       end
    if warmor == true then Armor()
       end
    if health== true then Health()
       end
    if tools== true then Tools()
       end
    if food == true then Food()
       end
    if mapzoom== true then MapZoom()
       end
           strokeWidth(1)
    fill(244, 40, 35, 255)
      
    sprite("Documents:black",WIDTH/2,HEIGHT-10,WIDTH,20)
    noFill() rect(0,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5+WIDTH/5,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5+WIDTH/5+WIDTH/5,HEIGHT-20,WIDTH/5,20)
    rect(WIDTH/5+WIDTH/5+WIDTH/5+WIDTH/5,HEIGHT-20,WIDTH/5,20)
    fill(244, 40,35, 255)
    text("Map",WIDTH*1/5*1/2,HEIGHT-8)
    text("info",WIDTH*2/5*3/4,HEIGHT-8)
    text("Spawn",WIDTH*3/5*5/6,HEIGHT-8)
    text("items",WIDTH*4/5*7/8,HEIGHT-8)
    text("Links",WIDTH*9/10,HEIGHT-8)
    end
          
end

Thx

But I need to keep it this way so where would I put sig:deawsig()

Ok I got that but it’s like it keeps resetting itself if you put it under draw
Any help

I’d start by taking all this stuff and making a class called ScreenGame. You have a lot of game code, in main, so it’s hard to read.

Then any function that does work, make a seperate class called Utils. Put those things there.

You have a lot of code in one place, it’s too hard to debug.