Animation trouble

Hey all!

I’m working on an animation for a game I’m making, however I’m encountering a strange problem.

I have the animation working fine when using Codea assets, but when I try to use 6 graphics from my documents folder, I get an error at line #31.

Is this a bug of some sort or am I doing something wrong?

Any help would be greatly appreciated!


-- Animation Test

-- Use this function to perform your initial setup
function setup()
    chop1=readImage("Planet Cute:Gem Blue")
    chop2=readImage("Planet Cute:Gem Green")
    chop3=readImage("Planet Cute:Gem Orange")
    chop4=readImage("Planet Cute:Character Boy")
    chop5=readImage("Planet Cute:Character Cat Girl")
    chop6=readImage("Planet Cute:Character Horn Girl")
    anim={chop1,chop2,chop3,chop4,chop5,chop6}
    animNo=1
    animTimer=0
    animDelay=0.1
    charY=HEIGHT/5
end

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

    animTimer=animTimer+DeltaTime
    if animTimer>animDelay then
        animNo=animNo+1
        if animNo>#anim then
            animNo=1
        end
        animTimer=0
    end
    
    sprite(anim[animNo],WIDTH/2,charY)
    
    charY=charY+3
    
    
end

@Crumble I changed your “readImage” lines of code to read sprites from my documents folder and it ran fine.

@Crumble One of your document sprites must be bad or you have a bad name.

@dave1707 Strange, when I run it with some png files I get

"error: [string “-- Animation Test…”]:32: bad argument #1 to ‘sprite’ (codeaimage expected, got nil)

@dave1707 Yeah it was the name, apparently you cant have a “.” in the name of a sprite. Sprite was named chop.001, when changed name to chop001 it works.

Thanks much.