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
P#15922 2015-10-27 16:56 ( Edited 2015-10-27 21:35)

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!

P#15923 2015-10-27 17:23 ( Edited 2015-10-27 21:23)

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

P#15926 2015-10-27 17:35 ( Edited 2015-10-27 21:35)

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

P#15927 2015-10-27 17:35 ( Edited 2015-10-27 21:35)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-04-20 15:33:05 | 0.014s | Q:14