Skip to content

Latest commit

 

History

History
54 lines (26 loc) · 1.57 KB

userstory.md

File metadata and controls

54 lines (26 loc) · 1.57 KB

WORKSHOP

  1. Print to the console the width and height of the canvas.

  2. Draw a square to the center of the canvas.

  3. Draw a square to the corner of the canvas.

  4. Print to the console both square coordinate.

  5. Check the square coordinates. Are these points partible of the SIZE of the square edges.

  6. Create a square drawing function that takes 1 parameter: the square size and draws a square of that size to the center of the canvas.

  7. Create a loop that draws 20 squares with the previous function.

  8. Create a function that update the square coordinate each time when its invited.

  9. Move the square from the upper left corner to the upper right corner. Use setinterval.

USERSTORIES

Snake basics

  1. Create a snake object/function, that store the current position of the snake and the direction.

  2. Create a function that draw the snake current position.

  3. Create a function that update the snake current position based on direction.

Board basics

  1. Create a board object, which have a Snake object.

  2. Create a function, which draw the snake.

Main

  1. Invite board draw to the window.

Advance functions

  1. Snake. Create a function that set the snake direction based on keyboardkeys.

  2. Board. Create a function which reset the snake current position if reach the border.

  3. Board. Create random square to the canvas as food.

  4. Snake. Store body in snake. Add one more x y coordnate if food coordinate and snake coordinate is equal. The body has to be updated with the snake head.

  5. Reset the body and the initial coordinate if snake eats itself.