Setup MAMP (local PHP/MySQL server)
Ducky Game
Finish prior sections or Nonograms for more practice
If you have not already, install MAMP on your computer. This will allow you to run a local server that can host PHP files and interact with a MySQL database. We will start using this more in the second half of the course, but we want to make sure everything is working now.
Note: there is more information on this under "Local Servers" on the course website's resources page.
Worktime for Ducky Game lab (following slides)
Finish prior sections or Nonograms for more practice
We have provided HTML
and CSS,
and a duck.svg files for the
Ducky Game. You are to implment ducky-game.js
, a file that adds
interactivity to the game (see following slides).
When the page loads, the Ducky Game should start.
20px
.
Hint: To get the current top and left values of an element, you will need to use window.getComputedStyle(). The reason for this is that we want to get the current value on the screen, not necessarily a value set in CSS (our CSS never even sets top or left values).
let top = window.getComputedStyle(element).top;
let left = window.getComputedStyle(element).left;
While fun as it is, the Ducky Game has a lot of room for growth! See if you can add some more features to make the game even more fun! Here are some suggestions of possible features to implment: