My first program

A drawing program for making sprites (it’s not professional; it’s just a simple piece of code).

Impressive, for a first piece! Keep practicing and your work will get better. The icon is cute.

Could you put it on a gist? It’s free and if the code is small it’s pretty easy. I ask because it’s very convenient to be able to import a project straight into Codea without leaving the app itself.

Here’s the link

https://gist.github.com/emem151/41b2a5d20bf5ec3479381d9130d725e9

@Edan For programs that aren’t very big, they can be posted here. To post code, put ~~~ on a seperate line before and after the code so they format correctly.

--# Main
-- Doodle Draw
function setup()
    print("Hello World!")
    thickness = 10
    myImage = image(WIDTH,HEIGHT)
    parameter.number("Red",0,255,0)
    parameter.number("Green",0,255,0)
    parameter.number("Blue",0,255,0)
    parameter.number("Alpha",0,255,255)
    parameter.number("thickness",0,255,10)
    parameter.action("Save Image",function()
        if Sprite_Name == "" or  Sprite_Name == " " then
            print("error, you must put a name first")
        else
            local img = image(85,85)
            setContext(img)
            sprite(myImage,0,0,85)
            setContext()
            saveImage("Project:"..Sprite_Name,myImage)
            print("Your image "..Sprite_Name.." was saved in your Project folder")
        end
    end)
    parameter.text("Sprite_Name","")
    points = {}
end

function draw()
    background(255, 255, 255, 255)
    spriteMode(CORNER)
    noSmooth()
    sprite(myImage,0,0)
end

function touched(touch)
    setContext(myImage)
    fill(Red,Green,Blue,Alpha)
    ellipse(touch.x,touch.y,thickness)
    setContext()
end

Thanks @dave1707. I didn’t know how to do that because I’m just a beginner at codea.

This is cool, @Edan. Simple and effective.

@Edan , it’s very easy to paste code in the forums. Just hold on the project you want to copy, select “Export Project”, then select “Copy Project Code”. Paste it here, surrounded by ~~~ or ```.

@Edan here’s a small challenge, if you’re up for it: instead of putting dots at every touch point, connect the touches with lines.

It’s a little trickier than what you’ve done, but not much.

Of course, I’m not, like, your teacher or anything, so feel free to ignore me!