Sprite ? New topic same thread (Ignats)

I have a platformer block sprite placed on the screen. How to make it like a real block so if a block drops on it it stays there. Do i have to make a

w1 = physics.body(EDGE,vec2(0,0),vec2(WIDTH,0))

and position it above the block? Or??

@GriffinC - assuming all your recent queries have been for the same project, can I suggest that rather than start a new thread almost every day, you keep your queries in just one thread for your whole project? (You can change the title any time you want to).

thanks


function setup()
    rectMode(CENTER)
    dx=1
    dy=0
    size=20
    x=WIDTH/2
    y=HEIGHT/2
end

function draw()
    background(40, 40, 50)
    fill(255)
    rect(x,y,size,size)
    x=x+dx
    y=y+dy
    if x>WIDTH-size/2 or x<size/2 then
        dx=- dx
    end
    if y<0 then
        dx=1
        dy=0
        x=WIDTH/2
        y=HEIGHT/2
    end
end

function touched(c)
    if c.state==BEGAN then
        dx=0
        dy=-1
    end
end

Thanks Dave and ok Ignats will do