# Snake game error

**URL:** <https://discourse.processing.org/t/snake-game-error/31389>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [July 22, 2021, 4:52pm UTC](https://discourse.processing.org/t/snake-game-error/31389 "2021-07-22T16:52:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xavier](https://avatars.discourse-cdn.com/v4/letter/x/2bfe46/32.png) [@Xavier](https://discourse.processing.org/u/Xavier)\
**Post date:** [July 22, 2021, 4:52pm UTC](https://discourse.processing.org/t/snake-game-error/31389/1 "2021-07-22T16:52:53Z")

</div>

Hi everyone,

Iam making a snake game for my class but it has to have an interactive aproach, so my idea was that every time the snake eat an apple an image in the background would appear, so you would win the game when the 22 pictures were in the background but i dont know how to do that tipe of coding can someone help me.  
Thx for all answers

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [July 23, 2021, 10:12am UTC](https://discourse.processing.org/t/snake-game-error/31389/2 "2021-07-23T10:12:06Z")

</div>

Why not …

```auto
maximages = 10
for each loop:
 move snake
 if snake touch apple
    eat apple
    imagecounter + 1 
    show image for imagecounter
    if (imagecounter reach maximages)
      player win game

```

Cheers!
