Object-oriented Programming in JavaScript
Posted on May 11th, 2020
Today’s topics
- Intro to object-oriented programming in JS
- Using classes in JS
- Building games in JS
- using requestAnimationFrame
- the Canvas API
Project
Build a game
This project is due on Thursday, May 14.
Study groups for this project are to encourage you to put your heads together to solve the problems this project poses. You will need to wrestle with this material; read other people’s code; take that code apart and run it, change it, and break it to understand what it’s doing; read documentation and just try stuff until things start to click for you. Doing this with other people will help a lot!
- Dave/Sarah/Britton
- Alyshia/Ben/Luke
- Ashley/Danny/Steve/Kaley
- Iziz/Hanny/Blake/Aaron
TODO for tonight
Whew! Today was a lot. To recap, below are some strategies I recommend to get started. Mix and match! You don’t have to do these in order, but I would strongly recommend beginning with reading the updated space invaders code.
- Watch Mary Rose Cook’s video again; read her annotated code. Get the updated space invaders code from our examples repo and run it locally. Read that code, change it, and see what happens. See if you can start to understand what is happening. (Links to all of these things below)
- Play with the Canvas API and requestAnimationFrame. Both of these are used in the space invaders code. See if you can write code to draw a player on the screen in your own browser.
- Play the games that are provided as options in the homework assignment. Begin to write a CRC model for the one that you feel most interested in.
End of Phase Project
Instructions for technical presentations
Links and resources
- MDN OO in JS for Beginners
- MDN
this
this
in JS explained simply- Class-Responsibility-Collaborator model
- Mary Rose Cook live codes space invaders
- Mary Rose Cook’s annotated space invaders code
- animation with requestAnimationFrame
- How to use requestAnimationFrame
- MDN Canvas API
- 2D Collision Detection in JS
⭐️EXTRA/TMI
Code, slides, and video from class
- class slides PDF
- Revised Space Invaders example
- CRC model notes
- morning class video Access Password: 9B#2D44E
- afternoon class video Access Password: 5h$2$776