Log In  
Follow
ManlishPotato

Cart #rotatespritewip-0 | 2022-09-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


I'm trying to rotate a sprite from the sprite sheet, and I think I'm semi successful.
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.
In what way do you typically solve this? Draw a color in the blanks that is a close match, or like a background color?
Can you cleverly ensure that pixels never get's drawn on top of each other?

1
3 comments



Cart #tetriswip-2 | 2020-02-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

Hello there!

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:
table_x={startx,starty, row1x,row1y,n row1, row2x,row2y,n row2}

The program is supposed to check if it has a second row:
if(table[6]!=nil) then
pos_x,pos_y=0,0
for n=1,table[8],1 do
rot_x,rot_y=rot(table[6]+pos_x,table[7]+pos_y)
for v=0,7,7 do
for b=0,7,7 do
if(op=="gravity") then
flag=fget(mget((p1.x+rot_x+b)/8,(p1.y+rot_y+v)/8),0)
if(flag) then
....

[ Continue Reading.. ]

1
8 comments



Cart #tetriswip-2 | 2020-02-07 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
2

2
0 comments





Hi my name is Benjamin and this is my first cartridge.
In this I am showcasing how to do very simple collision detection, inspired by Scathes game which you can find here: https://www.lexaloffle.com/bbs/?tid=3116

Don't be afraid to ask questions if you have any!

1
1 comment