Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea Not Saving Bug

edited August 2013 in Bugs Posts: 59

I uploaded an image of a robot. I tapped the sprite bubble and selected the robot. That worked fine. Later I tapped the sprite bubble and set it to an image of a blob. When I played the program, It still showed an image of a robot. I wrote this then went back into the editor to find that it still showed the image as Documents:Robot 2 (the robot file). I tapped it and selected the image of the blob. It drew the blob when I ran the program then. The blob was too big, so I set it to a smaller size. It seemed to be drawing the same size, but I wasn't sure. I then set the height to 1000, but it was exactly the same. But when I exited the editor and then readjusted the size, it resized properly. I seem to be in a bigger problem the just Codea not drawing the right image.

Here is my code by the way:

function setup() 
    parameter.watch(PlayerY) 
    displayMode(FULLSCREEN_NO_BUTTONS)
    supportedOrientations(LANDSCAPE_ANY) 
    floor1 = physics.body(EDGE,vec2(-500,HEIGHT/2 - 200),vec2(1000,HEIGHT/2 - 200)) 
    floor2 = physics.body(EDGE,vec2(500,HEIGHT - 200),vec2(1000,HEIGHT - 200)) 
    Player = physics.body(CIRCLE,20)

    -- moved the following line from draw
    Player.x = WIDTH/2 Player.y = HEIGHT/2 floor1.x = 500

    physics.gravity(0,-400)     -- changed
    parameter.watch("PlayerX") 
    parameter.watch("PlayerY") 
     parameter.watch("Floor1Y") 
    floor1.linearVelocity = vec2(-200,0) 
    Scene = 1 
    scrollTitleScreen = 0 
    xVel = 0 
    yVel = 0 
    physics.friction = .9
end

function draw()
    --Draws the appropritate stagese
    --Scenes:
    --1 = Title Screen
    --2 = Gamemode Select
    --3 = Stage select
    --4 = Ingame
    scene = Scene
    PlayerX = Player.x
    PlayerY = Player.y -234
    Floor1Y = floor1.y
    textMode(CENTER)
    Player.restution = 1
    floor1.restution = 0.4

    -- moved this line to setup
    --Player.x = WIDTH/2 Player.y = HEIGHT/2 floor1.x = 500

    if Scene == 1 then 
        strokeWidth(5) 
        background(0, 255, 251, 255) 
        font("Copperplate-Bold") 
        fill(0, 0, 0, 255) 
        fontSize(87) 
        text("THE PROTO PROGRAM",WIDTH/2,HEIGHT -78) 
        rectMode(CENTER) 
        fill(0, 255, 251, 255) 
        stroke(0, 0, 0, 255) 
        rect(WIDTH/2,HEIGHT/2,250,126) 
        fill(0, 0, 0, 255) 
        fontSize(60) text("PLAY",WIDTH/2,HEIGHT/2)
    elseif Scene == 2 then
        strokeWidth(5)
        fontSize(84)
        stroke(0, 0, 0, 255)
        fill(51,51,51,255)
        background(0,255,251,255)
        rectMode(CENTER)    
        fill(0, 0, 0, 255)
        text("CHOOSE A GAMEMODE",WIDTH/2,HEIGHT -78)
        fill(0, 255, 251, 255)
        rect(WIDTH/2,HEIGHT/2,250,126) 
        fontSize(27)
        fill(0,0,0,250)
        text("DEATHMATCH",WIDTH/2,HEIGHT/2)
        rectMode(CORNER)
        fill(0, 255, 251, 255)
        rect(-3,-3,100,50)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(25)
        fill(0, 0, 0, 255)
        text("BACK",9,10)
   elseif Scene == 3 then
        background(0,255,251,255)
        strokeWidth(5)
        fontSize(84)
        stroke(0, 0, 0, 255)
        background(0,255,251,255)
        rectMode(CENTER)
        fill(0, 0, 0, 255)
        text("CHOOSE A STAGE",WIDTH/2,HEIGHT -78)
        fill(0, 255, 251, 255)
        rect(WIDTH/2,HEIGHT/2,250,126) 
        fontSize(49)
        fill(0,0,0,250)
        text("METRO",WIDTH/2,HEIGHT/2)
        rectMode(CORNER)
        fill(0, 255, 251, 255)
        rect(-3,-3,100,50)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(25)
        fill(0, 0, 0, 255)
        text("BACK",9,10)

   elseif Scene == 4 then
        rectMode(CENTER)
        stroke(0, 0, 0, 255)
        fill(127, 127, 127, 255)
        strokeWidth(5)
        fontSize(84)
        stroke(0, 0, 0, 255)
        background(35, 47, 47, 255)
        rectMode(CENTER)
        fill(0, 0, 0, 255)
         rect(floor1.x,220,1200,90)
        rect(floor2.x + 1080,570,1200,20)
        fontSize(49)
        fill(0,0,0,250)
        rectMode(CORNER)
        fill(0, 255, 251, 255)
        rect(-3,-3,200,100)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(55)
        fill(0, 0, 0, 255)
        text("LEFT",9,10) 
        rectMode(CORNER)
        fill(0, 255, 251, 255)
        stroke(0, 0, 0, 255)
        rect(197,-3,200,100)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(55)
        fill(0, 0, 0, 255)
        text("RIGHT",209,10) 
        rectMode(CENTER)
                rectMode(CORNER)
        fill(0, 255, 251, 255)
        stroke(0, 0, 0, 255)
        rect(95,97,200,100)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(55)
        fill(0, 0, 0, 255)
        text("RIGHT",209,10) 
        rectMode(CENTER)

        sprite("Documents:Cyborg",Player.x,Player.y,73,90)
