Browse Source

implement lesson02

lesson02
Constantin Fürst 6 months ago
parent
commit
9b5ebb03d5
  1. 6
      LESSONS.md

6
LESSONS.md

@ -40,4 +40,8 @@ Every little snake needs to eat. And no snake will appear without food, which is
2) A Snack must be placed at a random point when generating, so set its x and y value to a random value that fits on the playing field (see the comment in the function skeleton for a hint).
3) A Snack must also look enticing, so set its image to the one defined as SNACK_CHAR and then display the delicious snack.
4) Experiment and use __mainL02__ to test if your code works.
5) Notice anything interesting with how we pass the Point to the generateSnack-function? The function requests a pointer which is the address of an object instance. To get the address of an existing object, we use operator&. Read up on pointers and references.
5) Notice anything interesting with how we pass the Point to the generateSnack-function? The function requests a pointer which is the address of an object instance. To get the address of an existing object, we use operator&. Read up on pointers and references.
Once you're ready, you can _git merge lesson03_.
---
Loading…
Cancel
Save