# Snake Game problem: having trouble figuring out how to make it reset

**URL:** https://discourse.processing.org/t/snake-game-problem-having-trouble-figuring-out-how-to-make-it-reset/6005
**Category:** Coding Questions
**Created:** [November 27, 2018, 6:54pm UTC](https://discourse.processing.org/t/snake-game-problem-having-trouble-figuring-out-how-to-make-it-reset/6005 "2018-11-27T18:54:38Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![TfGuy44](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tfguy44/32/41_2.png) [@TfGuy44](https://discourse.processing.org/u/TfGuy44)
#### Post date: [November 27, 2018, 11:21pm UTC](https://discourse.processing.org/t/snake-game-problem-having-trouble-figuring-out-how-to-make-it-reset/6005/2 "2018-11-27T23:21:58Z")

</div>

> [@blankbleak](#):
>
> ```auto
> startingLength=5;
> //starting length is 5
> 
> ```

Pet peeve: Don’t do this. Code that is self-explanatory doesn’t need useless comments.

* * *

Your code has some real problems. For a start, what are you doing inside `draw()`?  
Normally, people making a snake game would clear the background in `draw()`, and then draw the snake. But you aren’t doing either of these things! Instead, your `draw()` function is… resetting the snake?!?

This isn’t the sort of things we can help fix. It’s a glaring logical issue. Did you develop this code step by step?

* * *

I recently did snake. I suggest you go have a look over here:

> [@Problems with understanding language](https://discourse.processing.org/t/problems-with-understanding-language/3016/4):
>
> So why doesn’t the tail grow now? Well, it never did, did it? The problem is that append() returns an array - it doesn’t assign that array to anything. Basically, whoever wrote this didn’t use append() properly. There are several other problems with this code as well. But I think the biggest problem, really, is that you ALREADY HAD this code. The best thing to do would be to take this code as an example and write a BETTER VERSION yourself, from scratch. So let’s do that. Start with an empty s…

---

_[View the full topic](https://discourse.processing.org/t/snake-game-problem-having-trouble-figuring-out-how-to-make-it-reset/6005)._
