R
Reactiflux

pepega1337. – 15-15 Jul 12

pepega1337. – 15-15 Jul 12

Ppepega페페가7/12/2023
okay apparently im too stupid to make a snake game, how on this planet earth is this not working as expecting get me a rope
Gghardin1377/12/2023
Well it looks like you basically just fill it and then immediately remove it
Ppepega페페가7/12/2023
but i thought im removing the previous one, like: draw a rectangle, remember its position, draw another one at new position and remove the old one
Gghardin1377/12/2023
Previous.X is the same value as the one you used in fillRect
UUUnknown User7/12/2023
5 Messages Not Public
Sign In & Join Server To View
Ppepega페페가7/12/2023
yeah this works, its weird that no matter how much i think, my example still works in my head
UUUnknown User7/12/2023
2 Messages Not Public
Sign In & Join Server To View
Ppepega페페가7/12/2023
nah i cant think, in my head I am drawing a rectangle at x0 y0, then remembering its position for future and incrementing the actual x position, then erasing the old rectangle, does that mean that the rectangle will get drawn and removed immediately? if yes then it took me 3h to figure it out and i dont know how
Gghardin1377/12/2023
Yes That’s what your code says 🙂 Basically what you’d want to do is track the previous intervals state and remove that before you fill the current intervals rectangles So you’d basically need two loops One to remove the previous values and another to add the new ones And then you save the current ones as the previous Then you move
UUUnknown User7/12/2023
2 Messages Not Public
Sign In & Join Server To View
Ppepega페페가7/12/2023
yeah ur code works fine, i will try to implement more segments rn etc
UUUnknown User7/12/2023
2 Messages Not Public
Sign In & Join Server To View
Ppepega페페가7/12/2023
nah bro at first i wanted to make this shi online with socket.io AINTNOWAY
UUUnknown User7/14/2023
Message Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

pepega1337. – 15-15 Jul 12

Join Server