Bomber

Hey guys, here’s the code to my submission “Bomber”. I’ve never posted code before so if it doesn’t come out right perhaps some could edit it for me so it displays correctly?
This is my first project - I only started coding since I downloaded the Codea app a few weeks back. so it’s not terribly advanced but a big personal achievement. I’ve not used any classes as I don’t have a clue what to do with them, so I’d be interested in feedback on how I could have coded this in a simpler way (I’ve used a lot of if… type loops).

    supportedOrientations(LANDSCAPE_ANY)
-- Use this function to perform your initial setup
function setup()
    displayMode(FULLSCREEN)
    gamestatus = false
    planealive = true
    gamewon = false
    gamelost = false
    posx=0
    posy=HEIGHT-30
    level=1
    difflevel=level*30
    buildingx = 0
    t=0
    bombready = false
    z=0
    buildings = {}
    bombs = {}
    buildingheights = false    
end
-- This function gets called once every frame
function draw()    
    ii = IconImages()
    Bomber = ii:getBomber() 
    Flame = ii:getFlame()
-- start screen - a touch on the screen takes you to the main game
function splashscreen()     
    background(35, 34, 34, 255)
    font("Courier")
    fill(250, 250, 250, 255)
    fontSize(50)
    text("B  O  M  B  E  R",WIDTH/2, ((HEIGHT/2)+100))
    fontSize(20)
    textWrapWidth(WIDTH-70)
    text("Your Mission: To flatten the opposing force's buildings in the shortest time possible. You're losing height all the time, so make sure you don't crash into the buildings! It takes time to load bombs into the dropping position, and this takes longer for each level. Touch the screen to drop a bomb.",WIDTH/2, ((HEIGHT/2)-60))
    fontSize(15)
        text("T O U C H   T H E   S C R E E N   T O    C O N T I N U E ",WIDTH/2, 100)
    if CurrentTouch.x>0 and CurrentTouch.x<WIDTH then 
    gamestatus=true
    end   
end  
      if gamestatus==false then
        splashscreen()
        else if gamestatus == true and gamewon == false then
        if buildingheights == false then
        --generate random heights for the buildings - drawn later.  
            for i=1,12 do
            h=math.random((2*level),15)
            buildings[i] = h*35
            end
            for i,k in ipairs(buildings) do
            print (buildings[i])
            end
        end
        buildingheights = true 
        font("HelveticaNeue-Bold")
        gamestart()       
        end
        end    
--main game programming
    function gamestart()  
    background(131, 122, 202, 255)  
    fill(217, 214, 200, 255)
    noStroke()
    rect(0,0,WIDTH, 50)
    fill(0,0,0,255)
    fontSize(15)
    textAlign(LEFT)
    text("Height: "..posy.." ft",350, 20)
    
    -- count number of buildings - used to work out when the game is won
    bnum=12
    for i,v in pairs(buildings) do
        if buildings[i]==0 then
            bnum = bnum - 1
            end
            end
    textAlign(RIGHT)
    text("Buildings remaining: "..bnum,WIDTH-100, 20)
    text("Level: "..level,((WIDTH/2)+100),20)
-- draw buildings using randomly generated heights calculated earlier
fill(102, 95, 95, 255) 
strokeWidth(5)
stroke(0, 0, 0, 255)
    for i,k in ipairs(buildings) do
       rect(buildingx, 50,WIDTH/12, buildings[i])
        buildingx = buildingx + (WIDTH/12)   
        --end  
        end 
     buildingx = 0
    -- draw windows on buildings
        windowColour=255
        noStroke()
        pushMatrix()
        winx=((WIDTH/12)/7)
        winy=60
        for i,k in ipairs(buildings) do
            -- work out how many rows of windows from the building height
            bht=math.floor(buildings[i]/30)
        for i=1,bht do
        fill(windowColour, windowColour, 124, 255)
            for i=1,3 do
            rect(winx,winy,((WIDTH/12)/7),10)
            winx = winx + (2*((WIDTH/12)/7))
            end
            -- add gradient to window colour, getting bluer towards the top of the building
            windowColour = windowColour - 8  
        winx=((WIDTH/12)/7)
        winy = winy + 30
        end
        windowColour=255
        translate(WIDTH/12,0)
        winy=60
        end
        popMatrix()       
-- move plane
if planealive == true and gamewon == false  and gamelost == false then  

    if bombready == true then
        else if bombready == false then
            noTint()
            end
            end
    sprite(Bomber, posx, posy, 60, 60)
