It's not too hard, but it does require us to modify our Javascript code.
The game should not have changed at all.
If some images stopped working, then ask an instructor for help.
The script
in the head
tag is telling our website to include the Javascript Processing libraries.
The script
in the body
tag is where the actual game canvas will be created using the game code inside of index.js
.
For example, the arrow keys probably wont work when testing your movement.
This is because the variables LEFT, RIGHT, UP, and DOWN are not defined.
How else can we compare the keyCode values?
Hint: http://keycode.info/
Teach coding to your students with MVCode Teach
MVCode offers an integrated product designed to teach coding to students.