I have got a rectangle drawn on the screen but need help. When I move it left to right it gets bigger. I want it to stay the same size and just move. Can someone please help me with my code
x=1
x1=5
y=2
y1=2
speed=2
function _init()
cls()
end
function _update60()
if btn(0) then x=x-speed end
if btn(1) then x=x+speed end
end
function _draw()
cls()
rect(x,y,x1,y1,8)
end

I have an assignment where I have to make a ball move and make a paddle move. I cannot move onto the next step because I can't seem to get the paddle to move when i press the buttons. Any help would be appreciated. Here is what I have for a code so far.
ball_x = 3
x_speed = 1
ball_y = 15
y_speed = 1
ball_round = 3
col = 0
pad_x = 52
pad_y = 120
pad_dx = 0
pad_w = 24
pad_h = 3
pad_c = 7
function _init()
cls()
end
function _update()
ball_y = ball_y+y_speed
ball_x = ball_x+x_speed
col=col+1
pad_y = pad_y+pad_dx
pad_x = pad_x+pad_dx
pad_c=pad_c+1
buttpress = false
if btn(0)
then pad_dx =-5
end
if btn(1)
then pad_dx+=5
end
if not (buttpress) then
pad_dx = pad_dx/1.7
end
pad_x+=pad_dx
if ball_x > 127
then x_speed = -2
end
if ball_x < 0
then x_speed = 2
end
if ball_y > 127
then y_speed = -2
end
if ball_y < 0
then y_speed = 2

Hey! I'm DatOneBuilder. I used to be in Vox community (I took lessons about Vox and other related coding games, but took a large break from the game.) Sadly, I lost access to my previous account. My account old account can be found here. I'm going to be taking up some of my old projects but I will need to brush up on Vox as I have taken a long break from the game. Thanks!
I have done a game code for a red ball that I can move in a line. I have figured out the code for that. However, I am stuck on making it change a color when it hits the end of the pico 8 screen. I have searched it online and have had no luck. Can anyone explain what I need to do to get the ball to change color? Thank you
Here is my code so far without changing the color.
col=0
function _init()
cls()
xpos = 64
ypos = 64
col = 8
size = 5
end
function _update60()
if (btn(0) and xpos > 0) xpos -= 1
if (btn(1) and xpos < 127) xpos += 1
end
if xpos < 33 then col = 5
end
function _draw()
cls()
circfill(xpos, ypos, size, col)
end

Hi everyone! I'm new to the pico-8 community and getting back into the best hobby on the planet (gamedev, of course) after a long break. I just wanted to share my very early work in progress - a top down golf game. I had a funny bug where I set the spin force a bit too high o_0
Would love to hear your thoughts!
sf

This is my tribute to one of my favourite games growing up: Boulder Dash on the C64.
This is version 0.81 and I've been testing the various levels (together with my boy's Lucas and Finn) but won't move it to version to 1.0 until we've checked they can all be completed.
I've thrown in a few puzzle levels at the end for good measure and the original music when selecting a start level.



