Which of those two parts of this task are you struggling with?
This is a great strategy to work on these sorts of things:
Imphenzia: How Did I Learn To Make Games:
Two steps to tutorials and / or example code:
do them perfectly, to the letter (zero typos, including punctuation and capitalization)
stop and understand each step to understand what is going on.
If you go past anything that you don’t understand, then you’re just mimicking what you saw without actually learning, essentially wasting your own time. It’s only two steps. Don’t skip either step.