if Scene == 5 then
         rectMode(CENTER)
        stroke(0, 0, 0, 255)
        fill(127, 127, 127, 255)
        strokeWidth(5)
        fontSize(84)
        stroke(0, 0, 0, 255)
        background(35, 47, 47, 255)
        rectMode(CENTER)
        fill(0, 0, 0, 255)
         rect(floor1.x,200,1200,90)
        fontSize(49)
        fill(0,0,0,250)
        rectMode(CORNER)
        fill(0, 255, 251, 255)
        rect(-3,-3,200,100)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(55)
        fill(0, 0, 0, 255)
        text("LEFT",9,10) 
        rectMode(CORNER)
        fill(0, 255, 251, 255)
        stroke(0, 0, 0, 255)
        rect(197,-3,200,100)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(55)
        fill(0, 0, 0, 255)
        text("RIGHT",209,10) 
        rectMode(CENTER)
                rectMode(CORNER)
        fill(0, 255, 251, 255)
        stroke(0, 0, 0, 255)
        rect(95,97,200,100)
        rectMode(CENTER)
        textMode(CORNER)
        fontSize(55)
        fill(0, 0, 0, 255)
        text("RIGHT",209,10) 
        rectMode(CENTER)

        sprite("Documents:Cyborg",Player.x,Player.y,20,1000)   
        rect(WIDTH/2,HEIGHT/2,500,400)
end
end
end


--Buttons 
--DeathMatch button 
function touched(touch) 
    if touch.state == ENDED and touch.x > WIDTH/2 - 125 and 
            touch.x < WIDTH /2 + 125 and touch.y < HEIGHT/2+63 and 
            touch.y > HEIGHT/2- 63 and Scene == 2 then
        Scene = 3
        sound(SOUND_BLIT, 16900)
        Player.x = 500
        Player.y = 500
    end 
    --Play button 
    if touch.state == ENDED and touch.x > WIDTH/2 - 125 and 
            touch.x < WIDTH /2 + 125 and touch.y < HEIGHT/2+63 and 
            touch.y > HEIGHT/2- 63 and Scene == 1 then
        Scene = 2
        sound(SOUND_BLIT, 16900)
    end
    --Metro stage button 
    if touch.state == ENDED and touch.x > WIDTH/2 - 125 and 
        touch.x < WIDTH /2 + 125 and touch.y < HEIGHT/2+63 and 
            touch.y > HEIGHT/2- 63 and Scene == 3 then
        Scene = 4
        sound(SOUND_BLIT, 16900)
        floor1.x = 500
        floor1.y = 100
    end
    --Back button (title screen) 
    if touch.state == ENDED and touch.x > 0 and touch.x < 100 and 
        touch.y < 100 and touch.y > 0 and Scene ~= 1 and Scene ~= 4 then
        Scene = Scene -1
        sound(SOUND_BLIT, 16900)
    end  
    --Ingame buttons
    --Left button
    if Scene == 4 then
        if touch.x > 0 and touch.x < 200 and 
        touch.y < 100 and touch.y > 0 then
            if touch.state == BEGAN or touch.state == MOVING then
                xVel = -100
              yVel = 0
                updatePlayerVel()
            end
        elseif touch.state == ENDED then
            xVel = 0

            updatePlayerVel()
        end
        --Right button
        if touch.x > 200 and touch.x < 400 and 
        touch.y < 100 and touch.y > 0 then
            if touch.state == BEGAN or touch.state == MOVING then
                xVel = 100
                yVel = 0

                updatePlayerVel()
            end
        elseif touch.state == ENDED then
            xVel = 0
            updatePlayerVel()
        end
        --Jump button

       if touch.x > 95 and touch.x < 295 and 
        touch.y < 200 and touch.y > 100 then
            if touch.state == BEGAN then
                yVel = 300


            updatePlayerVel()
        end
    end
end 
end
function updatePlayerVel() 
    Player.linearVelocity = vec2(xVel,yVel) 
    end

Comments

Sign In or Register to comment.