- If you are coding outside of WoofJS.com (like in Sublime), insert the Woof_JS source tag into the <head>section of your project page:
<script src="https://rawgit.com/stevekrouse/WoofJS/master/dist/woof.js"></script>
Your code now speaks Woof!
- Find an appropriate backdrop (jungle, dessert) and add the url to the setBackdropURL call.
- Create an image sprite for your bird and start it in the middle of the screen.
- Add a forever function to your code. Inside the forever function, have your bird drop down continuously.
- Then, if you are pressing a key, have the bird fly up. Play-balance this so the bird looks like its flying.
- Add an array called obstacles.
- Find transparent images for your top and bottom obstaces -nets, pipes, dragons etc...
- Outside the forever loop, add an Every loop that creates a new pair of obstacles every X seconds, and pushes them into the obstacles array.
Make the nets come out at different heights by making the y value a random number.
- Inside the forever loop, add a forEach loop that cycles through all the obstacles.
obstacles.forEach ( net => { //move each net to the left //if the net has reached the left side of the screen, delete it })
- Declare a text label for the score using a Text sprite.
- If the bird passes thru the nets without touching, earn some points.
- Check if a net has hit the bird. If so, lose points. Show an "och" sprite or similar. If you have less than 0 points, end the game.
- Play a "squak" sound every couple of seconds. Or play a fun Brazilian soundtrack.
- Keep working on the project and customizing until you are satisfied.
Ask your teacher/TA to upload it to your public folder.