Log In  


Hi,

I'm new to Pico-8, and i've been trying to learn the program using the Pico-8 Pong Tutorial found in the zine.

When I tried to test the paddle, by running it, nothing came up. Am I doing something wrong?

This is what I have so far. Is anything incorrect?

function movepaddle()
if btn(0) then 
	padx-=3
	elseif btn(1) then
	padx+=3
	end
end

function _update()
movepaddle()
end

function draw()
--clearthescreen
rectfill (0,0,128, 128, 3)
--drawthepaddle
rectfill(padx,pady,padx+padw+padh,15)
end


Hi JaynePea

Watch out for the _ infront of draw.

Note that you'll need to give padx, pady, padw and padh some values at the start of the program before you use them in draw:

padx=20
padw=20
padh=10
pady=100

Also, I think you're missing a comma in the rectfill at the bottom. It needs five parameters if you include colour (the top left corner (x,y), the bottom right corner(x,y) and the colour)

rectfill(padx,pady,padx+padw+padh,15)

Good luck!


Ah, thank you! I'm having issues with the rectfill; even with the piece of code for it you suggested, the paddle still isn't appearing


Ah, never mind, I did miss something out. Thank you :)



[Please log in to post a comment]