Game Developement

I have made a game engine but need ideas for the game.

-- terrain

-- Use this function to perform your initial setup
function setup()
    
    displayMode(FULLSCREEN)
    supportedOrientations(LANDSCAPE_ANY)
    
    blocks = {5,5,5,5,5,5,5,5, 5,5,5,5,3,3,3,5, 5,5,5,5,3,3,3,5, 5,5,5,5,3,3,3,5, 5,5,5,5,3,3,3,5, 5,5,5,5,3,3,3,5, 5,5,5,5,3,3,3,5,}
    --0=empty 1=brown 2=dirt 3=grass 4=plain 5=stone 6=wall 7=water 8=wood 
    
    tallBlocks = {4,4,4,4,4,4,4,4, 4,0,0,4,0,0,0,4, 4,0,0,4,0,0,0,4, 4,0,0,4,0,0,0,4, 4,0,0,4,0,0,0,4, 4,0,0,0,0,0,0,4, 4,0,0,0,0,0,0,4,}
    --0=empty 1=stone 2=doorClosed 3=doorOpen 4=wall 5=window
    
    --objectBlocks = {[15] = 3, [14] = 2}
    objectBlocks = {0,0,0,0,0,0,0,0, 0,0,0,0,0,2,3,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,3,0,0}
    --0=empty 1=rock 2=smallTree 3=tallTree 4=uglyTree
    
    interactiveBlocks = {[11] = 1, [10] = 5, [13] = 4}
    --interactiveBlocks[11] = 1
    --0=empty 1=blueGem 2=greenGem 3=orangeGem 4=key 5=chestClosed 6=chestOpen
    
    player = {[23] = 1}
    -- 0=notThere 1=there 
    x = 100
    y = 400
    spsq = 23
    t = 0
    posChange = 0
    time = 0
    uPressed = 0
    dPressed = 0
    lPressed = 0
    rPressed = 0
end

