pepega1337. – 15-15 Jul 12

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
13 Replies
ghardin137
ghardin1372y ago
Well it looks like you basically just fill it and then immediately remove it
pepega페페가
pepega페페가OP2y ago
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
ghardin137
ghardin1372y ago
Previous.X is the same value as the one you used in fillRect
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
pepega페페가
pepega페페가OP2y ago
yeah this works, its weird that no matter how much i think, my example still works in my head
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
pepega페페가
pepega페페가OP2y ago
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
ghardin137
ghardin1372y ago
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
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
pepega페페가
pepega페페가OP2y ago
yeah ur code works fine, i will try to implement more segments rn etc
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
pepega페페가
pepega페페가OP2y ago
nah bro at first i wanted to make this shi online with socket.io AINTNOWAY
reactibot
reactibot2y ago
This thread hasn’t had any activity in 36 hours, so it’s now locked. Threads are closed automatically after 36 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1128706270728290334

Did you find this page helpful?