-- draw flame but add a slight randomisation of position to give moving flame effect
sprite(Flame, posx-(60+(math.random(1,5)))  , ((posy-3)+math.random(1,6)), 60, 60)
posx = posx + (5+level)
if posx > WIDTH then
    posx=0
    posy = posy - difflevel
    end
end
-- drop bomb if screen is touched and the bomb counter shows its ready (ie dont drop loads!)
if CurrentTouch.state==BEGAN and 
    bombready == true
    and planealive == true
    and CurrentTouch.y <= HEIGHT then
    bombready=false
    t=0
    c=posx
    d=posy
    table.insert(bombs, vec2(c,d))
    sound(SOUND_SHOOT, 32257)
    end
    
    -- bomb timer (120 is approx 2 secs)
    if bombready==false and t> (30*level)then
        bombready = true
        else 
        t = t + 1
        end
         -- show bomb is ready at base of screen
    if planealive== true and bombready==true then
        fill(248, 2, 2, 255)
        textAlign(CENTER)
        fontSize(20)
        font("HelveticaNeue-Bold")
        text("B O M B  R E A D Y",posx, posy+20)
        end  
    
    -- draw bombs - uses a table and iterates each screen frame
    for i,v in pairs(bombs) do
        bombs[i]=vec2(v.x,v.y)
        v.y = v.y - 10
        bombs[i]=vec2(v.x,v.y)
        sprite("Tyrian Remastered:Missile Big", v.x, v.y)
        if bombs[i].y < 60 then 
            table.remove(bombs, i)
            end
    end
    -- remove building if bombed and remove bomb
        for i,v in pairs(buildings) do
            for j,k in pairs(bombs) do
            if bombs[j].x > ((i-1)*(WIDTH/12))
            and bombs[j].x < (i*(WIDTH/12))
            and bombs[j].y < buildings[i]
            then
                sound(SOUND_EXPLODE, 1666)
                explosion(bombs[j].x, bombs[j].y)
            buildings[i]=0
            table.remove(bombs, j)
            end
            end
            end
-- check if plane has crashed         
        for i,v in pairs(buildings) do
            if posx > ((i-1)*(WIDTH/12))
            and posx < (i*(WIDTH/12))
            and posy <= (buildings[i]+50)
            then
            explosion(posx, posy)
            gamelost = true
            end
            end     
if gamelost == true then
    planealive = false
    fill(233, 42, 43, 194)
    rect(0,50,WIDTH,HEIGHT)
    fill(255)
    fontSize(40)
    text("YOU'VE CRASHED....", WIDTH/2, HEIGHT/2 )
    end            
-- check for a win ! :)
    if bnum==0 then
    planealive = false
    fill(85, 209, 54, 255)
    rect(0,50,WIDTH,HEIGHT)
    fill(255)
    fontSize(50)
    text("YOU'VE WON !!!", WIDTH/2, HEIGHT/2 )
    fontSize(40)
    text("Ready for level "..(level+1).." ?", WIDTH/2, ((HEIGHT/2)-60) )
    fontSize(30)
    text("Touch the screen to continue", WIDTH/2, ((HEIGHT/2)-120) )
    
    if CurrentTouch.x > 0 and CurrentTouch.x < WIDTH and CurrentTouch.state == BEGAN then
    buildingheights = false
    gamewon = false
    planealive = true
    posx=0
    posy=HEIGHT-30
    level = level + 1
    end  
end
    
-- explosion function - needs more work so the explosion stays on the screen longer
       
function explosion(expx,expy)
   sprite("Tyrian Remastered:Explosion Huge", expx, expy)
end
end                         
end

Here’s the data for the custom sprites - I located them in the Main tab under the code posted above.

IconImages = class()

