railsbridge / snake-game-tutorial Goto Github PK
View Code? Open in Web Editor NEWA walkthrough for novice programmers to make a simple game.
License: Other
A walkthrough for novice programmers to make a simple game.
License: Other
This makes it so the first time people try to end the game it doesn't give a message.
Text says that CHUNK is moving the game forward, but advanceGame() is in snake.js.
typo:
argument
A few students didn't have the technical words to express why we replace the snake. It would be great to make it more obvious that the snake in the global scope is different than the snake in moveSnake.
remove 'if' in between 'on' and 'the'
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:
Lesson 2 Play Time:
Lesson 3:
Lesson 4:
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.
overall -- just do separate PRs for typos (one per file?)
Doesn't seem to be helpful, often makes things more confusing.
Level of handholding in the lesson contrasts starkly with the absence of handholding in the exercises:
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?
The alert is annoying because it takes focus. Let's add a function to CHUNK to writeText or something.
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])
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.
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).
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.