I NEED HELP (pls)

Or do you need more information

Hello, Hello, Hello?

Working on itpost soon.

Oh nice!
VrsBFsdbuil

Try this, in two Tabs:

Main:


function setup()
    --
    diam, rad = 120, 60
    sprPos = vec2(WIDTH/2,HEIGHT/2)
    choice = color(67, 78, 236)
    chosen = 1
    pressed = false
end

function draw()
    -- 
    background(40, 40, 50)
    ellipseMode(CENTER)
    spriteMode(CENTER)
    for lp = 1, #butpos do
        if chosen == lp then
            fill(butcol[7])
        else
            fill(butcol[lp])
        end
        ellipse(butpos[lp].x,butpos[lp].y,rad)
        sprite(char[chosen],sprPos.x, sprPos.y)
    end
end

function touched(t)
    --
    local spnum = 1
    if t.state == BEGAN then
        for sp = 1, #butpos do
            if inCircle(t.pos,butpos[sp],rad) then
                chosen = sp
            end
        end
    end
end

function inCircle(p, c, r)    
    -- p is the point, c is the center of the circle, and r is the radius
    local dist = math.sqrt((p.x - c.x)^2 + (p.y - c.y)^2)
    if dist < r then return true else return false end
end

And data:


butpos = {
            vec2(384,724),
            vec2(204,602),
            vec2(204,422),
            vec2(384,300),
            vec2(564,422),
            vec2(564,602)
            }

butcol = {
        color(228, 0, 255),
        color(255, 0, 86),
        color(255, 147, 0),
        color(255, 218, 0),
        color(89, 255, 0),
        color(0, 220, 255),
        color(255),
        }

char = {
        asset.builtin.Planet_Cute.Character_Princess_Girl,
        asset.builtin.Planet_Cute.Character_Boy,
        asset.builtin.Planet_Cute.Character_Cat_Girl,
        asset.builtin.Planet_Cute.Character_Horn_Girl,
        asset.builtin.Planet_Cute.Character_Pink_Girl,
        asset.builtin.Planet_Cute.Chest_Closed
        }

Wait… OMG TTTTTTTTHHHHHHAAAAAAANNNNNNKKKKKK YOUUUU!!!

How can i now have another player in the 3rd? Make tab? Or in the first or second

So if you have time because i think it will take a long time

Can someone teach me in codea?

And how can i turn a touch on and off (serveral) with one button (i know you do a lot for ke but can still do that please?)

@Killer.Jo - try this. Now I need some sleep.


function setup()
    --
    diam, rad = 120, 60
    sprPos = vec2(WIDTH/2,HEIGHT/2)
    choice = color(67, 78, 236)
    chosen = 1
    pressed = false
    switch = "on"
end

function draw()
    -- 
    background(40, 40, 50)
    ellipseMode(CENTER)
    spriteMode(CENTER)
    for lp = 1, #butpos do
        if chosen == lp then
            fill(butcol[7])
        else
            fill(butcol[lp])
        end
        stroke(174, 52, 237)
        strokeWidth(4)
        ellipse(butpos[lp].x,butpos[lp].y,rad)
        sprite(char[chosen],sprPos.x, sprPos.y)
        fill(onoff[1])
        strokeWidth(8)
        stroke(onoff[2])
        ellipse(onoff[4],onoff[5],96,96)
        fill(0)
        font("Arial-BoldMT")
        fontSize(32)
        text(switch,onoff[4],onoff[5])
    end
end

function touched(t)
    --
    local spnum = 1
    if t.state == BEGAN then
        if inCircle(t.pos,vec2(onoff[4],onoff[5]),96) then
            if switch == "off" then
                switch = "on"
            else
                switch = "off"
            end
        end
        if switch == "on" then
            for sp = 1, #butpos do
                if inCircle(t.pos,butpos[sp],rad) then
                    chosen = sp
                end
            end
        end
    end
end

function inCircle(p, c, r)    
    -- p is the point, c is the center of the circle, and r is the radius
    local dist = math.sqrt((p.x - c.x)^2 + (p.y - c.y)^2)
    if dist < r then return true else return false end
end

And


butpos = {
            vec2(384,724),
            vec2(204,602),
            vec2(204,422),
            vec2(384,300),
            vec2(564,422),
            vec2(564,602)
            }

butcol = {
        color(228, 0, 255),
        color(255, 0, 86),
        color(255, 147, 0),
        color(255, 218, 0),
        color(89, 255, 0),
        color(0, 220, 255),
        color(255),
        }

char = {
        asset.builtin.Planet_Cute.Character_Princess_Girl,
        asset.builtin.Planet_Cute.Character_Boy,
        asset.builtin.Planet_Cute.Character_Cat_Girl,
        asset.builtin.Planet_Cute.Character_Horn_Girl,
        asset.builtin.Planet_Cute.Character_Pink_Girl,
        asset.builtin.Planet_Cute.Chest_Closed
        }

onoff = {
        color(67, 236, 218), 
        color(255, 0, 15),
        64,
        600,
        140
        }

OMG I THANK YOU SO MUCH!!! And i hope you sleept well!

Can you make a sprite that moves in a certain direction?

Try this, play around with the direction by changing the value and sign of the hot and very variables.


-- spriting

viewer.mode = FULLSCREEN
function setup()
    --
    bug = readImage(asset.builtin.Planet_Cute.Enemy_Bug)
    hor,vert = -64,1000
end

function draw()
    -- 
    background(40, 40, 50)
    spriteMode(CENTER)
    sprite(bug,hor,vert)
    hor = hor + 16
    if hor > 1000 then 
        hor = - 64
        vert = vert - 64
        if vert <= 64 then vert = 1000 end
    end
end

Doesn‘t work somehow

Oh, but it works

Secfbhifevwbfevwhuvwfeuohbvefwhbuwfveu

Can you make a player out of the code now?

What do you mean by a player?

A player because I can steer

Hello are you there???