function IconImages:getBomber()
local img = image(30, 30)
img:set(1,11,0,0,0,255)
img:set(1,12,0,0,0,255)
img:set(1,13,0,0,0,255)
img:set(2,10,0,0,0,255)
img:set(2,11,0,0,0,255)
img:set(2,12,0,0,0,255)
img:set(2,13,0,0,-3,255)
img:set(2,14,0,0,0,255)
img:set(2,15,0,0,0,255)
img:set(2,16,0,0,0,255)
img:set(2,17,0,0,0,255)
img:set(2,18,0,0,0,255)
img:set(2,19,0,0,0,255)
img:set(3,10,0,0,0,255)
img:set(3,11,127,127,127,255)
img:set(3,12,127,127,127,255)
img:set(3,13,127,127,127,255)
img:set(3,14,127,127,127,255)
img:set(3,15,127,127,127,255)
img:set(3,16,127,127,127,255)
img:set(3,17,127,127,127,255)
img:set(3,18,127,127,127,255)
img:set(3,19,0,0,0,255)
img:set(4,10,0,0,0,255)
img:set(4,11,127,127,127,255)
img:set(4,12,127,127,127,255)
img:set(4,13,127,127,127,255)
img:set(4,14,127,127,127,255)
img:set(4,15,127,127,127,255)
img:set(4,16,127,127,127,255)
img:set(4,17,127,127,127,255)
img:set(4,18,0,0,0,255)
img:set(5,10,0,0,0,255)
img:set(5,11,127,127,127,255)
img:set(5,12,127,127,127,255)
img:set(5,13,127,127,127,255)
img:set(5,14,127,127,127,255)
img:set(5,15,127,127,127,255)
img:set(5,16,127,127,127,255)
img:set(5,17,0,0,0,255)
img:set(6,10,0,0,0,255)
img:set(6,11,127,127,127,255)
img:set(6,12,127,127,127,255)
img:set(6,13,127,127,127,255)
img:set(6,14,127,127,127,255)
img:set(6,15,127,127,127,255)
img:set(6,16,0,0,0,255)
img:set(7,10,0,0,0,255)
img:set(7,11,127,127,127,255)
img:set(7,12,127,127,127,255)
img:set(7,13,127,127,127,255)
img:set(7,14,127,127,127,255)
img:set(7,15,0,0,0,255)
img:set(8,6,0,0,0,255)
img:set(8,7,0,0,0,255)
img:set(8,8,0,0,0,255)
img:set(8,9,0,0,0,255)
img:set(8,10,0,0,0,255)
img:set(8,11,127,127,127,255)
img:set(8,12,127,127,127,255)
img:set(8,13,127,127,127,255)
img:set(8,14,127,127,127,255)
img:set(8,15,0,0,0,255)
img:set(9,6,0,0,0,255)
img:set(9,7,127,127,127,255)
img:set(9,8,127,127,127,255)
img:set(9,9,0,0,0,255)
img:set(9,10,0,0,0,255)
img:set(9,11,0,0,0,255)
img:set(9,12,127,127,127,255)
img:set(9,13,127,127,127,255)
img:set(9,14,127,127,127,255)
img:set(9,15,0,0,0,255)
img:set(10,6,0,0,0,255)
img:set(10,7,127,127,127,255)
img:set(10,8,127,127,127,255)
img:set(10,9,127,127,127,255)
img:set(10,10,127,127,127,255)
img:set(10,11,127,127,127,255)
img:set(10,12,0,0,0,255)
img:set(10,13,127,127,127,255)
img:set(10,14,127,127,127,255)
img:set(10,15,0,0,0,255)
img:set(11,6,0,0,0,255)
img:set(11,7,127,127,127,255)
img:set(11,8,127,127,127,255)
img:set(11,9,127,127,127,255)
img:set(11,10,127,127,127,255)
img:set(11,11,127,127,127,255)
img:set(11,12,127,127,127,255)
img:set(11,13,0,0,0,255)
img:set(11,14,127,127,127,255)
img:set(11,15,0,0,0,255)
img:set(12,7,0,0,0,255)
img:set(12,8,127,127,127,255)
img:set(12,9,127,127,127,255)
img:set(12,10,127,127,127,255)
img:set(12,11,127,127,127,255)
img:set(12,12,127,127,127,255)
img:set(12,13,0,0,0,255)
img:set(12,14,127,127,127,255)
img:set(12,15,0,0,0,255)
img:set(13,8,0,0,0,255)
img:set(13,9,127,127,127,255)
img:set(13,10,127,127,127,255)
img:set(13,11,127,127,127,255)
img:set(13,12,127,127,127,255)
img:set(13,13,0,0,0,255)
img:set(13,14,127,127,127,255)
img:set(13,15,0,0,0,255)
img:set(14,8,0,0,0,255)
img:set(14,9,127,127,127,255)
img:set(14,10,127,127,127,255)
img:set(14,11,127,127,127,255)
img:set(14,12,127,127,127,255)
img:set(14,13,0,0,0,255)
img:set(14,14,127,127,127,255)
img:set(14,15,0,0,0,255)
img:set(15,9,0,0,0,255)
img:set(15,10,127,127,127,255)
img:set(15,11,127,127,127,255)
img:set(15,12,127,127,127,255)
img:set(15,13,0,0,0,255)
img:set(15,14,127,127,127,255)
img:set(15,15,0,0,0,255)
img:set(16,10,0,0,0,255)
img:set(16,11,0,0,0,255)
img:set(16,12,127,127,127,255)
img:set(16,13,0,0,0,255)
img:set(16,14,127,127,127,255)
img:set(16,15,0,0,0,255)
img:set(17,11,0,0,0,255)
img:set(17,12,127,127,127,255)
img:set(17,13,0,0,0,255)
img:set(17,14,127,127,127,255)
img:set(17,15,0,0,0,255)
img:set(18,11,0,0,0,255)
img:set(18,12,0,0,0,255)
img:set(18,13,127,127,127,255)
img:set(18,14,127,127,127,255)
img:set(18,15,0,0,0,255)
img:set(19,11,0,0,0,255)
img:set(19,12,127,127,127,255)
img:set(19,13,127,127,127,255)
img:set(19,14,0,128,255,255)
img:set(19,15,0,128,255,255)
img:set(19,16,0,0,0,255)
img:set(20,11,0,0,0,255)
img:set(20,12,127,127,127,255)
img:set(20,13,127,127,127,255)
img:set(20,14,0,128,255,255)
img:set(20,15,255,255,255,255)
img:set(20,16,0,128,255,255)
img:set(20,17,0,0,0,255)
img:set(21,11,0,0,0,255)
img:set(21,12,127,127,127,255)
img:set(21,13,127,127,127,255)
img:set(21,14,0,128,255,255)
img:set(21,15,255,255,255,255)
img:set(21,16,0,128,255,255)
img:set(21,17,0,0,0,255)
img:set(22,11,0,0,0,255)
img:set(22,12,127,127,127,255)
img:set(22,13,127,127,127,255)
img:set(22,14,0,128,255,255)
img:set(22,15,0,128,255,255)
img:set(22,16,0,128,255,255)
img:set(22,17,0,0,0,255)
img:set(23,11,0,0,0,255)
img:set(23,12,127,127,127,255)
img:set(23,13,127,127,127,255)
img:set(23,14,0,128,255,255)
img:set(23,15,0,128,255,255)
img:set(23,16,0,128,255,255)
img:set(23,17,0,0,0,255)
img:set(24,11,0,0,0,255)
img:set(24,12,127,127,127,255)
img:set(24,13,127,127,127,255)
img:set(24,14,0,128,255,255)
img:set(24,15,0,128,255,255)
img:set(24,16,0,128,255,255)
img:set(24,17,0,0,0,255)
img:set(25,11,0,0,0,255)
img:set(25,12,127,127,127,255)
img:set(25,13,127,127,127,255)
img:set(25,14,0,128,255,255)
img:set(25,15,0,128,255,255)
img:set(25,16,0,0,0,255)
img:set(26,11,0,0,0,255)
img:set(26,12,127,127,127,255)
img:set(26,13,127,127,127,255)
img:set(26,14,0,0,0,255)
img:set(26,15,0,0,0,255)
img:set(27,11,0,0,0,255)
img:set(27,12,127,127,127,255)
img:set(27,13,0,0,0,255)
img:set(28,11,0,0,0,255)
img:set(28,12,127,127,127,255)
img:set(28,13,0,0,0,255)
img:set(29,11,0,0,0,255)
img:set(29,12,127,127,127,255)
img:set(30,11,0,0,0,255)
img:set(30,12,0,0,0,255)
return img
end

