Code Monkey home page Code Monkey logo

snake-game-tutorial's People

Contributors

zassmin avatar zspencer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

snake-game-tutorial's Issues

DougM to convert these notes into separate issues, as needed

DougM to convert these notes into separate issues, or make a pull req, after the inaugural workshop (and post-workshop update).

These notes were extracted from multi-item "issues" that were closed once a single item had been handled.

Lesson 2:

  • Code explication at the bottom of the page is good. We should mention it up top.
  • How to comment in js?
  • "Get the value" of draw() "and execute it with the list" is hard to understand without functional thinking, and a basic understanding of an interpreted language.
  • typos -- parentheses (plural) and its (possessive pronoun)

Lesson 2 Play Time:

  • Level of handholding in the lesson contrasts starkly with the absence of handholding in the exercises:
  • how to comment (mechanically, and philosophically)
  • how do I figure out what colors are valid
  • have to figure out to add another pixel hash to the snake array to make it "longer" (or did I just make it wider? -- very little directionality implied by the data structure)
  • not very obvious to a noob that you can add more objects to the array to be drawn; if they copy and modify the original code to create a parallel set of commands for (e.g.) an apple, the snake seems to disappear from the canvas.
  • Explain camelCase convention?
  • Are you expecting them to open up and interpret chunk.js? Why all-caps in code?
  • Is there some habit about commenting a code file to say what (plus when and who) that we should be encouraging?

Lesson 3:

  • Do they empty snake.js and start with a clean file?
  • The added object from lesson 2 play time is not carried forward.
  • Might ask them what are the largest and smallest values for a "pixel" to be drawn.
  • Somewhat confusing to draw a box with many pixels and call it a pixel.

Lesson 4:

  • Definitely need to keep the Lesson 3 snake.js code and extend it for this round. Must save .js and refresh browser before using console.
  • typos: called; oldSegment's (possessive)
  • Why create a newSnake? Counter-intuitive to moving the old snake. Why not return [newSegment];? Have to do snake = moveSnake(snake); to move the snake, so the naming is confusing, too. snake is actually snakePosition, so overly simplified naming piles on unnecessary cognitive dissonance for the noob.
  • If chunk.js is functioning as a game engine, then it makes sense to separately call:

    snake = moveSnake(snake); // update cycle
    drawSnake(snake); // draw cycle
    but that's an advanced concept, and otherwise my lazy ass wants to go straight to:
    drawSnake(moveSnake(snake));
    which of course doesn't work because moveSnake(); doesn't move the snake.

  • I think snakePosition = movePosition(snakePosition); is a bit easier to grasp, but I could be totally wrong.

overall -- just do separate PRs for typos (one per file?)

Kill Sean

Doesn't seem to be helpful, often makes things more confusing.

Lesson 2 - Play time is hard/obtuse

Level of handholding in the lesson contrasts starkly with the absence of handholding in the exercises:

  • how to comment (mechanically, and philosophically)
  • how do I figure out what colors are valid
  • have to figure out to add another pixel hash to the snake array to make it "longer" (or did I just make it wider? -- very little directionality implied by the data structure)
  • not very obvious to a noob that you can add more objects to the array to be drawn; if they copy and modify the original code to create a parallel set of commands for (e.g.) an apple, the snake seems to disappear from the canvas.

Explain camelCase convention?

Are you expecting them to open up and interpret chunk.js? Why all-caps in code?

Is there some habit about commenting a code file to say what (plus when and who) that we should be encouraging?

Lesson 2's draw an apple extra doesn't lend itself well to teaching arrays.

Several of the intermediate students got caught on the CHUNK.draw function taking a collection of items to draw. Some would attempt to call it twice and it would clear the screen of the previous items.

A possibly more clear example would be to extract a drawableItems collection in lesson 2/3 instead of just calling CHUNK.draw([drawableSnake])

Lesson 3 - confusion

Do they empty snake.js and start with a clean file?

The added object from lesson 2 play time is not carried forward.

Might ask them what are the largest and smallest values for a "pixel" to be drawn.

Somewhat confusing to draw a box with many pixels and call it a pixel.

Lesson 2 - how to run the code?

Typing stuff into snake.js doesn't execute any code. Since I already spotted snake.js included in index.html, I figured out to save the source (in my text editor) and refresh the index page (in my browser).

Lesson 4 - typos and confusion

Definitely need to keep the Lesson 3 snake.js code and extend it for this round. Must save .js and refresh browser before using console.

typos:
let's (contraction)
called
segment's (possessive)

Why create a newSnake? Counter-intuitive to moving the old snake. Why not return [newSegment];? Have to do snake = moveSnake(snake); to move the snake, so the naming is confusing, too. snake is actually snakePosition, so overly simplified naming piles on unnecessary cognitive dissonance for the noob.

If chunk.js is functioning as a game engine, then it makes sense to separately call:
snake = moveSnake(snake); // update cycle drawSnake(snake); // draw cycle
but that's an advanced concept, and otherwise my lazy ass wants to go straight to:
drawSnake(moveSnake(snake));
which of course doesn't work because moveSnake(); doesn't move the snake.

I think snakePosition = movePosition(snakePosition); is a bit easier to grasp, but I could be totally wrong.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.