ManlishPotato [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=17173 Rotating sprites help <p> <table><tr><td> <a href="/bbs/?pid=116975#p"> <img src="/bbs/thumbs/pico8_rotatespritewip-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=116975#p"> rotatespritewip</a><br><br> by <a href="/bbs/?uid=17173"> ManlishPotato</a> <br><br><br> <a href="/bbs/?pid=116975#p"> [Click to Play]</a> </td></tr></table> <br /> I'm trying to rotate a sprite from the sprite sheet, and I think I'm semi successful.<br /> The problem I have been noticing is that when the sprite is turning it will have holes in the drawing, no matter which sprite it is. I think what is happening is that it's rounding of the coordinates to the closest, and this sometimes draws two pixels on top of each other. At least that's what I think is happening.<br /> In what way do you typically solve this? Draw a color in the blanks that is a close match, or like a background color?<br /> Can you cleverly ensure that pixels never get's drawn on top of each other?</p> https://www.lexaloffle.com/bbs/?tid=49218 https://www.lexaloffle.com/bbs/?tid=49218 Tue, 06 Sep 2022 17:51:39 UTC Tetris clone random game ending bug <p> <table><tr><td> <a href="/bbs/?pid=72842#p"> <img src="/bbs/thumbs/pico8_tetriswip-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=72842#p"> tetriswip</a><br><br> by <a href="/bbs/?uid=17173"> ManlishPotato</a> <br><br><br> <a href="/bbs/?pid=72842#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello there!</p> <p>I'm making a Tetris clone that uses the map to save tile data. The program draws the tetraminoes using 2 'for' loops and a table that has start and center information, but also how many columns and rows to draw in this config:<br /> table_x={startx,starty, row1x,row1y,n row1, row2x,row2y,n row2}</p> <p>The program is supposed to check if it has a second row:<br /> if(table[6]!=nil) then<br /> pos_x,pos_y=0,0<br /> for n=1,table[8],1 do<br /> rot_x,rot_y=rot(table[6]+pos_x,table[7]+pos_y)<br /> for v=0,7,7 do<br /> for b=0,7,7 do<br /> if(op==&quot;gravity&quot;) then<br /> flag=fget(mget((p1.x+rot_x+b)/8,(p1.y+rot_y+v)/8),0)<br /> if(flag) then<br /> ....<br /> and normally it works, but sometimes out of random i get this error:<br /> runtime error line 146 tab 0<br /> rot_x,rot_y=rot(table[6]+pos_x,table[7]+pos_y)<br /> attempt to perform arithmetic on field '?' (a nil value)<br /> in collision line 146 (tab 0)<br /> in _update line 40 (tab 0)<br /> at line 0 (tab 0)<br /> ....<br /> which is super weird, if you print what table was active, it'l usually spit out table: tet_i which doesn't have a second row, meaning that if(table[6]!=nil) should return false, meaning the error code should not be executed.<br /> If you want to force the runtime error you can make a tower so that you would normally get a game over, but since i haven't programmed one the program keeps spitting out tetraminoes, rapidly speeding the process up, and increasing the chance that you get an error. </p> <p>I have no idea why this is, any ideas is appreciated!<br /> Thanks in advance, Benji. </p> https://www.lexaloffle.com/bbs/?tid=36773 https://www.lexaloffle.com/bbs/?tid=36773 Fri, 07 Feb 2020 01:01:12 UTC TetrisWIP1.1 <p> <table><tr><td> <a href="/bbs/?pid=72842#p"> <img src="/bbs/thumbs/pico8_tetriswip-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=72842#p"> tetriswip</a><br><br> by <a href="/bbs/?uid=17173"> ManlishPotato</a> <br><br><br> <a href="/bbs/?pid=72842#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=36772 https://www.lexaloffle.com/bbs/?tid=36772 Thu, 06 Feb 2020 22:39:30 UTC Super Simple Collision <p> <table><tr><td> <a href="/bbs/?pid=32978#p"> <img src="/bbs/thumbs/pico32977.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=32978#p"> Super Simple Collision 1.0</a><br><br> by <a href="/bbs/?uid=17173"> ManlishPotato</a> <br><br><br> <a href="/bbs/?pid=32978#p"> [Click to Play]</a> </td></tr></table> <br /> Hi my name is Benjamin and this is my first cartridge.<br /> In this I am showcasing how to do very simple collision detection, inspired by Scathes game which you can find here: <a href="https://www.lexaloffle.com/bbs/?tid=3116">https://www.lexaloffle.com/bbs/?tid=3116</a></p> <p>Don't be afraid to ask questions if you have any!</p> https://www.lexaloffle.com/bbs/?tid=28142 https://www.lexaloffle.com/bbs/?tid=28142 Sat, 03 Dec 2016 16:03:34 UTC