Heres the flame sprite…

function IconImages:getFlame()
local img = image(30, 30)
img:set(3,5,22,0,0,22)
img:set(3,6,22,0,0,22)
img:set(3,7,22,0,0,22)
img:set(3,8,22,0,0,22)
img:set(3,9,22,0,0,22)
img:set(3,10,22,0,0,22)
img:set(3,11,22,0,0,22)
img:set(3,12,22,0,0,22)
img:set(3,13,22,0,0,22)
img:set(3,14,22,0,0,22)
img:set(4,5,22,0,0,22)
img:set(4,6,93,0,0,93)
img:set(4,7,86,0,0,86)
img:set(4,8,89,0,0,89)
img:set(4,9,22,0,0,22)
img:set(4,10,22,0,0,22)
img:set(4,11,93,0,0,93)
img:set(4,12,86,0,0,86)
img:set(4,13,93,0,0,93)
img:set(4,14,22,0,0,22)
img:set(4,15,22,0,0,22)
img:set(4,16,22,0,0,22)
img:set(4,17,22,0,0,22)
img:set(4,18,22,0,0,22)
img:set(4,19,22,0,0,22)
img:set(5,5,22,0,0,22)
img:set(5,6,86,0,0,86)
img:set(5,7,208,0,0,208)
img:set(5,8,91,0,0,91)
img:set(5,9,86,0,0,86)
img:set(5,10,22,0,0,22)
img:set(5,11,84,0,0,84)
img:set(5,12,201,0,0,201)
img:set(5,13,84,0,0,84)
img:set(5,14,22,0,0,22)
img:set(5,15,22,0,0,22)
img:set(5,16,89,0,0,89)
img:set(5,17,86,0,0,86)
img:set(5,18,93,0,0,93)
img:set(5,19,22,0,0,22)
img:set(6,3,22,0,0,22)
img:set(6,4,22,0,0,22)
img:set(6,5,22,0,0,22)
img:set(6,6,84,0,0,84)
img:set(6,7,89,0,0,89)
img:set(6,8,208,0,0,208)
img:set(6,9,91,0,0,91)
img:set(6,10,83,0,0,83)
img:set(6,11,91,0,0,91)
img:set(6,12,82,0,0,82)
img:set(6,13,91,0,0,91)
img:set(6,14,84,0,0,84)
img:set(6,15,84,0,0,84)
img:set(6,16,83,0,0,83)
img:set(6,17,201,0,0,201)
img:set(6,18,86,0,0,86)
img:set(6,19,22,0,0,22)
img:set(7,3,22,0,0,22)
img:set(7,4,93,0,0,93)
img:set(7,5,84,0,0,84)
img:set(7,6,84,0,0,84)
img:set(7,7,83,0,0,83)
img:set(7,8,91,0,0,91)
img:set(7,9,102,0,0,102)
img:set(7,10,221,0,0,221)
img:set(7,11,96,0,0,96)
img:set(7,12,82,0,0,82)
img:set(7,13,82,0,0,82)
img:set(7,14,201,0,0,201)
img:set(7,15,83,0,0,83)
img:set(7,16,84,0,0,84)
img:set(7,17,86,0,0,86)
img:set(7,18,93,0,0,93)
img:set(7,19,22,0,0,22)
img:set(8,3,22,0,0,22)
img:set(8,4,86,0,0,86)
img:set(8,5,201,0,0,201)
img:set(8,6,84,0,0,84)
img:set(8,7,22,0,0,22)
img:set(8,8,93,0,0,93)
img:set(8,9,228,0,0,228)
img:set(8,10,241,0,0,241)
img:set(8,11,234,0,0,234)
img:set(8,12,102,0,0,102)
img:set(8,13,96,0,0,96)
img:set(8,14,91,0,0,91)
img:set(8,15,86,0,0,86)
img:set(8,16,22,0,0,22)
img:set(8,17,22,0,0,22)
img:set(8,18,22,0,0,22)
img:set(8,19,22,0,0,22)
img:set(9,3,22,0,0,22)
img:set(9,4,93,0,0,93)
img:set(9,5,86,0,0,86)
img:set(9,6,93,0,0,93)
img:set(9,7,22,0,0,22)
img:set(9,8,108,0,0,108)
img:set(9,9,234,0,0,234)
img:set(9,10,255,0,0,255)
img:set(9,11,248,0,0,248)
img:set(9,12,241,0,0,241)
img:set(9,13,221,0,0,221)
img:set(9,14,91,0,0,91)
img:set(9,15,22,0,0,22)
img:set(9,16,22,0,0,22)
img:set(9,17,22,0,0,22)
img:set(9,18,22,0,0,22)
img:set(10,3,22,0,0,22)
img:set(10,4,22,0,0,22)
img:set(10,5,22,0,0,22)
img:set(10,6,22,0,0,22)
img:set(10,7,22,0,0,22)
img:set(10,8,102,1,0,102)
img:set(10,9,234,9,0,234)
img:set(10,10,255,15,0,255)
img:set(10,11,255,15,0,255)
img:set(10,12,255,7,0,255)
img:set(10,13,241,0,0,241)
img:set(10,14,106,0,0,106)
img:set(10,15,93,0,0,93)
img:set(10,16,86,0,0,86)
img:set(10,17,93,0,0,93)
img:set(10,18,22,0,0,22)
img:set(11,4,22,0,0,22)
img:set(11,5,93,0,0,93)
img:set(11,6,86,0,0,86)
img:set(11,7,84,0,0,84)
img:set(11,8,99,1,0,99)
img:set(11,9,234,20,0,234)
img:set(11,10,255,88,0,255)
img:set(11,11,255,93,0,255)
img:set(11,12,255,24,0,255)
img:set(11,13,241,10,0,241)
img:set(11,14,221,1,0,221)
img:set(11,15,89,0,0,89)
img:set(11,16,201,0,0,201)
img:set(11,17,86,0,0,86)
img:set(11,18,22,0,0,22)
img:set(12,4,22,0,0,22)
img:set(12,5,86,0,0,86)
img:set(12,6,201,0,0,201)
img:set(12,7,82,0,0,82)
img:set(12,8,96,3,0,96)
img:set(12,9,234,30,0,234)
img:set(12,10,255,103,0,255)
img:set(12,11,255,116,0,255)
img:set(12,12,255,102,0,255)
img:set(12,13,241,28,0,241)
img:set(12,14,102,12,0,102)
img:set(12,15,89,0,0,89)
img:set(12,16,83,0,0,83)
img:set(12,17,89,0,0,89)
img:set(12,18,22,0,0,22)
img:set(13,4,22,0,0,22)
img:set(13,5,93,0,0,93)
img:set(13,6,86,0,0,86)
img:set(13,7,84,1,0,84)
img:set(13,8,99,16,0,99)
img:set(13,9,234,41,0,234)
img:set(13,10,255,112,0,255)
img:set(13,11,255,126,0,255)
img:set(13,12,255,119,0,255)
img:set(13,13,241,101,0,241)
img:set(13,14,109,21,0,109)
img:set(13,15,89,1,0,89)
img:set(13,16,84,0,0,84)
img:set(13,17,22,0,0,22)
img:set(13,18,22,0,0,22)
img:set(14,4,22,0,0,22)
img:set(14,5,22,0,0,22)
img:set(14,6,22,0,0,22)
img:set(14,7,22,3,0,22)
img:set(14,8,99,30,0,99)
img:set(14,9,234,106,0,234)
img:set(14,10,255,126,0,255)
img:set(14,11,255,133,0,255)
img:set(14,12,255,132,0,255)
img:set(14,13,248,107,0,248)
img:set(14,14,234,30,0,234)
img:set(14,15,214,2,0,214)
img:set(14,16,86,0,0,86)
img:set(14,17,22,0,0,22)
img:set(15,4,22,0,0,22)
img:set(15,5,22,0,0,22)
img:set(15,6,22,0,0,22)
img:set(15,7,86,4,0,86)
img:set(15,8,106,36,0,106)
img:set(15,9,241,110,0,241)
img:set(15,10,255,133,0,255)
img:set(15,11,255,190,0,255)
img:set(15,12,255,133,0,255)
img:set(15,13,255,105,0,255)
img:set(15,14,241,27,0,241)
img:set(15,15,102,2,0,102)
img:set(15,16,84,0,0,84)
img:set(15,17,22,0,0,22)
img:set(15,18,22,0,0,22)
img:set(16,4,22,0,0,22)
img:set(16,5,93,0,0,93)
img:set(16,6,84,0,0,84)
img:set(16,7,99,2,0,99)
img:set(16,8,228,24,0,228)
img:set(16,9,248,99,0,248)
img:set(16,10,255,126,0,255)
img:set(16,11,255,135,0,255)
img:set(16,12,255,133,0,255)
img:set(16,13,255,105,0,255)
img:set(16,14,234,30,0,234)
img:set(16,15,102,2,0,102)
img:set(16,16,83,0,0,83)
img:set(16,17,89,0,0,89)
img:set(16,18,22,0,0,22)
img:set(17,4,22,0,0,22)
img:set(17,5,86,0,0,86)
img:set(17,6,201,0,0,201)
img:set(17,7,102,0,0,102)
img:set(17,8,234,11,0,234)
img:set(17,9,255,32,0,255)
img:set(17,10,255,119,0,255)
img:set(17,11,255,141,0,255)
img:set(17,12,255,140,0,255)
img:set(17,13,255,112,0,255)
img:set(17,14,234,30,0,234)
img:set(17,15,102,2,0,102)
img:set(17,16,201,0,0,201)
img:set(17,17,86,0,0,86)
img:set(17,18,22,0,0,22)
img:set(18,4,22,0,0,22)
img:set(18,5,93,0,0,93)
img:set(18,6,84,0,0,84)
img:set(18,7,106,0,0,106)
img:set(18,8,234,2,0,234)
img:set(18,9,255,25,0,255)
img:set(18,10,255,112,0,255)
img:set(18,11,255,197,0,255)
img:set(18,12,255,197,0,255)
img:set(18,13,255,113,0,255)
img:set(18,14,241,28,0,241)
img:set(18,15,109,2,0,109)
img:set(18,16,91,0,0,91)
img:set(18,17,89,0,0,89)
img:set(18,18,22,0,0,22)
img:set(19,4,22,0,0,22)
img:set(19,5,22,0,0,22)
img:set(19,6,22,0,0,22)
img:set(19,7,99,1,0,99)
img:set(19,8,234,11,0,234)
img:set(19,9,255,33,0,255)
img:set(19,10,255,119,0,255)
img:set(19,11,255,149,0,255)
img:set(19,12,255,156,0,255)
img:set(19,13,255,126,0,255)
img:set(19,14,241,36,0,241)
img:set(19,15,221,2,0,221)
img:set(19,16,83,0,0,83)
img:set(19,17,22,0,0,22)
img:set(19,18,22,0,0,22)
img:set(20,4,22,0,0,22)
img:set(20,5,93,0,0,93)
img:set(20,6,84,0,0,84)
img:set(20,7,106,2,0,106)
img:set(20,8,234,29,0,234)
img:set(20,9,255,104,0,255)
img:set(20,10,255,134,0,255)
img:set(20,11,255,151,0,255)
img:set(20,12,255,219,0,255)
img:set(20,13,255,190,0,255)
img:set(20,14,241,45,0,241)
img:set(20,15,109,3,0,109)
img:set(20,16,91,0,0,91)
img:set(20,17,89,0,0,89)
img:set(20,18,22,0,0,22)
img:set(21,4,22,0,0,22)
img:set(21,5,86,0,0,86)
img:set(21,6,201,0,0,201)
img:set(21,7,102,3,0,102)
img:set(21,8,234,39,0,234)
img:set(21,9,255,175,0,255)
img:set(21,10,255,156,0,255)
img:set(21,11,255,221,0,255)
img:set(21,12,255,226,0,255)
img:set(21,13,255,191,0,255)
img:set(21,14,234,49,0,234)
img:set(21,15,102,3,0,102)
img:set(21,16,201,0,0,201)
img:set(21,17,86,0,0,86)
img:set(21,18,22,0,0,22)
img:set(22,4,22,0,0,22)
img:set(22,5,89,0,0,89)
img:set(22,6,83,0,0,83)
img:set(22,7,102,2,0,102)
img:set(22,8,234,39,0,234)
img:set(22,9,255,120,0,255)
img:set(22,10,255,212,0,255)
img:set(22,11,255,221,0,255)
img:set(22,12,255,164,0,255)
img:set(22,13,255,128,0,255)
img:set(22,14,234,40,0,234)
img:set(22,15,102,3,0,102)
img:set(22,16,83,0,0,83)
img:set(22,17,89,0,0,89)
img:set(22,18,22,0,0,22)
img:set(23,4,22,0,0,22)
img:set(23,5,22,0,0,22)
img:set(23,6,84,0,0,84)
img:set(23,7,102,1,0,102)
img:set(23,8,241,19,0,241)
img:set(23,9,255,111,0,255)
img:set(23,10,255,149,0,255)
img:set(23,11,255,172,0,255)
img:set(23,12,255,214,0,255)
img:set(23,13,255,121,0,255)
img:set(23,14,241,29,0,241)
img:set(23,15,102,2,0,102)
img:set(23,16,84,0,0,84)
img:set(23,17,22,0,0,22)
img:set(23,18,22,0,0,22)
img:set(24,5,22,0,0,22)
img:set(24,6,86,0,0,86)
img:set(24,7,221,0,0,221)
img:set(24,8,241,10,0,241)
img:set(24,9,255,40,0,255)
img:set(24,10,255,191,0,255)
img:set(24,11,255,228,0,255)
img:set(24,12,255,227,0,255)
img:set(24,13,255,134,0,255)
img:set(24,14,241,36,0,241)
img:set(24,15,221,2,0,221)
img:set(24,16,86,0,0,86)
img:set(24,17,22,0,0,22)
img:set(25,5,22,0,0,22)
img:set(25,6,97,0,0,97)
img:set(25,7,102,0,0,102)
img:set(25,8,241,2,0,241)
img:set(25,9,248,33,0,248)
img:set(25,10,255,134,0,255)
img:set(25,11,255,234,0,255)
img:set(25,12,255,234,0,255)
img:set(25,13,255,190,0,255)
img:set(25,14,241,37,0,241)
img:set(25,15,106,3,0,106)
img:set(25,16,89,0,0,89)
img:set(25,17,22,0,0,22)
img:set(26,5,22,0,0,22)
img:set(26,6,86,0,0,86)
img:set(26,7,208,0,0,208)
img:set(26,8,109,1,0,109)
img:set(26,9,241,20,0,241)
img:set(26,10,255,120,0,255)
img:set(26,11,255,220,0,255)
img:set(26,12,255,226,0,255)
img:set(26,13,255,127,0,255)
img:set(26,14,234,30,0,234)
img:set(26,15,102,2,0,102)
img:set(26,16,22,0,0,22)
img:set(26,17,22,0,0,22)
img:set(27,5,22,0,0,22)
img:set(27,6,93,0,0,93)
img:set(27,7,84,0,0,84)
img:set(27,8,106,0,0,106)
img:set(27,9,234,12,0,234)
img:set(27,10,255,55,0,255)
img:set(27,11,255,212,0,255)
img:set(27,12,255,212,0,255)
img:set(27,13,248,60,0,248)
img:set(27,14,228,14,0,228)
img:set(27,15,97,1,0,97)
img:set(27,16,22,0,0,22)
img:set(28,5,22,0,0,22)
img:set(28,6,22,0,0,22)
img:set(28,7,22,0,0,22)
img:set(28,8,102,0,0,102)
img:set(28,9,234,3,0,234)
img:set(28,10,255,49,0,255)
img:set(28,11,255,205,0,255)
img:set(28,12,255,206,0,255)
img:set(28,13,241,55,0,241)
img:set(28,14,106,5,0,106)
img:set(28,15,89,0,0,89)
img:set(28,16,22,0,0,22)
img:set(29,7,22,0,0,22)
img:set(29,8,97,0,0,97)
img:set(29,9,228,3,0,228)
img:set(29,10,248,51,0,248)
img:set(29,11,255,224,0,255)
img:set(29,12,255,206,0,255)
img:set(29,13,234,60,0,234)
img:set(29,14,102,6,0,102)
img:set(29,15,22,0,0,22)
img:set(29,16,22,0,0,22)
img:set(30,7,22,0,0,22)
img:set(30,8,93,0,0,93)
img:set(30,9,108,4,0,108)
img:set(30,10,244,57,0,244)
img:set(30,11,255,203,0,255)
img:set(30,12,255,204,0,255)
img:set(30,13,233,65,0,233)
img:set(30,14,111,9,0,111)
img:set(30,15,22,0,0,22)
return img
end

Phew! That was a lot of cut and paste … Better get myself an online storage location to make things easier!

My daughter and I play the game. It is simple but joyful. I think it might look better if it should have such cloud or cars running on the road. Thank you for sharing the game.

Haha. Cool. By the way, someone REALLY likes spritely. I like it.

Very good integration with the Codea controls position, last time we talk about this, we asked @Simeon to have a full screen mode. do you remember? hahaha
Well, i saw the bombs dont detect collision between buildings, in that little space, but i think thats a sweet way of increase game addiction
Love the idea integration anyway.
It would be great to compact all those spritely images and give them a persistent data name, so then you can use them just from a line with readGlobalData ,what do you think?

I’ve only used two sprites! Both are 30x30 - I was surprised as to how many lines of code two sprites took up! Is there anyway to compress this data?

Hey juaxix, thanks for your post. Originally I used the Spritelyloader example and the sprites were then stored in the global data, but I modified them to the version shown so the sprites would be carried over via copy paste for the competition entry. I’m very very new to coding so it’s very likely there are easier ways of doing things compared to how I’ve done them, I’ve just done what I could understand in the short space of time.