vldrake [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=39595 zorahiwume <p> <table><tr><td> <a href="/bbs/?pid=69893#p"> <img src="/bbs/thumbs/pico8_zorahiwume-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=69893#p"> zorahiwume</a><br><br> by <a href="/bbs/?uid=39595"> vldrake</a> <br><br><br> <a href="/bbs/?pid=69893#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=35910 https://www.lexaloffle.com/bbs/?tid=35910 Thu, 14 Nov 2019 15:40:36 UTC Making a sprite move up by itself <p>Here is my code so far. I am trying to get the fish on the screen to move in an upward motion by itself, after I can master this I am going to try to do a collision detection for if the frog touches the fish = game over. Can anyone give me pointers on making the fish move by itself? Thank you</p> <p>function _update()<br /> fish_sprite+=18<br /> if fish_sprite &gt; 19 then<br /> fish_sprite=18<br /> end</p> <p>char_sprite+=1<br /> if char_sprite &gt; 9 then<br /> char_sprite=1<br /> end</p> <p>if btn(0) then char_x=char_x-1 sfx(05) end<br /> if btn(1) then char_x=char_x+1 sfx(05) end<br /> if btn(2) then char_y=char_y-1 sfx(05) end<br /> if btn(3) then char_y=char_y+1 sfx(05) end<br /> end</p> <p>fish_sprite+=18<br /> if fish_sprite &gt; 19 then<br /> char_sprite=18<br /> end</p> <p>function _draw()<br /> cls()<br /> map(0,0)<br /> spr( char_sprite, char_x, char_y)<br /> spr( fish_sprite, fish_x, fish_y)</p> <p>print( time())<br /> end</p> https://www.lexaloffle.com/bbs/?tid=35740 https://www.lexaloffle.com/bbs/?tid=35740 Wed, 23 Oct 2019 17:36:31 UTC mukurupiju <p> <table><tr><td> <a href="/bbs/?pid=68550#p"> <img src="/bbs/thumbs/pico8_mukurupiju-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=68550#p"> mukurupiju</a><br><br> by <a href="/bbs/?uid=39595"> vldrake</a> <br><br><br> <a href="/bbs/?pid=68550#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=35568 https://www.lexaloffle.com/bbs/?tid=35568 Sun, 06 Oct 2019 00:35:00 UTC Won't let me upload my Cart HELP <p>I keep trying to upload my cart and it keeps telling me invalid cart. I have done the F7 and saved it but every time I choose the file it tells me it is invalid. Please help</p> https://www.lexaloffle.com/bbs/?tid=35565 https://www.lexaloffle.com/bbs/?tid=35565 Sat, 05 Oct 2019 22:58:24 UTC How to make the ball collide with the rectangle <p>I am trying to do a simple game of pong for class and am having trouble. I have got the ball and the paddle. Now I am having trouble making the 2 collide. I am trying to get the ball to turn a different color when collided with the paddle.<br /> I am also having trouble coding to get my paddle to stop when it hits the end of the screen so it does not disappear. Any advice would be much appreciated. I have attached my code so far that I have been working on. Thank you</p> <p>ball_x = 3<br /> x_speed = 1<br /> ball_y = 15<br /> y_speed = 1<br /> ball_round = 3<br /> col = 7<br /> x=1<br /> x1=5<br /> y=127<br /> y1=1<br /> speed=5</p> <p>function _init()<br /> cls()<br /> end</p> <p>function _update()<br /> buttpress = false</p> <p>if btn(0) then speed =-5 end<br /> if btn(1) then speed+=5 end<br /> if not (buttpress) then<br /> speed = speed/1.7<br /> end<br /> x+=speed</p> <p>ball_y = ball_y+y_speed<br /> ball_x = ball_x+x_speed</p> <p>if ball_x &gt; 127<br /> then x_speed = -2<br /> end</p> <p>if ball_x &lt; 0<br /> then x_speed = 2<br /> end</p> <p>if ball_y &gt; 127<br /> then y_speed = -2<br /> end</p> <p>if ball_y &lt; 0<br /> then y_speed = 2<br /> end</p> <p>end</p> <p>function _draw()<br /> cls()<br /> circfill(ball_x,ball_y,ball_round,col)<br /> rect( x, y, x+8, y+1, 8)<br /> end</p> https://www.lexaloffle.com/bbs/?tid=35392 https://www.lexaloffle.com/bbs/?tid=35392 Thu, 19 Sep 2019 20:20:10 UTC Need help. Need rectangle to stay the same shape when moved. <p>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 </p> <p>x=1<br /> x1=5<br /> y=2<br /> y1=2<br /> speed=2</p> <p>function _init()<br /> cls()<br /> end</p> <p>function _update60()<br /> if btn(0) then x=x-speed end<br /> if btn(1) then x=x+speed end<br /> end</p> <p>function _draw()<br /> cls()<br /> rect(x,y,x1,y1,8)<br /> end</p> https://www.lexaloffle.com/bbs/?tid=35333 https://www.lexaloffle.com/bbs/?tid=35333 Thu, 12 Sep 2019 22:20:00 UTC How do you move an object? <p>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.</p> <p>ball_x = 3<br /> x_speed = 1<br /> ball_y = 15<br /> y_speed = 1<br /> ball_round = 3<br /> col = 0</p> <p>pad_x = 52<br /> pad_y = 120<br /> pad_dx = 0<br /> pad_w = 24<br /> pad_h = 3<br /> pad_c = 7</p> <p>function _init()<br /> cls()<br /> end</p> <p>function _update()<br /> ball_y = ball_y+y_speed<br /> ball_x = ball_x+x_speed<br /> col=col+1</p> <p>pad_y = pad_y+pad_dx<br /> pad_x = pad_x+pad_dx<br /> pad_c=pad_c+1</p> <p>buttpress = false</p> <p>if btn(0)<br /> then pad_dx =-5<br /> end<br /> if btn(1)<br /> then pad_dx+=5<br /> end<br /> if not (buttpress) then<br /> pad_dx = pad_dx/1.7<br /> end<br /> pad_x+=pad_dx</p> <p>if ball_x &gt; 127<br /> then x_speed = -2<br /> end</p> <p>if ball_x &lt; 0<br /> then x_speed = 2<br /> end</p> <p>if ball_y &gt; 127<br /> then y_speed = -2<br /> end</p> <p>if ball_y &lt; 0<br /> then y_speed = 2<br /> end<br /> end</p> <p>function _draw()<br /> cls()<br /> circfill(ball_x,ball_y,ball_round,col)<br /> rectfill(30,10,3,8)<br /> end</p> https://www.lexaloffle.com/bbs/?tid=35332 https://www.lexaloffle.com/bbs/?tid=35332 Thu, 12 Sep 2019 19:35:01 UTC Changing Colors <p>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<br /> Here is my code so far without changing the color.</p> <p>col=0<br /> function _init()<br /> cls()<br /> xpos = 64<br /> ypos = 64<br /> col = 8<br /> size = 5<br /> end </p> <p>function _update60()<br /> if (btn(0) and xpos &gt; 0) xpos -= 1<br /> if (btn(1) and xpos &lt; 127) xpos += 1<br /> end<br /> if xpos &lt; 33 then col = 5<br /> end<br /> function _draw()<br /> cls()<br /> circfill(xpos, ypos, size, col)<br /> end</p> https://www.lexaloffle.com/bbs/?tid=35276 https://www.lexaloffle.com/bbs/?tid=35276 Thu, 05 Sep 2019 23:38:20 UTC