Class 07 – 2016-10-25: Javascript: Canvas, Functions, Events
New problem set ps-07
Today is different.
Not spending much time reviewing work.
More working together.
Questions and review problem set: 5:45 – 6:45
- Review ps-06
- Finish ps-06 together.
- Change the
drawImage
calls to use absolute paths.
- Explain that if required.
- Work on code to combine corpses together.
Some programming topics: 6:45 - 7:15
Objects:
- How to define
- How to use
- Add a variable to an object
- Add a function to an object
- 'Exporting' functions via global namespace
Arrays
- Define an array
- Look into an array
- Iterate through an array
Together in codePen
To show how events work, and how we can update the contents of our web page in reaction to events. Start by adding text to a document logging when events happen. Then maybe draw stuff on a canvas when things happen.
- setTimeout
- setInterval
- animation frame
- click handling
- mouse handling
- keyboard handling
Dom and Events:
document.getElementByID();
document.querySelector();
document.addEventListener("click", modifyText);
See CodePen
In Class: Get started on Instrument 7:00 - 8:45