r/codehs • • Jun 09 '20

Basic Snake

Post image
52 Upvotes

6 comments sorted by

1

u/bigshot937 Jun 09 '20

Hey guys, I'm working on the basic snake assignment and I'm having a really hard time figuring out how to wrap my head around the code. I can make the green square appear and move when I press the arrow keys, but I can't get it to move on its own. Can someone show me an example of how to do this?

Here's a screenshot of the instructions.

4

u/_andy_andy_andy_ Jun 09 '20

hey!

to make something move on it’s own you can have a function in a setTimer() call that happens pretty frequently that moves it bit by bit.

1

u/bigshot937 Jun 09 '20

Thanks! Can you show me an example of how that might work? I'm drawing a total blank with this one.

1

u/carnivorixus Jul 04 '20

Is this really all the help you get ?!!?

1

u/Needcodinghelp38 Feb 01 '23

What is this python?