Howdy, Stranger!

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

In this Discussion

How could you make an animated image?

in Questions Posts: 28

Im trying make one sprite to another if for example the screen is touched on the left side and another sprite when screen is touched on the right side.

Could someone send me a link to some help page or give help directly in the comment section.
I tried to make a table with sprites but the sprite() didn't like it.

Tagged:

Comments

  • IgnatzIgnatz Mod
    Posts: 5,396

    A table works best, eg

    function setup()
        sprites={"Documents:image1","Documents:image2","Documents:image3"}
        s=1
    end
    
    function draw()
        background(0)
        sprite(sprites[s],300,300)
    end
    
    function touched()
        if t.state==ENDED then
            s=s+1 --rotate through sprites
            if s>#sprites then s=1 end 
        end
    end
    
Sign In or Register to comment.