Dissect the Typography Game
We are looking forward to tonight’s meeting at 25N where we will be taking a deeper dive into the inner workings of the typography game.
Explore the answers to these questions and more:
- How does clicking a button or pressing a key cause something to happen on the Web page? The keydown and click events! What is an event listener? What is an event handler? What is a keycode? Reference: Keycode lookup
- How do we define a single object that can represent either the player or the “bad guy” in the game? Define a function that is used as an object constructor; within the function define methods such as “move” and “setSpeed”. Use the keyword “new” to create named instances of the class – “hero” and “enemy”. Use those named instances to control the players. Examples: hero.move() or enemy.setSpeed(speed * 23)