-- This function gets called once every frame
function draw()
    -- This sets a dark background color 
    background(0, 0, 0, 255)
    spriteMode(CORNER)
    x = 10
    y = HEIGHT - 220
    n = 1
    if dPressed == 1 then
        tint(96, 96, 96, 255)
    end
    sprite("Cargo Bot:Command Grab", WIDTH - 125, 100, 50, 54) --down button
    noTint()
    
    rotate(180)
    spriteMode(CENTER)
    if uPressed == 1 then
        tint(96, 96, 96, 255)
    end
    sprite("Cargo Bot:Command Grab", 0 - (WIDTH - 100), 0 - 225)--up button
    noTint()
    rotate(180)
    
    rotate(270)
    spriteMode(CORNER)
    if lPressed == 1 then
        tint(96, 96, 96, 255)
    end
    sprite("Cargo Bot:Command Grab",0 - 200, WIDTH - 175) --left button   
    noTint()
    rotate(90)
    
    rotate(90)
    if rPressed == 1 then
        tint(96, 96, 96, 255)
    end
    sprite("Cargo Bot:Command Grab", 150, 0 - (WIDTH - 25)) --right button
    noTint()
    rotate(270)
    
    
    for i = 1, #blocks do
        
        
        if blocks[i] == 0 then --draws the ground:
        
        elseif blocks[i] == 1 then
            sprite("Planet Cute:Brown Block", x, y)
        elseif blocks[i] == 2 then
            sprite("Planet Cute:Dirt Block", x, y)
        elseif blocks[i] == 3 then
            sprite("Planet Cute:Grass Block", x, y)
        elseif blocks[i] == 4 then
            sprite("Planet Cute:Plain Block", x, y)
        elseif blocks[i] == 5 then
            sprite("Planet Cute:Stone Block", x, y)
        elseif blocks[i] == 6 then
            sprite("Planet Cute:Wall Block", x, y)
        elseif blocks[i] == 7 then
            sprite("Planet Cute:Water Block", x, y)
        elseif blocks[i] == 8 then
            sprite("Planet Cute:Wood Block", x, y)
        end
        
        
        y = y + 40
        if tallBlocks [i] == 0 then --draws walls:
                
        elseif tallBlocks [i] == 1 then
            sprite("Planet Cute:Stone Block Tall",x ,y)
        elseif tallBlocks [i] == 2 then
            sprite("Planet Cute:Door Tall Closed",x ,y)
        elseif tallBlocks [i] == 3 then
            sprite("Planet Cute:Door Tall Open",x ,y)
        elseif tallBlocks [i] == 4 then
            sprite("Planet Cute:Wall Block Tall",x ,y)
        elseif tallBlocks [i] == 5 then
            sprite("Planet Cute:Window Tall",x ,y)           
        end
           
        if objectBlocks [i] == 0 then
            
        elseif objectBlocks [i] == 1 then --draws non-interactive objects:
            sprite("Planet Cute:Rock", x, y)
        elseif objectBlocks [i] == 2 then
            sprite("Planet Cute:Tree Short", x, y)   
        elseif objectBlocks [i] == 3 then
            sprite("Planet Cute:Tree Tall", x, y)
        elseif objectBlocks [i] == 4 then
            sprite("Planet Cute:Tree Ugly", x, y)           
        end
         
        if interactiveBlocks [i] == 0 then --draws interactive objects
            
        elseif interactiveBlocks [i] == 1 then
            sprite("Planet Cute:Gem Blue", x, y)
        elseif interactiveBlocks [i] == 2 then
            sprite("Planet Cute:Gem Green", x, y)
        elseif interactiveBlocks [i] == 3 then
            sprite("Planet Cute:Gem Orange", x, y)
        elseif interactiveBlocks [i] == 4 then
            sprite("Planet Cute:Key", x, y)
        elseif interactiveBlocks [i] == 5 then
            sprite("Planet Cute:Chest Closed", x, y)
        elseif interactiveBlocks [i] == 6 then
            sprite("Planet Cute:Chest Open", x, y)
        end   
        
        if player [i] == 1 then           
            sprite("Planet Cute:Character Boy", x, y)
            spx = x
            spy = y           
        end            
        y = y - 40                                                                   
        
        x = x + 101
        
        if n > 7 then
            y = y - 83
            x = 10
            n = 0
        end    
        n = n + 1  
    end
    
    if CurrentTouch.state == BEGAN then --tells which button has been pressed
        time = time + 1
        if time > 2 then
            if WIDTH - 125 < CurrentTouch.x then --has the down button been pressed?
                if CurrentTouch.x < WIDTH - 75 then
                    if CurrentTouch.y < 154 then
                        if CurrentTouch.y > 100 then
                            dPressed = 1
                            if tallBlocks[spsq + 8] == 0 then --is there anything in the way?
                                if objectBlocks[spsq + 8] == 0 then
                                    player[spsq] = 0 -- move down
                                    spsq = spsq + 8
                                    if spsq > 56 then
                                        spsq = spsq - 56
                                    end
                                    player[spsq] = 1
                                    posChange = 1
                                    time = -2
                                    
                                end
                            end
                        end
                    end
                end
            end
                        
            if WIDTH - 125 < CurrentTouch.x then --has the up button been pressed?
                if CurrentTouch.x < WIDTH - 75 then
                    if CurrentTouch.y < 254 then
                        if CurrentTouch.y > 200 then
                            uPressed = 1
                            if tallBlocks[spsq - 8] == 0 then --is there anything in the way?
                                if objectBlocks[spsq - 8] == 0 then
                                    player[spsq] = 0 -- move up
                                    spsq = spsq - 8
                                    if spsq < 1 then
                                        spsq = spsq + 56
                                    end
                                    player[spsq] = 1
                                    posChange = 1
                                    time = -2
                                end
                            end
                        end
                    end
                end
            end
                        
            if WIDTH - 175 < CurrentTouch.x then --has the left button been pressed?
                if CurrentTouch.x < WIDTH - 125 then
                    if CurrentTouch.y < 204 then
                        if CurrentTouch.y > 154 then
                            lPressed = 1
                            if tallBlocks[spsq - 1] == 0 then --is there anything in the way?
                                if objectBlocks[spsq - 1] == 0 then
                                    player[spsq] = 0 -- move left
                                    spsq = spsq - 1
                                    if spsq < 1 then
                                        spsq = spsq + 56
                                    end
                                    player[spsq] = 1
                                    posChange = 1
                                    time = -2
                                end
                            end
                        end
                    end
                end
            end
                        
            if WIDTH - 75 < CurrentTouch.x then --has the right button been pressed?
                if CurrentTouch.x < WIDTH - 24 then
                    if CurrentTouch.y < 204 then
                        if CurrentTouch.y > 154 then
                            rPressed = 1
                            if tallBlocks[spsq + 1] == 0 then --is there something in the way
                                if objectBlocks[spsq + 1] == 0 then
                                    player[spsq] = 0 -- move right
                                    spsq = spsq + 1
                                    if spsq > 56 then
                                        spsq = spsq - 56
                                    end
                                    player[spsq] = 1
                                    posChange = 1
                                    time = -2
                                end
                            end
                        end
                    end
                end
            end        
        end
    end  
    if CurrentTouch.state == ENDED then
        dPressed = 0
        uPressed = 0 
        lPressed = 0
        rPressed = 0
    end
end

Thats an odd way of doing it, usually I’d get the idea together then make the engine… As you want the engine to be unique to what you’re doing otherwise somethings may run slow as they aren’t optimised, this probably isn’t a problem for you at the moment though. I’d put your touch statements in the touched(touch) function, that way you don’t have CurrentTouch lingering behind when you lift your finger.

Ok I will try that

@Coder - I suggest you probably need to do a lot of testing before your engine is complete. I would start with some very simple levels and see how well they work.