├── .gitignore ├── README ├── attribution_and_licensing ├── atomjs.txt ├── craftyjs.txt ├── easeljs.txt ├── enchantjs.txt ├── gamejs.txt ├── gamequery.txt ├── impressjs.txt ├── jaws.txt ├── jquery.txt ├── melonjs.txt ├── nodejs.txt ├── npm.txt ├── raptorize.txt └── yabble.txt ├── errata └── chapter1 ├── fighting ├── after_recipe1 │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ └── yabble.js ├── after_recipe2 │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ └── yabble.js ├── after_recipe3 │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ └── yabble.js ├── after_recipe4 │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ └── yabble.js ├── after_recipe5 │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ └── yabble.js ├── after_recipe6 │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ └── yabble.js ├── after_recipe7 │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ ├── sprites_big.png │ └── yabble.js ├── final │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ ├── sprites_big.png │ └── yabble.js └── initial │ ├── game.js │ ├── index.html │ ├── main.js │ ├── sprites.png │ └── yabble.js ├── fps ├── after_recipe1 │ ├── dino.png │ ├── game.css │ ├── game.js │ ├── index.html │ └── jaws.js ├── after_recipe2 │ ├── dino.png │ ├── game.css │ ├── game.js │ ├── index.html │ └── jaws.js ├── after_recipe3 │ ├── dino.png │ ├── game.css │ ├── game.js │ ├── index.html │ └── jaws.js ├── after_recipe4 │ ├── dino.png │ ├── game.css │ ├── game.js │ ├── index.html │ └── jaws.js ├── after_recipe5 │ ├── dino.png │ ├── game.css │ ├── game.js │ ├── index.html │ └── jaws.js ├── after_recipe6 │ ├── camera.png │ ├── dino.png │ ├── filtrr2.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── jaws.js │ └── jquery.js ├── after_recipe7 │ ├── camera.png │ ├── dino.png │ ├── filtrr2.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── jaws.js │ └── jquery.js ├── final │ ├── camera.png │ ├── dino.png │ ├── filtrr2.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── jaws.js │ └── jquery.js └── initial │ ├── dino.png │ ├── game.css │ ├── game.js │ ├── index.html │ └── jaws.js ├── interactive_fiction ├── after_recipe1 │ ├── impress.js │ ├── index.html │ └── main.css ├── after_recipe2 │ ├── impress.js │ ├── index.html │ └── main.css ├── after_recipe3 │ ├── bat.png │ ├── dragDrop.js │ ├── game.js │ ├── impress.js │ ├── index.html │ └── main.css ├── after_recipe4 │ ├── bat.png │ ├── dino.png │ ├── dragDrop.js │ ├── game.js │ ├── impress.js │ ├── index.html │ └── main.css ├── after_recipe5 │ ├── bat.png │ ├── dino.png │ ├── dragDrop.js │ ├── game.js │ ├── impress.js │ ├── index.html │ └── main.css ├── final │ ├── bat.png │ ├── dino.png │ ├── dragDrop.js │ ├── game.js │ ├── impress.js │ ├── index.html │ ├── jquery-1.4.1.min.js │ ├── jquery.raptorize.1.0.js │ ├── main.css │ ├── raptor-sound.mp3 │ ├── raptor-sound.ogg │ └── raptor.png └── initial │ ├── impress.js │ └── index.html ├── party ├── after_recipe1 │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ ├── game.js │ └── index.html ├── after_recipe2 │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ ├── game.js │ └── index.html ├── after_recipe3 │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ ├── game.js │ └── index.html ├── after_recipe4 │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ ├── game.js │ └── index.html ├── after_recipe5 │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ ├── game.js │ └── index.html ├── after_recipe6 │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ ├── game.js │ └── index.html ├── final │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ ├── game.js │ └── index.html └── initial │ ├── README.md │ ├── atom.coffee │ ├── atom.js │ └── index.html ├── platformers ├── after_recipe1 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── melon.js │ ├── player.png │ └── titleScreen.png ├── after_recipe2 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── after_recipe3 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── after_recipe4 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── after_recipe5 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── after_recipe6 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── after_recipe7 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── after_recipe8 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── after_recipe9 │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png ├── final │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── entities.js │ ├── index.html │ ├── level1.tmx │ ├── levelSprites.png │ ├── main.js │ ├── melon.js │ ├── player.png │ ├── resources.js │ ├── screens.js │ └── titleScreen.png └── initial │ ├── badGuy.png │ ├── boots.png │ ├── coin.png │ ├── collision.png │ ├── index.html │ ├── levelSprites.png │ ├── melon.js │ ├── player.png │ └── titleScreen.png ├── puzzle ├── after_recipe1 │ ├── easel.js │ └── index.html ├── after_recipe2 │ ├── easel.js │ └── index.html ├── after_recipe3 │ ├── easel.js │ └── index.html ├── after_recipe4 │ ├── easel.js │ └── index.html ├── after_recipe5 │ ├── easel.js │ └── index.html ├── after_recipe6 │ ├── easel.js │ └── index.html ├── after_recipe7 │ ├── easel.js │ └── index.html ├── final │ ├── easel.js │ └── index.html └── initial │ ├── easel.js │ └── index.html ├── quiz ├── after_recipe1 │ ├── index.html │ └── main.css ├── after_recipe2 │ ├── index.html │ └── main.css ├── after_recipe3 │ ├── game.js │ ├── index.html │ ├── jquery.js │ └── main.css ├── after_recipe4 │ ├── atom.js │ ├── crafty.js │ ├── easel.js │ ├── enchant.js │ ├── game.js │ ├── impress.js │ ├── index.html │ ├── jaws.js │ ├── jquery.gamequery.js │ ├── jquery.js │ ├── main.css │ ├── melon.js │ └── yabble.js ├── final │ ├── atom.js │ ├── crafty.js │ ├── easel.js │ ├── enchant.js │ ├── game.js │ ├── impress.js │ ├── index.html │ ├── jaws.js │ ├── jquery.gamequery.js │ ├── jquery.js │ ├── main.css │ ├── melon.js │ └── yabble.js └── initial │ ├── index.html │ └── main.css ├── rpg ├── after_recipe1 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ └── sprites.png ├── after_recipe2 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── after_recipe3 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── after_recipe4 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── after_recipe5 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── after_recipe6 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── after_recipe7 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── after_recipe8 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── after_recipe9 │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png ├── final │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ ├── map.js │ └── sprites.png └── initial │ ├── enchant.js │ ├── game.css │ ├── game.js │ ├── index.html │ ├── items.png │ └── sprites.png ├── rts ├── after_recipe1 │ ├── .gitignore │ ├── crafty.js │ ├── httpserver.js │ ├── socket.io.js │ └── sprites.png ├── after_recipe2 │ ├── .gitignore │ ├── crafty.js │ ├── game.js │ ├── httpserver.js │ ├── index.html │ ├── server.js │ ├── socket.io.js │ └── sprites.png ├── after_recipe3 │ ├── .gitignore │ ├── crafty.js │ ├── game.js │ ├── httpserver.js │ ├── index.html │ ├── server.js │ ├── socket.io.js │ └── sprites.png ├── after_recipe4 │ ├── .gitignore │ ├── crafty.js │ ├── game.js │ ├── httpserver.js │ ├── index.html │ ├── server.js │ ├── socket.io.js │ └── sprites.png ├── after_recipe5 │ ├── .gitignore │ ├── crafty.js │ ├── game.js │ ├── httpserver.js │ ├── index.html │ ├── server.js │ ├── socket.io.js │ └── sprites.png ├── after_recipe6 │ ├── .gitignore │ ├── crafty.js │ ├── game.js │ ├── httpserver.js │ ├── index.html │ ├── server.js │ ├── socket.io.js │ └── sprites.png ├── final │ ├── .gitignore │ ├── crafty.js │ ├── game.js │ ├── httpserver.js │ ├── index.html │ ├── server.js │ ├── socket.io.js │ └── sprites.png └── initial │ ├── .gitignore │ ├── crafty.js │ ├── socket.io.js │ └── sprites.png └── shooter ├── after_recipe1 ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── game.js ├── index.html ├── jquery.gamequery.js └── jquery.js ├── after_recipe2 ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── game.css ├── game.js ├── index.html ├── jquery.gamequery.js └── jquery.js ├── after_recipe3 ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── game.css ├── game.js ├── index.html ├── jquery.gamequery.js └── jquery.js ├── after_recipe4 ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── game.css ├── game.js ├── index.html ├── jquery.gamequery.js └── jquery.js ├── after_recipe5 ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── game.css ├── game.js ├── index.html ├── jquery.gamequery.js └── jquery.js ├── final ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── game.css ├── game.js ├── index.html ├── jquery.gamequery.js └── jquery.js └── initial ├── background1.png ├── background2.png ├── background3.png ├── background4.png ├── index.html ├── jquery.gamequery.js └── jquery.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_STORE 2 | *.sw* 3 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | These are the source files for The Web Game Developer's Cookbook: 2 | www.amazon.com/The-Web-Game-Developers-Cookbook/dp/0321898389 3 | 4 | The games can be played and hacked on without the book, but they may not make as much sense without having that context. In addition to explaining every line of code, the book has terminology, points to resources, covers patterns in JavaScript, and is even kind of funny in places. 5 | 6 | A note for the pirates: If you end up reading the book via a pirated PDF download somewhere, I can't stop you and I still genuinely hope that you get something out of it. I know you're real people too, and some of you might genuinely not have the cash. Under normal ciricumstances, I'd say "it's totally fine," but the book is Pearson's property as much as mine, so I can't say that. In providing the code and sprites in the games, I am giving away as much as I legally can for free. I think that the skills taught inside are highly valuable. If this is your first step to a career as a game developer, that could be worth anywhere from around 2,500 times (normal salaried folk) to 2.5 million times (absurdly lucky and absurdly smart folk) the price of the book. Granted this book wouldn't come close to being wholely responsible for your success, but for whatever part it does play, I think the price is fair. If you're just making games for fun, and if the standard unit of fun dollars is the cost of one night out for two people going to dinner & seeing a movie, this book costs approximately one unit of fun dollars, which I also think is fair. 7 | 8 | Let me know if you have any questions about anything with an email to: evan.burchard+jsarcade@gmail.com 9 | 10 | As far as licensing, the games can operate under whatever license the packages used within will allow. Do whatever you want within those restrictions. None of the code I wrote carries any restrictions beyond respecting those licenses. 11 | 12 | All of the sprites used in the game were drawn by Evan Burchard. As with the code, feel free to hack on them. Give Evan attribution by pointing here or at the amazon link if you're feeling charitable. 13 | -------------------------------------------------------------------------------- /attribution_and_licensing/atomjs.txt: -------------------------------------------------------------------------------- 1 | https://github.com/nornagon/atom 2 | 3 | Copyright (c) 2012, Jeremy Apthorp 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /attribution_and_licensing/craftyjs.txt: -------------------------------------------------------------------------------- 1 | https://github.com/craftyjs/Crafty 2 | 3 | Copyright 2010, Louis Stowasser 4 | Dual licensed under the MIT or GPL licenses. 5 | 6 | http://www.opensource.org/licenses/mit-license.php 7 | http://www.opensource.org/licenses/gpl-license.php 8 | -------------------------------------------------------------------------------- /attribution_and_licensing/easeljs.txt: -------------------------------------------------------------------------------- 1 | https://github.com/CreateJS/EaselJS 2 | 3 | gskinner.com 4 | 5 | http://www.opensource.org/licenses/mit-license.php 6 | -------------------------------------------------------------------------------- /attribution_and_licensing/enchantjs.txt: -------------------------------------------------------------------------------- 1 | https://github.com/wise9/enchant.js 2 | 3 | Copyright (c) 2011-2012 Ubiquitous Entertainment Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /attribution_and_licensing/gamejs.txt: -------------------------------------------------------------------------------- 1 | https://github.com/oberhamsi/gamejs 2 | 3 | Simon Oberhammer 4 | MIT License: http://opensource.org/licenses/mit-license.php 5 | -------------------------------------------------------------------------------- /attribution_and_licensing/gamequery.txt: -------------------------------------------------------------------------------- 1 | https://github.com/onaluf/gameQuery 2 | 3 | Selim Arsever 4 | https://selim.arsever.ch 5 | MIT License: http://opensource.org/licenses/mit-license.php 6 | -------------------------------------------------------------------------------- /attribution_and_licensing/impressjs.txt: -------------------------------------------------------------------------------- 1 | Copyright 2011-2012 Bartek Szopka 2 | 3 | Dual licensed under the MIT or GPL licenses. 4 | 5 | http://www.opensource.org/licenses/mit-license.php 6 | http://www.opensource.org/licenses/gpl-license.php 7 | -------------------------------------------------------------------------------- /attribution_and_licensing/jquery.txt: -------------------------------------------------------------------------------- 1 | https://github.com/jquery/jquery 2 | 3 | Copyright 2012 jQuery Foundation and other contributors 4 | http://jquery.com/ 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining 7 | a copy of this software and associated documentation files (the 8 | "Software"), to deal in the Software without restriction, including 9 | without limitation the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the Software, and to 11 | permit persons to whom the Software is furnished to do so, subject to 12 | the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /attribution_and_licensing/melonjs.txt: -------------------------------------------------------------------------------- 1 | https://github.com/obiot/melonJS 2 | 3 | Copyright (C) <2012> by 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /attribution_and_licensing/npm.txt: -------------------------------------------------------------------------------- 1 | https://github.com/isaacs/npm 2 | 3 | Copyright (c) Isaac Z. Schlueter (the "Original Author") 4 | All rights reserved. 5 | 6 | MIT +no-false-attribs License 7 | 8 | Permission is hereby granted, free of charge, to any person 9 | obtaining a copy of this software and associated documentation 10 | files (the "Software"), to deal in the Software without 11 | restriction, including without limitation the rights to use, 12 | copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the 14 | Software is furnished to do so, subject to the following 15 | conditions: 16 | 17 | The above copyright notice and this permission notice shall be 18 | included in all copies or substantial portions of the Software. 19 | 20 | Distributions of all or part of the Software intended to be used 21 | by the recipients as they would use the unmodified Software, 22 | containing modifications that substantially alter, remove, or 23 | disable functionality of the Software, outside of the documented 24 | configuration mechanisms provided by the Software, shall be 25 | modified such that the Original Author's bug reporting email 26 | addresses and urls are either replaced with the contact information 27 | of the parties responsible for the changes, or removed entirely. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 30 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 31 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 32 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 33 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 34 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 35 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 36 | OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | 39 | Except where noted, this license applies to any and all software 40 | programs and associated documentation files created by the 41 | Original Author, when distributed with the Software. 42 | 43 | "Node.js" and "node" trademark Joyent, Inc. npm is not officially 44 | part of the Node.js project, and is neither owned by nor 45 | officially affiliated with Joyent, Inc. 46 | 47 | Packages published in the npm registry (other than the Software and 48 | its included dependencies) are not part of npm itself, are the sole 49 | property of their respective maintainers, and are not covered by 50 | this license. 51 | 52 | "npm Logo" created by Mathias Pettersson and Brian Hammond, 53 | used with permission. 54 | 55 | "Gubblebum Blocky" font 56 | Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com 57 | included for use in the npm website and documentation, 58 | used with permission. 59 | 60 | This program uses "request", Copyright (c) Mikeal Rogers, 61 | according to the terms of the Apache license. 62 | 63 | This program uses "mkdirp", Copyright (c) James Halliday, 64 | according to the terms of the MIT/X11 license. 65 | 66 | This program uses "opener", Copyright (c) Domenic Denicola, 67 | according to the terms of the DWTFPL2 license. 68 | -------------------------------------------------------------------------------- /attribution_and_licensing/raptorize.txt: -------------------------------------------------------------------------------- 1 | http://www.zurb.com/playground/jquery-raptorize 2 | 3 | Copyright ZURB, freely available for distribution under the MIT license. 4 | 5 | Raptor Assets: Phil Coffman and Noah Stokes 6 | -------------------------------------------------------------------------------- /attribution_and_licensing/yabble.txt: -------------------------------------------------------------------------------- 1 | https://github.com/jbrantly/yabble 2 | 3 | Copyright (c) 2010 James Brantly 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /errata/chapter1: -------------------------------------------------------------------------------- 1 | Listing 1.14 2 | 3 | This code is given: 4 | if(jQuery){ 5 | var checkAnswers = function(){ 6 | var answerString = ""; 7 | var answers = $(":checked"); 8 | answers.each(function(i) { 9 | answerString = answerString + answers[i].value; 10 | }); 11 | $(":checked").each(function(i) { 12 | var answerString = answerString + answers[i].value; 13 | }); 14 | checkIfCorrect(answerString); 15 | }; 16 | var checkIfCorrect = function(theString){ 17 | if(parseInt(theString, 16) === 811124566973){ 18 | $("body").addClass("correct"); 19 | $("h1").text("You Win!"); 20 | $("canvas").show(); 21 | } 22 | }; 23 | $("#question1").show(); 24 | } 25 | 26 | There is no need for the following code: 27 | $(":checked").each(function(i) { 28 | var answerString = answerString + answers[i].value; 29 | }); 30 | 31 | Listing 1.14 should read as follows: 32 | if(jQuery){ 33 | var checkAnswers = function(){ 34 | var answerString = ""; 35 | var answers = $(":checked"); 36 | answers.each(function(i) { 37 | answerString = answerString + answers[i].value; 38 | }); 39 | checkIfCorrect(answerString); 40 | }; 41 | var checkIfCorrect = function(theString){ 42 | if(parseInt(theString, 16) === 811124566973){ 43 | $("body").addClass("correct"); 44 | $("h1").text("You Win!"); 45 | $("canvas").show(); 46 | } 47 | }; 48 | $("#question1").show(); 49 | } 50 | -------------------------------------------------------------------------------- /fighting/after_recipe1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/after_recipe1/main.js: -------------------------------------------------------------------------------- 1 | var gamejs = require('gamejs'); 2 | var screenWidth = 1200; 3 | var screenHeight = 600; 4 | var scale = 8; 5 | var spriteSheetWidth = 64; 6 | var spriteSheetHeight = 16; 7 | 8 | function main() { 9 | var display = gamejs.display.setMode([screenWidth, screenHeight]); 10 | var sprites = gamejs.image.load('sprites.png'); 11 | sprites = gamejs.transform.scale(sprites, [spriteSheetWidth*scale, spriteSheetHeight*scale]); 12 | display.blit(sprites); 13 | }; 14 | gamejs.preload(['sprites.png']); 15 | gamejs.ready(main); 16 | -------------------------------------------------------------------------------- /fighting/after_recipe1/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe1/sprites.png -------------------------------------------------------------------------------- /fighting/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/after_recipe2/main.js: -------------------------------------------------------------------------------- 1 | var gamejs = require('gamejs'); 2 | var screenWidth = 1200; 3 | var screenHeight = 600; 4 | var scale = 8; 5 | var spriteSize = 16; 6 | var numSprites = 4; 7 | 8 | function scaleUp(image){ 9 | return gamejs.transform.scale(image, [spriteSize*scale, spriteSize*scale]); 10 | }; 11 | 12 | function main() { 13 | var display = gamejs.display.setMode([screenWidth, screenHeight]); 14 | var sprites = gamejs.image.load('sprites.png'); 15 | var surfaceCache = []; 16 | for (var i = 0; i < numSprites; i++){ 17 | var surface = new gamejs.Surface([spriteSize, spriteSize]); 18 | var rect = new gamejs.Rect(spriteSize*i, 0, spriteSize, spriteSize); 19 | var imgSize = new gamejs.Rect(0, 0, spriteSize, spriteSize); 20 | surface.blit(sprites, imgSize, rect); 21 | surfaceCache.push(surface); 22 | }; 23 | for (var i=0; i < surfaceCache.length; i++) { 24 | var sprite = scaleUp(surfaceCache[i]); 25 | display.blit(sprite, [i*spriteSize*scale, spriteSize*i*scale]); 26 | }; 27 | }; 28 | gamejs.preload(['sprites.png']); 29 | gamejs.ready(main); 30 | -------------------------------------------------------------------------------- /fighting/after_recipe2/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe2/sprites.png -------------------------------------------------------------------------------- /fighting/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/after_recipe3/main.js: -------------------------------------------------------------------------------- 1 | var gamejs = require('gamejs'); 2 | var screenWidth = 1200; 3 | var screenHeight = 600; 4 | var scale = 8; 5 | var spriteSize = 16; 6 | var numSprites = 4; 7 | 8 | function scaleUp(image){ 9 | return gamejs.transform.scale(image, [spriteSize*scale, spriteSize*scale]); 10 | }; 11 | function Player(placement, sprite){ 12 | this.placement = placement; 13 | this.sprite = sprite; 14 | }; 15 | Player.prototype.draw = function(display) { 16 | sprite = scaleUp(this.sprite); 17 | display.blit(sprite, [spriteSize+this.placement, spriteSize]); 18 | }; 19 | 20 | function main() { 21 | var display = gamejs.display.setMode([screenWidth, screenHeight]); 22 | var sprites = gamejs.image.load('sprites.png'); 23 | var surfaceCache = []; 24 | for (var i = 0; i < numSprites; i++){ 25 | var surface = new gamejs.Surface([spriteSize, spriteSize]); 26 | var rect = new gamejs.Rect(spriteSize*i, 0, spriteSize, spriteSize); 27 | var imgSize = new gamejs.Rect(0, 0, spriteSize, spriteSize); 28 | surface.blit(sprites, imgSize, rect); 29 | surfaceCache.push(surface); 30 | }; 31 | var rock = surfaceCache[0]; 32 | var paper = surfaceCache[1]; 33 | var scissors = surfaceCache[2]; 34 | var person = surfaceCache[3]; 35 | function handleEvent(event) { 36 | if(gamejs.event.KEY_DOWN){ 37 | if(event.key === gamejs.event.K_UP){ 38 | player2.sprite = person; 39 | }else if(event.key === gamejs.event.K_DOWN){ 40 | player2.sprite = paper; 41 | }else if(event.key === gamejs.event.K_RIGHT){ 42 | player2.sprite = scissors; 43 | }else if(event.key === gamejs.event.K_LEFT){ 44 | player2.sprite = rock; 45 | }else if(event.key === gamejs.event.K_w){ 46 | player1.sprite = person; 47 | }else if(event.key === gamejs.event.K_a){ 48 | player1.sprite = rock; 49 | }else if(event.key === gamejs.event.K_s){ 50 | player1.sprite = paper; 51 | }else if(event.key === gamejs.event.K_d){ 52 | player1.sprite = scissors; 53 | } 54 | } 55 | }; 56 | function gameTick(msDuration) { 57 | gamejs.event.get().forEach(function(event) { 58 | handleEvent(event); 59 | }); 60 | display.clear(); 61 | player1.draw(display); 62 | player2.draw(display); 63 | }; 64 | var player1 = new Player(0, person); 65 | var player2 = new Player(200, person); 66 | gamejs.time.fpsCallback(gameTick, this, 60); 67 | }; 68 | gamejs.preload(['sprites.png']); 69 | gamejs.ready(main); 70 | -------------------------------------------------------------------------------- /fighting/after_recipe3/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe3/sprites.png -------------------------------------------------------------------------------- /fighting/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/after_recipe4/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe4/sprites.png -------------------------------------------------------------------------------- /fighting/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/after_recipe5/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe5/sprites.png -------------------------------------------------------------------------------- /fighting/after_recipe6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/after_recipe6/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe6/sprites.png -------------------------------------------------------------------------------- /fighting/after_recipe7/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/after_recipe7/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe7/sprites.png -------------------------------------------------------------------------------- /fighting/after_recipe7/sprites_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/after_recipe7/sprites_big.png -------------------------------------------------------------------------------- /fighting/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fighting 5 | 6 | 7 | 11 | 12 | 13 |
14 | Loading... 15 |
16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /fighting/final/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/final/sprites.png -------------------------------------------------------------------------------- /fighting/final/sprites_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/final/sprites_big.png -------------------------------------------------------------------------------- /fighting/initial/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/initial/index.html -------------------------------------------------------------------------------- /fighting/initial/main.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/initial/main.js -------------------------------------------------------------------------------- /fighting/initial/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fighting/initial/sprites.png -------------------------------------------------------------------------------- /fps/after_recipe1/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe1/dino.png -------------------------------------------------------------------------------- /fps/after_recipe1/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | -------------------------------------------------------------------------------- /fps/after_recipe1/game.js: -------------------------------------------------------------------------------- 1 | var Game = function(){ 2 | this.setup = function() { 3 | alert("running setup"); 4 | }; 5 | } 6 | -------------------------------------------------------------------------------- /fps/after_recipe1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /fps/after_recipe2/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe2/dino.png -------------------------------------------------------------------------------- /fps/after_recipe2/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | #minimap{ 8 | border:1px solid black; 9 | position:absolute; 10 | top:350px; 11 | width:300px; 12 | height:300px; 13 | } 14 | -------------------------------------------------------------------------------- /fps/after_recipe2/game.js: -------------------------------------------------------------------------------- 1 | var Game = function(){ 2 | var map = [ [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1], 3 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 4 | [1,-1,-1,-1,-1,-1,-1,0,-1,2,3,1,-1,-1,-1,1], 5 | [1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 6 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 7 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 8 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 9 | [1,-1,3,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 10 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,2,-1,-1,-1,1], 11 | [1,-1,-1,1,-1,-1,-1,-1,-1,3,-1,-1,-1,-1,-1,1], 12 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 13 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 14 | [1,-1,-1,-1,-1,-1,1,-1,-1,2,-1,-1,-1,-1,-1,1], 15 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 16 | [1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1], 17 | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]]; 18 | var minimap = { 19 | init: function(){ 20 | this.element = document.getElementById('minimap'); 21 | this.context = this.element.getContext("2d"); 22 | this.element.width = 300; 23 | this.element.height = 300; 24 | this.width = this.element.width; 25 | this.height = this.element.height; 26 | this.cellsAcross = map[0].length; 27 | this.cellsDown = map.length; 28 | this.cellWidth = this.width/this.cellsAcross; 29 | this.cellHeight = this.height/this.cellsDown; 30 | this.colors = ["#ffff00", "#ff00ff", "#00ffff", "#0000ff"]; 31 | this.draw = function(){ 32 | for(var y = 0; y < this.cellsDown; y++){ 33 | for(var x = 0; x < this.cellsAcross; x++){ 34 | var cell = map[y][x]; 35 | if (cell===-1){ 36 | this.context.fillStyle = "#ffffff" 37 | }else{ 38 | this.context.fillStyle = this.colors[map[y][x]]; 39 | }; 40 | this.context.fillRect(this.cellWidth*x, this.cellHeight*y, this.cellWidth, this.cellHeight); 41 | }; 42 | }; 43 | }; 44 | } 45 | }; 46 | this.draw = function(){ 47 | minimap.draw(); 48 | }; 49 | this.setup = function() { 50 | minimap.init(); 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /fps/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /fps/after_recipe3/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe3/dino.png -------------------------------------------------------------------------------- /fps/after_recipe3/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | #minimap{ 8 | border:1px solid black; 9 | position:absolute; 10 | top:350px; 11 | width:300px; 12 | height:300px; 13 | } 14 | -------------------------------------------------------------------------------- /fps/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /fps/after_recipe4/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe4/dino.png -------------------------------------------------------------------------------- /fps/after_recipe4/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | #minimap{ 8 | border:1px solid black; 9 | position:absolute; 10 | top:350px; 11 | width:300px; 12 | height:300px; 13 | } 14 | -------------------------------------------------------------------------------- /fps/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /fps/after_recipe5/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe5/dino.png -------------------------------------------------------------------------------- /fps/after_recipe5/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | #minimap{ 8 | border:1px solid black; 9 | position:absolute; 10 | top:350px; 11 | width:300px; 12 | height:300px; 13 | } 14 | -------------------------------------------------------------------------------- /fps/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /fps/after_recipe6/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe6/camera.png -------------------------------------------------------------------------------- /fps/after_recipe6/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe6/dino.png -------------------------------------------------------------------------------- /fps/after_recipe6/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | #minimap{ 8 | border:1px solid black; 9 | position:absolute; 10 | top:350px; 11 | width:300px; 12 | height:300px; 13 | } 14 | #screenshot-wrapper{ 15 | position:absolute; 16 | left:700px; 17 | border:1px solid black; 18 | } 19 | #camera{ 20 | width:100px; 21 | position:absolute; 22 | left:505px; 23 | top:180px; 24 | } 25 | -------------------------------------------------------------------------------- /fps/after_recipe6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /fps/after_recipe7/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe7/camera.png -------------------------------------------------------------------------------- /fps/after_recipe7/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/after_recipe7/dino.png -------------------------------------------------------------------------------- /fps/after_recipe7/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | #minimap{ 8 | border:1px solid black; 9 | position:absolute; 10 | top:350px; 11 | width:300px; 12 | height:300px; 13 | } 14 | #screenshot-wrapper{ 15 | position:absolute; 16 | left:700px; 17 | border:1px solid black; 18 | } 19 | #camera{ 20 | width:100px; 21 | position:absolute; 22 | left:505px; 23 | top:180px; 24 | } 25 | -------------------------------------------------------------------------------- /fps/after_recipe7/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /fps/final/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/final/camera.png -------------------------------------------------------------------------------- /fps/final/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/final/dino.png -------------------------------------------------------------------------------- /fps/final/game.css: -------------------------------------------------------------------------------- 1 | #canvas{ 2 | position:absolute; 3 | width:600px; 4 | height:300px; 5 | z-index:-1; 6 | } 7 | #minimap{ 8 | border:1px solid black; 9 | position:absolute; 10 | top:350px; 11 | width:300px; 12 | height:300px; 13 | } 14 | #screenshot-wrapper{ 15 | position:absolute; 16 | left:700px; 17 | border:1px solid black; 18 | } 19 | #camera{ 20 | width:100px; 21 | position:absolute; 22 | left:505px; 23 | top:180px; 24 | } 25 | -------------------------------------------------------------------------------- /fps/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | FPS 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /fps/initial/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/initial/dino.png -------------------------------------------------------------------------------- /fps/initial/game.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/initial/game.css -------------------------------------------------------------------------------- /fps/initial/game.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/initial/game.js -------------------------------------------------------------------------------- /fps/initial/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/fps/initial/index.html -------------------------------------------------------------------------------- /interactive_fiction/after_recipe1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Interactive Fiction 6 | 7 | 8 | 9 | 10 |
11 |
12 | You're on the first slide (page). The down and right arrow keys will take you to the next page. The left and up arrow keys will take you back. 13 |
14 |
15 | You can also use the spacebar instead of the right or down key to go to the next page. 16 |
17 |
18 | Now you're on the last page. Right will take you back to the beginning. 19 |
20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe1/main.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font-size: 100%; 18 | font: inherit; 19 | vertical-align: baseline; 20 | } 21 | 22 | article, aside, details, figcaption, figure, 23 | footer, header, hgroup, menu, nav, section { 24 | display: block; 25 | } 26 | ol, ul { 27 | list-style: none; 28 | } 29 | table { 30 | border-collapse: collapse; 31 | border-spacing: 0; 32 | } 33 | b, strong { font-weight: bold } 34 | i, em { font-style: italic } 35 | /* Reset ends here */ 36 | body { 37 | background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 500, from(rgb(0, 40, 200)), to(rgb(10, 10, 0))); 38 | background: -webkit-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 39 | background: -moz-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 40 | background: -ms-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 41 | background: -o-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 42 | background: radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 43 | } 44 | .impress-enabled .step { 45 | margin: 0; 46 | opacity: 0.0; 47 | -webkit-transition: opacity 1s; 48 | -moz-transition: opacity 1s; 49 | -ms-transition: opacity 1s; 50 | -o-transition: opacity 1s; 51 | transition: opacity 1s; 52 | } 53 | .impress-enabled .step.active { opacity: 1 } 54 | .slide { 55 | display: block; 56 | width: 700px; 57 | height: 600px; 58 | padding: 40px 60px; 59 | background-color: white; 60 | border: 1px solid rgba(0, 0, 0, .3); 61 | color: rgb(52, 52, 52); 62 | text-shadow: 0 2px 2px rgba(0, 0, 0, .1); 63 | border-radius: 5px; 64 | font-family: 'Open Sans', Arial, sans-serif; 65 | font-size: 30px; 66 | } 67 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Interactive Fiction 6 | 7 | 8 | 9 | 10 |
11 |
12 |
13 |

There's a time machine over there. Flip the switch?

14 |

FLIP it.

15 |

WAIT for your dad, who is a scientist, to come home

16 |
17 |
18 |
19 |
20 |

You went back in time. It was fun.

21 |
22 | 23 |
24 |
25 |
26 |

You hung around for a while, and then your dad came home.

27 |

Then he helped you with your homework.

28 |

It was kind of fun, but not that much fun.

29 |
30 | 31 |
32 | 33 |
34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe2/main.css: -------------------------------------------------------------------------------- 1 | html, body, div, span, applet, object, iframe, 2 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 3 | a, abbr, acronym, address, big, cite, code, 4 | del, dfn, em, img, ins, kbd, q, s, samp, 5 | small, strike, strong, sub, sup, tt, var, 6 | b, u, i, center, 7 | dl, dt, dd, ol, ul, li, 8 | fieldset, form, label, legend, 9 | table, caption, tbody, tfoot, thead, tr, th, td, 10 | article, aside, canvas, details, embed, 11 | figure, figcaption, footer, header, hgroup, 12 | menu, nav, output, ruby, section, summary, 13 | time, mark, audio, video { 14 | margin: 0; 15 | padding: 0; 16 | border: 0; 17 | font-size: 100%; 18 | font: inherit; 19 | vertical-align: baseline; 20 | } 21 | 22 | article, aside, details, figcaption, figure, 23 | footer, header, hgroup, menu, nav, section { 24 | display: block; 25 | } 26 | ol, ul { 27 | list-style: none; 28 | } 29 | table { 30 | border-collapse: collapse; 31 | border-spacing: 0; 32 | } 33 | b, strong { font-weight: bold } 34 | i, em { font-style: italic } 35 | /* Reset ends here */ 36 | body { 37 | background: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 500, from(rgb(0, 40, 200)), to(rgb(10, 10, 0))); 38 | background: -webkit-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 39 | background: -moz-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 40 | background: -ms-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 41 | background: -o-radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 42 | background: radial-gradient(rgb(0, 40, 200), rgb(10, 10, 0)); 43 | } 44 | .impress-enabled .step { 45 | margin: 0; 46 | opacity: 0.0; 47 | -webkit-transition: opacity 1s; 48 | -moz-transition: opacity 1s; 49 | -ms-transition: opacity 1s; 50 | -o-transition: opacity 1s; 51 | transition: opacity 1s; 52 | } 53 | .impress-enabled .step.active { opacity: 1 } 54 | .slide { 55 | display: block; 56 | width: 700px; 57 | height: 600px; 58 | padding: 40px 60px; 59 | background-color: white; 60 | border: 1px solid rgba(0, 0, 0, .3); 61 | color: rgb(52, 52, 52); 62 | text-shadow: 0 2px 2px rgba(0, 0, 0, .1); 63 | border-radius: 5px; 64 | font-family: 'Open Sans', Arial, sans-serif; 65 | font-size: 30px; 66 | } 67 | .slide p{ 68 | margin-top:15px; 69 | margin-bottom:30px; 70 | line-height:45px; 71 | } 72 | .slide a, .slide a:visited { 73 | color: #071549; 74 | text-decoration:none; 75 | background-color: #abc; 76 | padding:5px; 77 | border-radius: 5px; 78 | border:1px solid #cde; 79 | } 80 | .slide a:hover, .slide a:active{ 81 | background-color: #cde; 82 | } 83 | .slide .slide-text{ 84 | height: 450px; 85 | } 86 | div.menu{ 87 | border-top:2px solid black; 88 | padding-top:25px; 89 | text-align: center; 90 | } 91 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe3/bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/after_recipe3/bat.png -------------------------------------------------------------------------------- /interactive_fiction/after_recipe3/dragDrop.js: -------------------------------------------------------------------------------- 1 | var itemBoxes = document.querySelectorAll('.inventory-box'); 2 | [].forEach.call(itemBoxes, function(itemBox) { 3 | itemBox.addEventListener('dragstart', handleDragStart); 4 | itemBox.addEventListener('dragover', handleDragOver); 5 | itemBox.addEventListener('drop', handleDrop); 6 | }); 7 | var draggingObject; 8 | function handleDragStart(e) { 9 | draggingObject = this; 10 | e.dataTransfer.setData('text/html', this.innerHTML); 11 | var dragIcon = document.createElement('img'); 12 | var imageName = this.firstChild.id; 13 | dragIcon.src = imageName + '.png'; 14 | e.dataTransfer.setDragImage(dragIcon, -10, 10); 15 | } 16 | function handleDragOver(e) { 17 | e.preventDefault(); 18 | } 19 | function handleDrop(e) { 20 | e.preventDefault(); 21 | if (draggingObject != this) { 22 | var draggingGrandpa = draggingObject.parentElement.parentElement; 23 | var draggedToGrandpa = this.parentElement.parentElement; 24 | var draggingObjectId = draggingObject.firstChild.id; 25 | inventoryObject.add(draggedToGrandpa.id, draggingObjectId); 26 | inventoryObject.remove(draggingGrandpa.id, draggingObjectId); 27 | draggingObject.innerHTML = this.innerHTML; 28 | this.innerHTML = e.dataTransfer.getData('text/html'); 29 | this.classList.remove('empty'); 30 | draggingObject.classList.add('empty'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe3/game.js: -------------------------------------------------------------------------------- 1 | var inventoryObject = (function(){ 2 | var inventory = {}; 3 | var itemables = document.getElementsByClassName("itemable"); 4 | [].forEach.call(itemables, function(itemable) { 5 | inventory[itemable.id] = []; 6 | }); 7 | var items = document.getElementsByClassName("item"); 8 | [].forEach.call(items, function(item) { 9 | var greatGrandpa = item.parentElement.parentElement.parentElement; 10 | inventory[greatGrandpa.id].push(item.id); 11 | }); 12 | var add = function(inventorySection, newItem){ 13 | inventory[inventorySection].push(newItem); 14 | return inventory; 15 | } 16 | var remove = function(inventorySection, itemToDelete){ 17 | for (var i = 0; i < inventory[inventorySection].length; i++){ 18 | if (inventory[inventorySection][i] == itemToDelete){ 19 | inventory[inventorySection].splice(i, 1); 20 | } 21 | } 22 | return inventory; 23 | } 24 | return { 25 | get : function(){ 26 | return inventory; 27 | }, 28 | add : add, 29 | remove : remove 30 | } 31 | })(); 32 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Interactive Fiction 6 | 7 | 8 | 9 | 10 |
11 |

Inventory:

12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |

There's a time machine over there. Flip the switch?

21 |

FLIP it.

22 |

WAIT for your dad, who is a scientist, to come home

23 |
24 | 25 |
26 |
27 |
28 |

You went back in time. It was fun.

29 |
30 | 31 |
32 |
33 |
34 |

You hung around for a while, and then your dad came home.

35 |

Then he helped you with your homework.

36 |

It was kind of fun, but not that much fun.

37 |
38 | 39 |
40 |
41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe4/bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/after_recipe4/bat.png -------------------------------------------------------------------------------- /interactive_fiction/after_recipe4/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/after_recipe4/dino.png -------------------------------------------------------------------------------- /interactive_fiction/after_recipe4/dragDrop.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var itemBoxes = document.querySelectorAll('.inventory-box'); 3 | [].forEach.call(itemBoxes, function(itemBox) { 4 | itemBox.addEventListener('dragstart', handleDragStart); 5 | itemBox.addEventListener('dragover', handleDragOver); 6 | itemBox.addEventListener('drop', handleDrop); 7 | }); 8 | var draggingObject; 9 | function handleDragStart(e) { 10 | draggingObject = this; 11 | e.dataTransfer.setData('text/html', this.innerHTML); 12 | var dragIcon = document.createElement('img'); 13 | var imageName = this.firstChild.id; 14 | dragIcon.src = imageName + '.png'; 15 | e.dataTransfer.setDragImage(dragIcon, -10, 10); 16 | } 17 | function handleDragOver(e) { 18 | e.preventDefault(); 19 | } 20 | function handleDrop(e) { 21 | var dragAppliedTo = this; 22 | game.things.dropItemInto(draggingObject, dragAppliedTo.parentElement.parentElement.id); 23 | e.preventDefault(); 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Interactive Fiction 6 | 7 | 8 | 9 | 10 |
11 |

Inventory:

12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |

There's a time machine over there. Flip the switch?

21 |

FLIP it.

22 |

WAIT for your dad, who is a scientist, to come home

23 |
24 |
25 | 26 |
27 |
28 |
29 |

Woah. A dinosaur. I wonder if you can hit it with something...

30 |
31 |
32 | 33 |
34 |
35 |
36 |

You hung around for a while, and then your dad came home.

37 |

Then he helped you with your homework.

38 |

It was kind of fun, but not that much fun.

39 |
40 |
41 | 42 |
43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe5/bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/after_recipe5/bat.png -------------------------------------------------------------------------------- /interactive_fiction/after_recipe5/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/after_recipe5/dino.png -------------------------------------------------------------------------------- /interactive_fiction/after_recipe5/dragDrop.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var itemBoxes = document.querySelectorAll('.inventory-box'); 3 | [].forEach.call(itemBoxes, function(itemBox) { 4 | itemBox.addEventListener('dragstart', handleDragStart); 5 | itemBox.addEventListener('dragover', handleDragOver); 6 | itemBox.addEventListener('drop', handleDrop); 7 | }); 8 | var draggingObject; 9 | function handleDragStart(e) { 10 | draggingObject = this; 11 | e.dataTransfer.setData('text/html', this.innerHTML); 12 | var dragIcon = document.createElement('img'); 13 | var imageName = this.firstChild.id; 14 | dragIcon.src = imageName + '.png'; 15 | e.dataTransfer.setDragImage(dragIcon, -10, 10); 16 | } 17 | function handleDragOver(e) { 18 | e.preventDefault(); 19 | } 20 | function handleDrop(e) { 21 | var dragAppliedTo = this; 22 | game.things.dropItemInto(draggingObject, dragAppliedTo.parentElement.parentElement.id); 23 | e.preventDefault(); 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /interactive_fiction/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Interactive Fiction 6 | 7 | 8 | 9 | 10 |
11 |

Inventory:

12 |
13 |
14 |
15 |
16 |
17 |
18 |

Steps Taken:

19 |
    20 |
21 |
22 | 23 |
24 |
25 |
26 |

There's a time machine over there. Flip the switch?

27 |

FLIP it.

28 |

WAIT for your dad, who is a scientist, to come home

29 |
30 |
31 | 32 |
33 |
34 |
35 |

Woah. A dinosaur. I wonder if you can hit it with something...

36 |
37 |
38 | 39 |
40 |
41 |
42 |

You hung around for a while, and then your dad came home.

43 |

Then he helped you with your homework.

44 |

It was kind of fun, but not that much fun.

45 |
46 |
47 | 48 |
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /interactive_fiction/final/bat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/final/bat.png -------------------------------------------------------------------------------- /interactive_fiction/final/dino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/final/dino.png -------------------------------------------------------------------------------- /interactive_fiction/final/dragDrop.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var itemBoxes = document.querySelectorAll('.inventory-box'); 3 | [].forEach.call(itemBoxes, function(itemBox) { 4 | itemBox.addEventListener('dragstart', handleDragStart); 5 | itemBox.addEventListener('dragover', handleDragOver); 6 | itemBox.addEventListener('drop', handleDrop); 7 | }); 8 | var draggingObject; 9 | function handleDragStart(e) { 10 | draggingObject = this; 11 | e.dataTransfer.setData('text/html', this.innerHTML); 12 | var dragIcon = document.createElement('img'); 13 | var imageName = this.firstChild.id; 14 | dragIcon.src = imageName + '.png'; 15 | e.dataTransfer.setDragImage(dragIcon, -10, 10); 16 | } 17 | function handleDragOver(e) { 18 | e.preventDefault(); 19 | } 20 | function handleDrop(e) { 21 | var dragAppliedTo = this; 22 | game.things.dropItemInto(draggingObject, dragAppliedTo.parentElement.parentElement.id); 23 | e.preventDefault(); 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /interactive_fiction/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Interactive Fiction 6 | 7 | 8 | 9 | 10 |
11 |

Inventory:

12 |
13 |
14 |
15 |
16 |
17 |
18 |

Steps Taken:

19 |
    20 |
21 |
22 | 23 |
24 |
25 |
26 |

There's a time machine over there. Flip the switch?

27 |

FLIP it.

28 |

WAIT for your dad, who is a scientist, to come home

29 |
30 |
31 | 32 |
33 |
34 |
35 |

Woah. A dinosaur. I wonder if you can hit it with something...

36 |
37 |
38 | 39 |
40 |
41 |
42 |

You hung around for a while, and then your dad came home.

43 |

Then he helped you with your homework.

44 |

It was kind of fun, but not that much fun.

45 |
46 |
47 | 48 |
49 |
50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /interactive_fiction/final/raptor-sound.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/final/raptor-sound.mp3 -------------------------------------------------------------------------------- /interactive_fiction/final/raptor-sound.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/final/raptor-sound.ogg -------------------------------------------------------------------------------- /interactive_fiction/final/raptor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/interactive_fiction/final/raptor.png -------------------------------------------------------------------------------- /interactive_fiction/initial/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Interactive Fiction 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /party/after_recipe1/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | update: (dt) -> 15 | if atom.input.pressed 'left' 16 | console.log "player started moving left" 17 | else if atom.input.down 'left' 18 | console.log "player still moving left" 19 | draw: -> 20 | atom.context.fillStyle = 'black' 21 | atom.context.fillRect 0, 0, atom.width, atom.height 22 | game = new Game 23 | window.onblur = -> game.stop() 24 | window.onfocus = -> game.run() 25 | game.run() 26 | ``` 27 | ```html 28 | 29 | 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /party/after_recipe1/game.js: -------------------------------------------------------------------------------- 1 | atom.input.bind(atom.key.LEFT_ARROW, 'left'); 2 | game = Object.create(Game.prototype); 3 | game.update = function(dt) { 4 | if (atom.input.pressed('left')) { 5 | return console.log("player started moving left"); 6 | } else if (atom.input.down('left')) { 7 | return console.log("player still moving left"); 8 | } 9 | }; 10 | game.draw = function() { 11 | atom.context.fillStyle = 'black'; 12 | return atom.context.fillRect(0, 0, atom.width, atom.height); 13 | }; 14 | window.onblur = function() { 15 | return game.stop(); 16 | }; 17 | window.onfocus = function() { 18 | return game.run(); 19 | }; 20 | game.run(); 21 | -------------------------------------------------------------------------------- /party/after_recipe1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | whackamole 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /party/after_recipe2/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | update: (dt) -> 15 | if atom.input.pressed 'left' 16 | console.log "player started moving left" 17 | else if atom.input.down 'left' 18 | console.log "player still moving left" 19 | draw: -> 20 | atom.context.fillStyle = 'black' 21 | atom.context.fillRect 0, 0, atom.width, atom.height 22 | game = new Game 23 | window.onblur = -> game.stop() 24 | window.onfocus = -> game.run() 25 | game.run() 26 | ``` 27 | ```html 28 | 29 | 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /party/after_recipe2/game.js: -------------------------------------------------------------------------------- 1 | atom.input.bind(atom.key.LEFT_ARROW, 'left'); 2 | game = Object.create(Game.prototype); 3 | game.update = function(dt) { 4 | if (atom.input.pressed('left')) { 5 | return console.log("player started moving left"); 6 | } else if (atom.input.down('left')) { 7 | return console.log("player still moving left"); 8 | } 9 | }; 10 | game.draw = function() { 11 | atom.context.beginPath(); 12 | atom.context.fillStyle = '#34e'; 13 | atom.context.fillRect(0, 0, atom.width, atom.height/2); 14 | atom.context.fillStyle = '#ee3'; 15 | atom.context.arc(140, atom.height/2 -30, 90, Math.PI*2, 0); 16 | atom.context.fill(); 17 | atom.context.fillStyle = '#2e2'; 18 | atom.context.fillRect(0, atom.height/2, atom.width, atom.height/2); 19 | }; 20 | window.onblur = function() { 21 | return game.stop(); 22 | }; 23 | window.onfocus = function() { 24 | return game.run(); 25 | }; 26 | game.run(); 27 | -------------------------------------------------------------------------------- /party/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | whackamole 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /party/after_recipe3/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | update: (dt) -> 15 | if atom.input.pressed 'left' 16 | console.log "player started moving left" 17 | else if atom.input.down 'left' 18 | console.log "player still moving left" 19 | draw: -> 20 | atom.context.fillStyle = 'black' 21 | atom.context.fillRect 0, 0, atom.width, atom.height 22 | game = new Game 23 | window.onblur = -> game.stop() 24 | window.onfocus = -> game.run() 25 | game.run() 26 | ``` 27 | ```html 28 | 29 | 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /party/after_recipe3/game.js: -------------------------------------------------------------------------------- 1 | atom.input.bind(atom.key.LEFT_ARROW, 'left'); 2 | game = Object.create(Game.prototype); 3 | game.update = function(dt) { 4 | if (atom.input.pressed('left')) { 5 | return console.log("player started moving left"); 6 | } else if (atom.input.down('left')) { 7 | return console.log("player still moving left"); 8 | } 9 | }; 10 | game.draw = function() { 11 | this.drawBackground(); 12 | this.drawHoles(['A', 'S', 'D', 'F'], 145, 85); 13 | }; 14 | game.drawHoles = function(holeLabels, xOffset, yOffset){ 15 | for(i = 0; i < holeLabels.length; i++){ 16 | atom.context.fillStyle = game.hole.color; 17 | var holeLocation = [xOffset + game.hole.spacing*i, yOffset]; 18 | game.hole.draw(holeLocation, holeLabels[i]); 19 | } 20 | }; 21 | game.hole = { 22 | size: 40, 23 | spacing: 280, 24 | color: '#311', 25 | labelOffset: 140, 26 | labelColor: '#000', 27 | labelFont: "130px monospace", 28 | draw: function(holeLocation, holeLabel){ 29 | atom.context.beginPath(); 30 | atom.context.arc(holeLocation[0], atom.height/2+holeLocation[1], this.size, 0, Math.PI*2, false); 31 | atom.context.fill(); 32 | atom.context.fillStyle = this.labelColor; 33 | atom.context.font = this.labelFont; 34 | atom.context.fillText(holeLabel, holeLocation[0] - this.size, atom.height/2+holeLocation[1] + this.labelOffset); 35 | } 36 | }; 37 | game.drawBackground = function(){ 38 | atom.context.beginPath(); 39 | atom.context.fillStyle = '#34e'; 40 | atom.context.fillRect(0, 0, atom.width, atom.height/2); 41 | atom.context.fillStyle = '#ee3'; 42 | atom.context.arc(140, atom.height/2 -30, 90, Math.PI*2, 0); 43 | atom.context.fill(); 44 | atom.context.fillStyle = '#2e2'; 45 | atom.context.fillRect(0, atom.height/2, atom.width, atom.height/2); 46 | }; 47 | window.onblur = function() { 48 | return game.stop(); 49 | }; 50 | window.onfocus = function() { 51 | return game.run(); 52 | }; 53 | game.run(); 54 | -------------------------------------------------------------------------------- /party/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | whackamole 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /party/after_recipe4/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | update: (dt) -> 15 | if atom.input.pressed 'left' 16 | console.log "player started moving left" 17 | else if atom.input.down 'left' 18 | console.log "player still moving left" 19 | draw: -> 20 | atom.context.fillStyle = 'black' 21 | atom.context.fillRect 0, 0, atom.width, atom.height 22 | game = new Game 23 | window.onblur = -> game.stop() 24 | window.onfocus = -> game.run() 25 | game.run() 26 | ``` 27 | ```html 28 | 29 | 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /party/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | whackamole 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /party/after_recipe5/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | update: (dt) -> 15 | if atom.input.pressed 'left' 16 | console.log "player started moving left" 17 | else if atom.input.down 'left' 18 | console.log "player still moving left" 19 | draw: -> 20 | atom.context.fillStyle = 'black' 21 | atom.context.fillRect 0, 0, atom.width, atom.height 22 | game = new Game 23 | window.onblur = -> game.stop() 24 | window.onfocus = -> game.run() 25 | game.run() 26 | ``` 27 | ```html 28 | 29 | 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /party/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | whackamole 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /party/after_recipe6/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | update: (dt) -> 15 | if atom.input.pressed 'left' 16 | console.log "player started moving left" 17 | else if atom.input.down 'left' 18 | console.log "player still moving left" 19 | draw: -> 20 | atom.context.fillStyle = 'black' 21 | atom.context.fillRect 0, 0, atom.width, atom.height 22 | game = new Game 23 | window.onblur = -> game.stop() 24 | window.onfocus = -> game.run() 25 | game.run() 26 | ``` 27 | ```html 28 | 29 | 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /party/after_recipe6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | whackamole 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /party/final/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | update: (dt) -> 15 | if atom.input.pressed 'left' 16 | console.log "player started moving left" 17 | else if atom.input.down 'left' 18 | console.log "player still moving left" 19 | draw: -> 20 | atom.context.fillStyle = 'black' 21 | atom.context.fillRect 0, 0, atom.width, atom.height 22 | game = new Game 23 | window.onblur = -> game.stop() 24 | window.onfocus = -> game.run() 25 | game.run() 26 | ``` 27 | ```html 28 | 29 | 30 | 31 | ``` 32 | -------------------------------------------------------------------------------- /party/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | whackamole 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /party/initial/README.md: -------------------------------------------------------------------------------- 1 | # atom 2 | #### a <canvas> game framework that does as little as possible 3 | 4 | Honestly, this thing does so little that you should just read the code. 5 | 6 | Here's what a game using Atom looks like: 7 | 8 | ```coffeescript 9 | class Game extends atom.Game 10 | constructor: -> 11 | super 12 | atom.input.bind atom.key.LEFT_ARROW, 'left' 13 | atom.input.bind atom.key.RIGHT_ARROW, 'right' 14 | 15 | update: (dt) -> 16 | if atom.input.pressed 'left' 17 | console.log "player started moving left" 18 | else if atom.input.down 'left' 19 | console.log "player still moving left" 20 | 21 | draw: -> 22 | atom.context.fillStyle = 'black' 23 | atom.context.fillRect 0, 0, atom.width, atom.height 24 | # Carry on. 25 | 26 | game = new Game 27 | 28 | window.onblur = -> game.stop() 29 | window.onfocus = -> game.run() 30 | 31 | game.run() 32 | ``` 33 | ```html 34 | 35 | 36 | 37 | ``` 38 | -------------------------------------------------------------------------------- /party/initial/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/party/initial/index.html -------------------------------------------------------------------------------- /platformers/after_recipe1/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe1/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe1/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe1/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe1/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/index.html -------------------------------------------------------------------------------- /platformers/after_recipe1/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe1/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/player.png -------------------------------------------------------------------------------- /platformers/after_recipe1/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe1/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe2/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe2/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe2/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe2/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe2/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe2/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe2/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe2/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 |
14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /platformers/after_recipe2/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe2/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe2/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.state.set(me.state.PLAY, new PlayScreen()); 13 | me.state.change(me.state.PLAY); 14 | } 15 | }; 16 | window.onReady(function() { 17 | jsApp.onload(); 18 | }); 19 | -------------------------------------------------------------------------------- /platformers/after_recipe2/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe2/player.png -------------------------------------------------------------------------------- /platformers/after_recipe2/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }]; 11 | -------------------------------------------------------------------------------- /platformers/after_recipe2/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /platformers/after_recipe2/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe2/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe3/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe3/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe3/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe3/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe3/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe3/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe3/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe3/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe3/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | }, 6 | update: function() { 7 | this.updateMovement(); 8 | if (this.vel.x!=0 || this.vel.y!=0) { 9 | this.parent(this); 10 | return true; 11 | } 12 | return false; 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /platformers/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /platformers/after_recipe3/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe3/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe3/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.entityPool.add("player", PlayerEntity); 13 | me.state.set(me.state.PLAY, new PlayScreen()); 14 | me.state.change(me.state.PLAY); 15 | } 16 | }; 17 | window.onReady(function() { 18 | jsApp.onload(); 19 | }); 20 | -------------------------------------------------------------------------------- /platformers/after_recipe3/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe3/player.png -------------------------------------------------------------------------------- /platformers/after_recipe3/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | } 16 | ]; 17 | -------------------------------------------------------------------------------- /platformers/after_recipe3/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /platformers/after_recipe3/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe3/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe4/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe4/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe4/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe4/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe4/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe4/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe4/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe4/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe4/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | }, 6 | update: function() { 7 | this.updateMovement(); 8 | if (this.vel.x!=0 || this.vel.y!=0) { 9 | this.parent(this); 10 | return true; 11 | } 12 | return false; 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /platformers/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /platformers/after_recipe4/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe4/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe4/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.entityPool.add("player", PlayerEntity); 13 | me.state.set(me.state.PLAY, new PlayScreen()); 14 | me.state.change(me.state.PLAY); 15 | } 16 | }; 17 | window.onReady(function() { 18 | jsApp.onload(); 19 | }); 20 | -------------------------------------------------------------------------------- /platformers/after_recipe4/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe4/player.png -------------------------------------------------------------------------------- /platformers/after_recipe4/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | } 16 | ]; 17 | -------------------------------------------------------------------------------- /platformers/after_recipe4/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | } 5 | }); 6 | -------------------------------------------------------------------------------- /platformers/after_recipe4/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe4/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe5/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe5/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe5/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe5/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe5/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe5/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe5/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe5/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe5/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | this.setVelocity(3, 12); 6 | }, 7 | update: function() { 8 | if (me.input.isKeyPressed('left')) { this.doWalk(true); } 9 | else if (me.input.isKeyPressed('right')) { this.doWalk(false); } 10 | else { this.vel.x = 0; }; 11 | if (me.input.isKeyPressed('jump')) { this.doJump(); } 12 | me.game.collide(this); 13 | this.updateMovement(); 14 | if (this.vel.x!=0 || this.vel.y!=0) { 15 | this.parent(this); 16 | return true; 17 | } 18 | return false; 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /platformers/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /platformers/after_recipe5/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe5/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe5/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.entityPool.add("player", PlayerEntity); 13 | me.state.set(me.state.PLAY, new PlayScreen()); 14 | me.state.change(me.state.PLAY); 15 | } 16 | }; 17 | window.onReady(function() { 18 | jsApp.onload(); 19 | }); 20 | -------------------------------------------------------------------------------- /platformers/after_recipe5/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe5/player.png -------------------------------------------------------------------------------- /platformers/after_recipe5/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | } 16 | ]; 17 | -------------------------------------------------------------------------------- /platformers/after_recipe5/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | me.input.bindKey(me.input.KEY.LEFT, "left"); 5 | me.input.bindKey(me.input.KEY.RIGHT, "right"); 6 | me.input.bindKey(me.input.KEY.SPACE, "jump"); 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /platformers/after_recipe5/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe5/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe6/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe6/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe6/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe6/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe6/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe6/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe6/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe6/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe6/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | this.setVelocity(3, 12); 6 | }, 7 | update: function() { 8 | if (me.input.isKeyPressed('left')) { this.doWalk(true); } 9 | else if (me.input.isKeyPressed('right')) { this.doWalk(false); } 10 | else { this.vel.x = 0; }; 11 | if (me.input.isKeyPressed('jump')) { this.doJump(); } 12 | me.game.collide(this); 13 | this.updateMovement(); 14 | if (this.bottom > 490){ this.gameOver(); } 15 | if (this.vel.x!=0 || this.vel.y!=0) { 16 | this.parent(this); 17 | return true; 18 | } 19 | return false; 20 | }, 21 | gameOver: function() { 22 | me.state.change(me.state.MENU); 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /platformers/after_recipe6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /platformers/after_recipe6/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe6/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe6/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.entityPool.add("player", PlayerEntity); 13 | me.state.set(me.state.PLAY, new PlayScreen()); 14 | me.state.set(me.state.MENU, new TitleScreen()); 15 | me.state.transition("fade", "#2FA2C2", 250); 16 | me.state.change(me.state.MENU); 17 | } 18 | }; 19 | window.onReady(function() { 20 | jsApp.onload(); 21 | }); 22 | -------------------------------------------------------------------------------- /platformers/after_recipe6/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe6/player.png -------------------------------------------------------------------------------- /platformers/after_recipe6/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | }, 16 | { name: "titleScreen", 17 | type: "image", 18 | src: "titleScreen.png" 19 | } 20 | ]; 21 | -------------------------------------------------------------------------------- /platformers/after_recipe6/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | me.input.bindKey(me.input.KEY.LEFT, "left"); 5 | me.input.bindKey(me.input.KEY.RIGHT, "right"); 6 | } 7 | }); 8 | var TitleScreen = me.ScreenObject.extend({ 9 | init: function() { 10 | this.parent(true); 11 | me.input.bindKey(me.input.KEY.SPACE, "jump", true); 12 | }, 13 | onResetEvent: function() { 14 | if (this.title == null) { 15 | this.title = me.loader.getImage("titleScreen"); 16 | } 17 | }, 18 | update: function() { 19 | if (me.input.isKeyPressed('jump')) { 20 | me.state.change(me.state.PLAY); 21 | } 22 | return true; 23 | }, 24 | draw: function(context){ 25 | context.drawImage(this.title, 50, 50); 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /platformers/after_recipe6/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe6/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe7/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe7/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe7/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe7/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe7/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe7/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe7/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe7/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe7/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | this.setVelocity(3, 12); 6 | }, 7 | update: function() { 8 | if (me.input.isKeyPressed('left')) { this.doWalk(true); } 9 | else if (me.input.isKeyPressed('right')) { this.doWalk(false); } 10 | else { this.vel.x = 0; }; 11 | if (me.input.isKeyPressed('jump')) { this.doJump(); } 12 | me.game.collide(this); 13 | this.updateMovement(); 14 | if (this.bottom > 490){ this.gameOver(); } 15 | if (this.vel.x!=0 || this.vel.y!=0) { 16 | this.parent(this); 17 | return true; 18 | } 19 | return false; 20 | }, 21 | gameOver: function() { 22 | me.state.change(me.state.MENU); 23 | } 24 | }); 25 | var CoinEntity = me.CollectableEntity.extend({ 26 | init: function(x, y, settings) { 27 | this.parent(x, y, settings); 28 | }, 29 | onCollision : function (res, obj) { 30 | this.collidable = false; 31 | me.game.remove(this); 32 | } 33 | }); 34 | -------------------------------------------------------------------------------- /platformers/after_recipe7/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /platformers/after_recipe7/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe7/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe7/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.entityPool.add("player", PlayerEntity); 13 | me.entityPool.add("coin", CoinEntity); 14 | me.state.set(me.state.PLAY, new PlayScreen()); 15 | me.state.set(me.state.MENU, new TitleScreen()); 16 | me.state.transition("fade", "#2FA2C2", 250); 17 | me.state.change(me.state.MENU); 18 | } 19 | }; 20 | window.onReady(function() { 21 | jsApp.onload(); 22 | }); 23 | -------------------------------------------------------------------------------- /platformers/after_recipe7/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe7/player.png -------------------------------------------------------------------------------- /platformers/after_recipe7/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | }, 16 | { name: "titleScreen", 17 | type: "image", 18 | src: "titleScreen.png" 19 | }, 20 | { name: "coin", 21 | type: "image", 22 | src: "coin.png" 23 | } 24 | ]; 25 | -------------------------------------------------------------------------------- /platformers/after_recipe7/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | me.input.bindKey(me.input.KEY.LEFT, "left"); 5 | me.input.bindKey(me.input.KEY.RIGHT, "right"); 6 | } 7 | }); 8 | var TitleScreen = me.ScreenObject.extend({ 9 | init: function() { 10 | this.parent(true); 11 | me.input.bindKey(me.input.KEY.SPACE, "jump", true); 12 | }, 13 | onResetEvent: function() { 14 | if (this.title == null) { 15 | this.title = me.loader.getImage("titleScreen"); 16 | } 17 | }, 18 | update: function() { 19 | if (me.input.isKeyPressed('jump')) { 20 | me.state.change(me.state.PLAY); 21 | } 22 | return true; 23 | }, 24 | draw: function(context){ 25 | context.drawImage(this.title, 50, 50); 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /platformers/after_recipe7/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe7/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe8/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe8/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe8/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe8/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe8/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe8/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe8/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe8/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe8/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | this.setVelocity(3, 12); 6 | }, 7 | update: function() { 8 | if (me.input.isKeyPressed('left')) { this.doWalk(true); } 9 | else if (me.input.isKeyPressed('right')) { this.doWalk(false); } 10 | else { this.vel.x = 0; }; 11 | if (me.input.isKeyPressed('jump')) { this.doJump(); } 12 | me.game.collide(this); 13 | this.updateMovement(); 14 | if (this.bottom > 490){ this.gameOver(); } 15 | if (this.vel.x!=0 || this.vel.y!=0) { 16 | this.parent(this); 17 | return true; 18 | } 19 | return false; 20 | }, 21 | gameOver: function() { 22 | me.state.change(me.state.MENU); 23 | } 24 | }); 25 | var CoinEntity = me.CollectableEntity.extend({ 26 | init: function(x, y, settings) { 27 | this.parent(x, y, settings); 28 | }, 29 | onCollision : function (res, obj) { 30 | this.collidable = false; 31 | me.game.remove(this); 32 | } 33 | }); 34 | var EnemyEntity = me.ObjectEntity.extend({ 35 | init: function(x, y, settings) { 36 | settings.image = "badguy"; 37 | settings.spritewidth = 16; 38 | this.parent(x, y, settings); 39 | this.startX = x; 40 | this.endX = x + settings.width - settings.spritewidth; 41 | this.pos.x = this.endX; 42 | this.walkLeft = true; 43 | this.setVelocity(2); 44 | this.collidable = true; 45 | }, 46 | onCollision: function(res, obj) { 47 | obj.gameOver(); 48 | }, 49 | update: function() { 50 | if (!this.visible){ 51 | return false; 52 | } 53 | if (this.alive) { 54 | if (this.walkLeft && this.pos.x <= this.startX) { 55 | this.walkLeft = false; 56 | } 57 | else if (!this.walkLeft && this.pos.x >= this.endX){ 58 | this.walkLeft = true; 59 | } 60 | this.doWalk(this.walkLeft); 61 | } 62 | else { this.vel.x = 0; } 63 | this.updateMovement(); 64 | if (this.vel.x!=0 || this.vel.y!=0) { 65 | this.parent(this); 66 | return true; 67 | } 68 | return false; 69 | } 70 | }); 71 | -------------------------------------------------------------------------------- /platformers/after_recipe8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /platformers/after_recipe8/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe8/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe8/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.entityPool.add("player", PlayerEntity); 13 | me.entityPool.add("coin", CoinEntity); 14 | me.entityPool.add("EnemyEntity", EnemyEntity); 15 | me.state.set(me.state.PLAY, new PlayScreen()); 16 | me.state.set(me.state.MENU, new TitleScreen()); 17 | me.state.transition("fade", "#2FA2C2", 250); 18 | me.state.change(me.state.MENU); 19 | } 20 | }; 21 | window.onReady(function() { 22 | jsApp.onload(); 23 | }); 24 | -------------------------------------------------------------------------------- /platformers/after_recipe8/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe8/player.png -------------------------------------------------------------------------------- /platformers/after_recipe8/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | }, 16 | { name: "titleScreen", 17 | type: "image", 18 | src: "titleScreen.png" 19 | }, 20 | { name: "coin", 21 | type: "image", 22 | src: "coin.png" 23 | }, 24 | { name: "badGuy", 25 | type: "image", 26 | src: "badGuy.png" 27 | } 28 | ]; 29 | -------------------------------------------------------------------------------- /platformers/after_recipe8/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | me.input.bindKey(me.input.KEY.LEFT, "left"); 5 | me.input.bindKey(me.input.KEY.RIGHT, "right"); 6 | } 7 | }); 8 | var TitleScreen = me.ScreenObject.extend({ 9 | init: function() { 10 | this.parent(true); 11 | me.input.bindKey(me.input.KEY.SPACE, "jump", true); 12 | }, 13 | onResetEvent: function() { 14 | if (this.title == null) { 15 | this.title = me.loader.getImage("titleScreen"); 16 | } 17 | }, 18 | update: function() { 19 | if (me.input.isKeyPressed('jump')) { 20 | me.state.change(me.state.PLAY); 21 | } 22 | return true; 23 | }, 24 | draw: function(context){ 25 | context.drawImage(this.title, 50, 50); 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /platformers/after_recipe8/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe8/titleScreen.png -------------------------------------------------------------------------------- /platformers/after_recipe9/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe9/badGuy.png -------------------------------------------------------------------------------- /platformers/after_recipe9/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe9/boots.png -------------------------------------------------------------------------------- /platformers/after_recipe9/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe9/coin.png -------------------------------------------------------------------------------- /platformers/after_recipe9/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe9/collision.png -------------------------------------------------------------------------------- /platformers/after_recipe9/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | this.setVelocity(3, 12); 6 | }, 7 | update: function() { 8 | if (me.input.isKeyPressed('left')) { this.doWalk(true); } 9 | else if (me.input.isKeyPressed('right')) { this.doWalk(false); } 10 | else { this.vel.x = 0; }; 11 | if (me.input.isKeyPressed('jump')) { this.doJump(); } 12 | me.game.collide(this); 13 | this.updateMovement(); 14 | if (this.bottom > 490){ this.gameOver(); } 15 | if (this.vel.x!=0 || this.vel.y!=0) { 16 | this.parent(this); 17 | return true; 18 | } 19 | return false; 20 | }, 21 | gameOver: function() { 22 | me.state.change(me.state.MENU); 23 | } 24 | }); 25 | var CoinEntity = me.CollectableEntity.extend({ 26 | init: function(x, y, settings) { 27 | this.parent(x, y, settings); 28 | }, 29 | onCollision : function (res, obj) { 30 | this.collidable = false; 31 | me.game.remove(this); 32 | } 33 | }); 34 | var EnemyEntity = me.ObjectEntity.extend({ 35 | init: function(x, y, settings) { 36 | settings.image = "badguy"; 37 | settings.spritewidth = 16; 38 | this.parent(x, y, settings); 39 | this.startX = x; 40 | this.endX = x + settings.width - settings.spritewidth; 41 | this.pos.x = this.endX; 42 | this.walkLeft = true; 43 | this.setVelocity(2); 44 | this.collidable = true; 45 | }, 46 | onCollision: function(res, obj) { 47 | obj.gameOver(); 48 | }, 49 | update: function() { 50 | if (!this.visible){ 51 | return false; 52 | } 53 | if (this.alive) { 54 | if (this.walkLeft && this.pos.x <= this.startX) { 55 | this.walkLeft = false; 56 | } 57 | else if (!this.walkLeft && this.pos.x >= this.endX){ 58 | this.walkLeft = true; 59 | } 60 | this.doWalk(this.walkLeft); 61 | } 62 | else { this.vel.x = 0; } 63 | this.updateMovement(); 64 | if (this.vel.x!=0 || this.vel.y!=0) { 65 | this.parent(this); 66 | return true; 67 | } 68 | return false; 69 | } 70 | }); 71 | var BootsEntity = me.CollectableEntity.extend({ 72 | init: function(x, y, settings) { 73 | this.parent(x, y, settings); 74 | }, 75 | onCollision : function (res, obj) { 76 | this.collidable = false; 77 | me.game.remove(this); 78 | obj.gravity = obj.gravity/4; 79 | } 80 | }); 81 | -------------------------------------------------------------------------------- /platformers/after_recipe9/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 | 17 | 18 | -------------------------------------------------------------------------------- /platformers/after_recipe9/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe9/levelSprites.png -------------------------------------------------------------------------------- /platformers/after_recipe9/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | }, 11 | loaded: function() { 12 | me.entityPool.add("player", PlayerEntity); 13 | me.entityPool.add("coin", CoinEntity); 14 | me.entityPool.add("boots", BootsEntity); 15 | me.entityPool.add("EnemyEntity", EnemyEntity); 16 | me.state.set(me.state.PLAY, new PlayScreen()); 17 | me.state.set(me.state.MENU, new TitleScreen()); 18 | me.state.transition("fade", "#2FA2C2", 250); 19 | me.state.change(me.state.MENU); 20 | } 21 | }; 22 | window.onReady(function() { 23 | jsApp.onload(); 24 | }); 25 | -------------------------------------------------------------------------------- /platformers/after_recipe9/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe9/player.png -------------------------------------------------------------------------------- /platformers/after_recipe9/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | }, 16 | { name: "titleScreen", 17 | type: "image", 18 | src: "titleScreen.png" 19 | }, 20 | { name: "coin", 21 | type: "image", 22 | src: "coin.png" 23 | }, 24 | { name: "badGuy", 25 | type: "image", 26 | src: "badGuy.png" 27 | }, 28 | { 29 | name: "boots", 30 | type: "image", 31 | src: "boots.png" 32 | } 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /platformers/after_recipe9/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onResetEvent: function() { 3 | me.levelDirector.loadLevel("level1"); 4 | me.input.bindKey(me.input.KEY.LEFT, "left"); 5 | me.input.bindKey(me.input.KEY.RIGHT, "right"); 6 | } 7 | }); 8 | var TitleScreen = me.ScreenObject.extend({ 9 | init: function() { 10 | this.parent(true); 11 | me.input.bindKey(me.input.KEY.SPACE, "jump", true); 12 | }, 13 | onResetEvent: function() { 14 | if (this.title == null) { 15 | this.title = me.loader.getImage("titleScreen"); 16 | } 17 | }, 18 | update: function() { 19 | if (me.input.isKeyPressed('jump')) { 20 | me.state.change(me.state.PLAY); 21 | } 22 | return true; 23 | }, 24 | draw: function(context){ 25 | context.drawImage(this.title, 50, 50); 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /platformers/after_recipe9/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/after_recipe9/titleScreen.png -------------------------------------------------------------------------------- /platformers/final/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/final/badGuy.png -------------------------------------------------------------------------------- /platformers/final/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/final/boots.png -------------------------------------------------------------------------------- /platformers/final/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/final/coin.png -------------------------------------------------------------------------------- /platformers/final/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/final/collision.png -------------------------------------------------------------------------------- /platformers/final/entities.js: -------------------------------------------------------------------------------- 1 | var PlayerEntity = me.ObjectEntity.extend({ 2 | init: function(x, y, settings) { 3 | this.parent(x, y, settings); 4 | me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); 5 | this.setVelocity(3, 12); 6 | }, 7 | update: function() { 8 | if (me.input.isKeyPressed('left')) { this.doWalk(true); } 9 | else if (me.input.isKeyPressed('right')) { this.doWalk(false); } 10 | else { this.vel.x = 0; }; 11 | if (me.input.isKeyPressed('jump')) { this.doJump(); } 12 | me.game.collide(this); 13 | this.updateMovement(); 14 | if (this.bottom > 490){ this.gameOver(); } 15 | if (this.vel.x!=0 || this.vel.y!=0) { 16 | this.parent(this); 17 | return true; 18 | } 19 | return false; 20 | }, 21 | gameOver: function() { 22 | me.state.change(me.state.MENU); 23 | }, 24 | youWin: function() { 25 | me.state.change(me.state.MENU); 26 | document.getElementById('game_state').innerHTML = "You Win!"; 27 | document.getElementById('instructions').innerHTML = ""; 28 | } 29 | }); 30 | var CoinEntity = me.CollectableEntity.extend({ 31 | init: function(x, y, settings) { 32 | this.parent(x, y, settings); 33 | }, 34 | onCollision : function (res, obj) { 35 | me.gamestat.updateValue("coins", 1); 36 | this.collidable = false; 37 | me.game.remove(this); 38 | if(me.gamestat.getItemValue("coins") === me.gamestat.getItemValue("totalCoins")){ 39 | obj.youWin(); 40 | } 41 | } 42 | }); 43 | var EnemyEntity = me.ObjectEntity.extend({ 44 | init: function(x, y, settings) { 45 | settings.image = "badguy"; 46 | settings.spritewidth = 16; 47 | this.parent(x, y, settings); 48 | this.startX = x; 49 | this.endX = x + settings.width - settings.spritewidth; 50 | this.pos.x = this.endX; 51 | this.walkLeft = true; 52 | this.setVelocity(2); 53 | this.collidable = true; 54 | }, 55 | onCollision: function(res, obj) { 56 | obj.gameOver(); 57 | }, 58 | update: function() { 59 | if (!this.visible){ 60 | return false; 61 | } 62 | if (this.alive) { 63 | if (this.walkLeft && this.pos.x <= this.startX) { 64 | this.walkLeft = false; 65 | } 66 | else if (!this.walkLeft && this.pos.x >= this.endX){ 67 | this.walkLeft = true; 68 | } 69 | this.doWalk(this.walkLeft); 70 | } 71 | else { this.vel.x = 0; } 72 | this.updateMovement(); 73 | if (this.vel.x!=0 || this.vel.y!=0) { 74 | this.parent(this); 75 | return true; 76 | } 77 | return false; 78 | } 79 | }); 80 | var BootsEntity = me.CollectableEntity.extend({ 81 | init: function(x, y, settings) { 82 | this.parent(x, y, settings); 83 | }, 84 | onCollision : function (res, obj) { 85 | this.collidable = false; 86 | me.game.remove(this); 87 | obj.gravity = obj.gravity/4; 88 | } 89 | }); 90 | -------------------------------------------------------------------------------- /platformers/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Guy's Adventure 5 | 6 | 7 |
8 |
9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 25 | 26 | -------------------------------------------------------------------------------- /platformers/final/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/final/levelSprites.png -------------------------------------------------------------------------------- /platformers/final/main.js: -------------------------------------------------------------------------------- 1 | var jsApp = { 2 | onload: function() { 3 | if (!me.video.init('jsapp', 320, 240, true, 2.0)) { 4 | alert("html 5 canvas is not supported by this browser."); 5 | return; 6 | } 7 | me.loader.onload = this.loaded.bind(this); 8 | me.loader.preload(resources); 9 | me.state.change(me.state.LOADING); 10 | me.gamestat.add("coins", 0); 11 | me.gamestat.add("totalCoins", 2); 12 | }, 13 | loaded: function() { 14 | me.entityPool.add("player", PlayerEntity); 15 | me.entityPool.add("coin", CoinEntity); 16 | me.entityPool.add("boots", BootsEntity); 17 | me.entityPool.add("EnemyEntity", EnemyEntity); 18 | me.state.set(me.state.PLAY, new PlayScreen()); 19 | me.state.set(me.state.MENU, new TitleScreen()); 20 | me.state.transition("fade", "#2FA2C2", 250); 21 | me.state.change(me.state.MENU); 22 | } 23 | }; 24 | window.onReady(function() { 25 | jsApp.onload(); 26 | }); 27 | -------------------------------------------------------------------------------- /platformers/final/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/final/player.png -------------------------------------------------------------------------------- /platformers/final/resources.js: -------------------------------------------------------------------------------- 1 | var resources = [{ 2 | name: "levelSprites", 3 | type: "image", 4 | src: "levelSprites.png" 5 | }, 6 | { 7 | name: "level1", 8 | type: "tmx", 9 | src: "level1.tmx" 10 | }, 11 | { 12 | name: "player", 13 | type: "image", 14 | src: "player.png" 15 | }, 16 | { name: "titleScreen", 17 | type: "image", 18 | src: "titleScreen.png" 19 | }, 20 | { name: "coin", 21 | type: "image", 22 | src: "coin.png" 23 | }, 24 | { name: "badGuy", 25 | type: "image", 26 | src: "badGuy.png" 27 | }, 28 | { 29 | name: "boots", 30 | type: "image", 31 | src: "boots.png" 32 | } 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /platformers/final/screens.js: -------------------------------------------------------------------------------- 1 | var PlayScreen = me.ScreenObject.extend({ 2 | onDestroyEvent: function() { 3 | me.gamestat.reset("coins"); 4 | }, 5 | onResetEvent: function() { 6 | me.levelDirector.loadLevel("level1"); 7 | me.input.bindKey(me.input.KEY.LEFT, "left"); 8 | me.input.bindKey(me.input.KEY.RIGHT, "right"); 9 | document.getElementById('game_state').innerHTML = "Collect all of the coins!"; 10 | document.getElementById('instructions').innerHTML = "Arrows to move and Space to jump."; 11 | } 12 | }); 13 | var TitleScreen = me.ScreenObject.extend({ 14 | init: function() { 15 | this.parent(true); 16 | me.input.bindKey(me.input.KEY.SPACE, "jump", true); 17 | }, 18 | onResetEvent: function() { 19 | if (this.title == null) { 20 | this.title = me.loader.getImage("titleScreen"); 21 | document.getElementById('game_state').innerHTML = ""; 22 | document.getElementById('instructions').innerHTML = ""; 23 | } 24 | }, 25 | update: function() { 26 | if (me.input.isKeyPressed('jump')) { 27 | me.state.change(me.state.PLAY); 28 | } 29 | return true; 30 | }, 31 | draw: function(context){ 32 | context.drawImage(this.title, 50, 50); 33 | } 34 | }); 35 | -------------------------------------------------------------------------------- /platformers/final/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/final/titleScreen.png -------------------------------------------------------------------------------- /platformers/initial/badGuy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/badGuy.png -------------------------------------------------------------------------------- /platformers/initial/boots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/boots.png -------------------------------------------------------------------------------- /platformers/initial/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/coin.png -------------------------------------------------------------------------------- /platformers/initial/collision.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/collision.png -------------------------------------------------------------------------------- /platformers/initial/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/index.html -------------------------------------------------------------------------------- /platformers/initial/levelSprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/levelSprites.png -------------------------------------------------------------------------------- /platformers/initial/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/player.png -------------------------------------------------------------------------------- /platformers/initial/titleScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/platformers/initial/titleScreen.png -------------------------------------------------------------------------------- /puzzle/after_recipe1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Recipe: Drawing a square 5 | 6 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /puzzle/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Recipe: Drawing a square 5 | 6 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /puzzle/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Recipe: Drawing a square 5 | 6 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /puzzle/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Recipe: Drawing a square 5 | 6 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /puzzle/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Recipe: Drawing a square 5 | 6 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /puzzle/initial/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Recipe: Drawing a square 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /quiz/after_recipe1/main.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/quiz/after_recipe1/main.css -------------------------------------------------------------------------------- /quiz/after_recipe2/main.css: -------------------------------------------------------------------------------- 1 | #quiz{ 2 | display:none; 3 | } 4 | body{ 5 | margin-left:50px; 6 | } 7 | -------------------------------------------------------------------------------- /quiz/after_recipe3/game.js: -------------------------------------------------------------------------------- 1 | if(jQuery){ 2 | $("#question1").show(); 3 | }; 4 | -------------------------------------------------------------------------------- /quiz/after_recipe3/main.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin-left:50px; 3 | } 4 | #question1, #question2, #question3, #question4, #question5, 5 | #question6, #question7, #question8, #question9, #question10{ 6 | display:none; 7 | } 8 | -------------------------------------------------------------------------------- /quiz/after_recipe4/game.js: -------------------------------------------------------------------------------- 1 | if(jQuery){ 2 | $("#question1").show(); 3 | }; 4 | if(impress){ 5 | $("#question2").show(); 6 | }; 7 | if(atom){ 8 | $("#question3").show(); 9 | }; 10 | if(createjs){ 11 | $("#question4").show(); 12 | }; 13 | if(me){ 14 | $("#question5").show(); 15 | }; 16 | if(require){ 17 | $("#question6").show(); 18 | }; 19 | if($().playground){ 20 | $("#question7").show(); 21 | }; 22 | if(jaws){ 23 | $("#question8").show(); 24 | }; 25 | if(enchant){ 26 | $("#question9").show(); 27 | }; 28 | if(Crafty){ 29 | $("#question10").show(); 30 | }; 31 | -------------------------------------------------------------------------------- /quiz/after_recipe4/main.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin-left:50px; 3 | } 4 | #question1, #question2, #question3, #question4, #question5, 5 | #question6, #question7, #question8, #question9, #question10{ 6 | display:none; 7 | } 8 | canvas{ 9 | display:none; 10 | } 11 | -------------------------------------------------------------------------------- /quiz/final/game.js: -------------------------------------------------------------------------------- 1 | if(jQuery){ 2 | var checkAnswers = function(){ 3 | var answerString = ""; 4 | var answers = $(":checked"); 5 | answers.each(function(i) { 6 | answerString = answerString + answers[i].value; 7 | }); 8 | // See errata for chapter 1 at: github.com/EvanBurchard/jsarcade/blob/master/errata/chapter1 9 | // The 3 following lines with comments (preceded by //) are not necessary 10 | // $(":checked").each(function(i) { 11 | // var answerString = answerString + answers[i].value; 12 | // }); 13 | checkIfCorrect(answerString); 14 | }; 15 | var checkIfCorrect = function(theString){ 16 | if(parseInt(theString, 16) === 811124566973){ 17 | $("body").addClass("correct"); 18 | $("h1").text("You Win!"); 19 | $("canvas").show(); 20 | } 21 | }; 22 | $("#question1").show(); 23 | }; 24 | if(impress){ 25 | $("#question2").show(); 26 | }; 27 | if(atom){ 28 | $("#question3").show(); 29 | }; 30 | if(createjs){ 31 | $("#question4").show(); 32 | }; 33 | if(me){ 34 | $("#question5").show(); 35 | }; 36 | if(require){ 37 | $("#question6").show(); 38 | }; 39 | if($().playground){ 40 | $("#question7").show(); 41 | }; 42 | if(jaws){ 43 | $("#question8").show(); 44 | }; 45 | if(enchant){ 46 | $("#question9").show(); 47 | }; 48 | if(Crafty){ 49 | $("#question10").show(); 50 | }; 51 | -------------------------------------------------------------------------------- /quiz/final/main.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin-left:50px; 3 | } 4 | #question1, #question2, #question3, #question4, #question5, 5 | #question6, #question7, #question8, #question9, #question10{ 6 | display:none; 7 | } 8 | canvas{ 9 | display:none; 10 | } 11 | .correct{ 12 | background-color:#24399f; 13 | color:white; 14 | } 15 | -------------------------------------------------------------------------------- /quiz/initial/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/quiz/initial/index.html -------------------------------------------------------------------------------- /quiz/initial/main.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/quiz/initial/main.css -------------------------------------------------------------------------------- /rpg/after_recipe1/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe1/game.js: -------------------------------------------------------------------------------- 1 | enchant(); 2 | window.onload = function(){ 3 | var game = new Game(300, 300); 4 | game.fps = 15; 5 | game.onload = function(){ 6 | alert("hello"); 7 | }; 8 | game.start(); 9 | }; 10 | -------------------------------------------------------------------------------- /rpg/after_recipe1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /rpg/after_recipe1/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe1/items.png -------------------------------------------------------------------------------- /rpg/after_recipe1/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe1/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe2/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe2/game.js: -------------------------------------------------------------------------------- 1 | enchant(); 2 | window.onload = function(){ 3 | var game = new Game(300, 300); 4 | game.fps = 15; 5 | game.spriteWidth = 16; 6 | game.spriteHeight = 16; 7 | game.preload('sprites.png'); 8 | var map = new Map(game.spriteWidth, game.spriteHeight); 9 | var foregroundMap = new Map(game.spriteWidth, game.spriteHeight); 10 | var setMaps = function(){ 11 | map.image = game.assets['sprites.png']; 12 | map.loadData(mapData); 13 | foregroundMap.image = game.assets['sprites.png']; 14 | foregroundMap.loadData(foregroundData); 15 | }; 16 | var setStage = function(){ 17 | var stage = new Group(); 18 | stage.addChild(map); 19 | stage.addChild(foregroundMap); 20 | game.rootScene.addChild(stage); 21 | }; 22 | game.onload = function(){ 23 | setMaps(); 24 | setStage(); 25 | }; 26 | game.start(); 27 | }; 28 | -------------------------------------------------------------------------------- /rpg/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe2/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe2/items.png -------------------------------------------------------------------------------- /rpg/after_recipe2/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe2/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe3/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe3/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe3/items.png -------------------------------------------------------------------------------- /rpg/after_recipe3/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe3/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe4/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe4/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe4/items.png -------------------------------------------------------------------------------- /rpg/after_recipe4/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe4/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe5/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe5/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe5/items.png -------------------------------------------------------------------------------- /rpg/after_recipe5/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe5/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe6/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe6/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe6/items.png -------------------------------------------------------------------------------- /rpg/after_recipe6/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe6/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe7/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe7/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe7/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe7/items.png -------------------------------------------------------------------------------- /rpg/after_recipe7/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe7/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe8/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | -------------------------------------------------------------------------------- /rpg/after_recipe8/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe8/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe8/items.png -------------------------------------------------------------------------------- /rpg/after_recipe8/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe8/sprites.png -------------------------------------------------------------------------------- /rpg/after_recipe9/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | .active-option{ 5 | color:red; 6 | } 7 | -------------------------------------------------------------------------------- /rpg/after_recipe9/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/after_recipe9/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe9/items.png -------------------------------------------------------------------------------- /rpg/after_recipe9/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/after_recipe9/sprites.png -------------------------------------------------------------------------------- /rpg/final/game.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | } 4 | .active-option{ 5 | color:red; 6 | } 7 | -------------------------------------------------------------------------------- /rpg/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RPG 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /rpg/final/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/final/items.png -------------------------------------------------------------------------------- /rpg/final/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/final/sprites.png -------------------------------------------------------------------------------- /rpg/initial/game.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/initial/game.css -------------------------------------------------------------------------------- /rpg/initial/game.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/initial/game.js -------------------------------------------------------------------------------- /rpg/initial/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/initial/index.html -------------------------------------------------------------------------------- /rpg/initial/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/initial/items.png -------------------------------------------------------------------------------- /rpg/initial/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rpg/initial/sprites.png -------------------------------------------------------------------------------- /rts/after_recipe1/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/after_recipe1/httpserver.js: -------------------------------------------------------------------------------- 1 | console.log("ahoy hoy, check me out at http://localhost:1234"); 2 | var http = require('http'); 3 | http.createServer(function (request, response) { 4 | console.log("Request received."); 5 | response.write('

AHOY HOY!

'); 6 | response.end(); 7 | }).listen(1234); 8 | -------------------------------------------------------------------------------- /rts/after_recipe1/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/after_recipe1/sprites.png -------------------------------------------------------------------------------- /rts/after_recipe2/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/after_recipe2/game.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | var socket = io.connect('http://localhost:1234'); 3 | socket.on('started', function(data){ 4 | console.log(data); 5 | }); 6 | }; 7 | -------------------------------------------------------------------------------- /rts/after_recipe2/httpserver.js: -------------------------------------------------------------------------------- 1 | console.log("ahoy hoy, check me out at http://localhost:1234"); 2 | var http = require('http'); 3 | http.createServer(function (request, response) { 4 | console.log("Request received."); 5 | response.write('

AHOY HOY!

'); 6 | response.end(); 7 | }).listen(1234); 8 | -------------------------------------------------------------------------------- /rts/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RTS 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /rts/after_recipe2/server.js: -------------------------------------------------------------------------------- 1 | var io = require('socket.io').listen(1234); 2 | io.sockets.on('connection', function (socket) { 3 | socket.emit('started', {ahoy: "hoy"}); 4 | }); 5 | -------------------------------------------------------------------------------- /rts/after_recipe2/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/after_recipe2/sprites.png -------------------------------------------------------------------------------- /rts/after_recipe3/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/after_recipe3/game.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | Crafty.init(); 3 | Crafty.viewport.scale(3.5); 4 | var iso = Crafty.isometric.size(16); 5 | var mapWidth = 20; 6 | var mapHeight = 40; 7 | Crafty.sprite(16, "sprites.png", { 8 | grass: [0,0,1,1], 9 | selected_grass: [1,0,1,1], 10 | blue_box: [2,0,1,1], 11 | blue_one: [3,0,1,1], 12 | blue_two: [4,0,1,1], 13 | blue_three: [5,0,1,1], 14 | blue_bomb: [6,0,1,1], 15 | blue_flag: [7,0,1,1], 16 | red_box: [8,0,1,1], 17 | red_one: [9,0,1,1], 18 | red_two: [10,0,1,1], 19 | red_three: [11,0,1,1], 20 | red_bomb: [12,0,1,1], 21 | red_flag: [13,0,1,1], 22 | selected_box: [14,0,1,1] 23 | }); 24 | var setMap = function(){ 25 | for(var x = 0; x < mapWidth; x++) { 26 | for(var y = 0; y < mapHeight; y++) { 27 | var bias = ((y % 2) ? 1 : 0); 28 | var z = x+y + bias; 29 | var tile = Crafty.e("2D, DOM, grass, Mouse") 30 | .attr('z',z) 31 | .areaMap([7,0],[8,0],[15,5],[15,6],[8,9],[7,9],[0,6],[0,5]) 32 | .bind("MouseOver", function() { 33 | this.addComponent("selected_grass"); 34 | this.removeComponent("grass"); 35 | }).bind("MouseOut", function() { 36 | this.addComponent("grass"); 37 | this.removeComponent("selected_grass"); 38 | }); 39 | iso.place(x,y,0, tile); 40 | } 41 | } 42 | }; 43 | setMap(); 44 | var socket = io.connect('http://localhost:1234'); 45 | socket.on('started', function(data){ 46 | console.log(data); 47 | }); 48 | }; 49 | -------------------------------------------------------------------------------- /rts/after_recipe3/httpserver.js: -------------------------------------------------------------------------------- 1 | console.log("ahoy hoy, check me out at http://localhost:1234"); 2 | var http = require('http'); 3 | http.createServer(function (request, response) { 4 | console.log("Request received."); 5 | response.write('

AHOY HOY!

'); 6 | response.end(); 7 | }).listen(1234); 8 | -------------------------------------------------------------------------------- /rts/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RTS 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /rts/after_recipe3/server.js: -------------------------------------------------------------------------------- 1 | var io = require('socket.io').listen(1234); 2 | io.sockets.on('connection', function (socket) { 3 | socket.emit('started', {ahoy: "hoy"}); 4 | }); 5 | -------------------------------------------------------------------------------- /rts/after_recipe3/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/after_recipe3/sprites.png -------------------------------------------------------------------------------- /rts/after_recipe4/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/after_recipe4/game.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | Crafty.init(); 3 | Crafty.viewport.scale(3.5); 4 | var iso = Crafty.isometric.size(16); 5 | var mapWidth = 20; 6 | var mapHeight = 40; 7 | Crafty.sprite(16, "sprites.png", { 8 | grass: [0,0,1,1], 9 | selected_grass: [1,0,1,1], 10 | blue_box: [2,0,1,1], 11 | blue_one: [3,0,1,1], 12 | blue_two: [4,0,1,1], 13 | blue_three: [5,0,1,1], 14 | blue_bomb: [6,0,1,1], 15 | blue_flag: [7,0,1,1], 16 | red_box: [8,0,1,1], 17 | red_one: [9,0,1,1], 18 | red_two: [10,0,1,1], 19 | red_three: [11,0,1,1], 20 | red_bomb: [12,0,1,1], 21 | red_flag: [13,0,1,1], 22 | selected_box: [14,0,1,1] 23 | }); 24 | var setMap = function(){ 25 | for(var x = 0; x < mapWidth; x++) { 26 | for(var y = 0; y < mapHeight; y++) { 27 | var bias = ((y % 2) ? 1 : 0); 28 | var z = x+y + bias; 29 | var tile = Crafty.e("2D, DOM, grass, Mouse") 30 | .attr('z',z) 31 | .areaMap([7,0],[8,0],[15,5],[15,6],[8,9],[7,9],[0,6],[0,5]) 32 | .bind("MouseOver", function() { 33 | this.addComponent("selected_grass"); 34 | this.removeComponent("grass"); 35 | }).bind("MouseOut", function() { 36 | this.addComponent("grass"); 37 | this.removeComponent("selected_grass"); 38 | }); 39 | iso.place(x,y,0, tile); 40 | } 41 | } 42 | }; 43 | setMap(); 44 | 45 | var placeUnits = function(units){ 46 | for(var i = 0; i < units.length; i++){ 47 | var componentList = "2D, DOM, Mouse, " + units[i].color + "_" + units[i].type; 48 | var unit = Crafty.e(componentList) 49 | .attr('z',100) 50 | .areaMap([7,0],[8,0],[14,3],[14,8],[8,12],[7,12],[2,8],[2,3]); 51 | iso.place(units[i].xPosition,units[i].yPosition,0, unit); 52 | }; 53 | } 54 | 55 | var socket = io.connect('http://localhost:1234'); 56 | socket.on('place units', function(units){ 57 | placeUnits(units); 58 | }); 59 | }; 60 | -------------------------------------------------------------------------------- /rts/after_recipe4/httpserver.js: -------------------------------------------------------------------------------- 1 | console.log("ahoy hoy, check me out at http://localhost:1234"); 2 | var http = require('http'); 3 | http.createServer(function (request, response) { 4 | console.log("Request received."); 5 | response.write('

AHOY HOY!

'); 6 | response.end(); 7 | }).listen(1234); 8 | -------------------------------------------------------------------------------- /rts/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RTS 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /rts/after_recipe4/server.js: -------------------------------------------------------------------------------- 1 | var placeUnits = function(){ 2 | var yLocations = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38]; 3 | var pickY = function(alignment){ 4 | var y = Math.floor(Math.random(yLocations.length)*yLocations.length); 5 | return yLocations.splice(y, 1) - alignment; 6 | }; 7 | var xPositionRed = 18; 8 | var xPositionBlue = 1; 9 | 10 | return [ 11 | {color: "red", 12 | type: "one", 13 | xPosition: xPositionRed, 14 | yPosition: pickY(1)}, 15 | {color: "red", 16 | type: "one", 17 | xPosition: xPositionRed, 18 | yPosition: pickY(1)}, 19 | {color: "red", 20 | type: "one", 21 | xPosition: xPositionRed, 22 | yPosition: pickY(1)}, 23 | {color: "red", 24 | type: "two", 25 | xPosition: xPositionRed, 26 | yPosition: pickY(1)}, 27 | {color: "red", 28 | type: "two", 29 | xPosition: xPositionRed, 30 | yPosition: pickY(1)}, 31 | {color: "red", 32 | type: "three", 33 | xPosition: xPositionRed, 34 | yPosition: pickY(1)}, 35 | {color: "red", 36 | type: "three", 37 | xPosition: xPositionRed, 38 | yPosition: pickY(1)}, 39 | {color: "red", 40 | type: "bomb", 41 | xPosition: xPositionRed, 42 | yPosition: pickY(1)}, 43 | {color: "red", 44 | type: "flag", 45 | xPosition: xPositionRed, 46 | yPosition: pickY(1)}, 47 | {color: "blue", 48 | type: "one", 49 | xPosition: xPositionBlue, 50 | yPosition: pickY(0)}, 51 | {color: "blue", 52 | type: "one", 53 | xPosition: xPositionBlue, 54 | yPosition: pickY(0)}, 55 | {color: "blue", 56 | type: "one", 57 | xPosition: xPositionBlue, 58 | yPosition: pickY(0)}, 59 | {color: "blue", 60 | type: "two", 61 | xPosition: xPositionBlue, 62 | yPosition: pickY(0)}, 63 | {color: "blue", 64 | type: "two", 65 | xPosition: xPositionBlue, 66 | yPosition: pickY(0)}, 67 | {color: "blue", 68 | type: "three", 69 | xPosition: xPositionBlue, 70 | yPosition: pickY(0)}, 71 | {color: "blue", 72 | type: "three", 73 | xPosition: xPositionBlue, 74 | yPosition: pickY(0)}, 75 | {color: "blue", 76 | type: "bomb", 77 | xPosition: xPositionBlue, 78 | yPosition: pickY(0)}, 79 | {color: "blue", 80 | type: "flag", 81 | xPosition: xPositionBlue, 82 | yPosition: pickY(0)} 83 | ] 84 | }; 85 | 86 | var io = require('socket.io').listen(1234); 87 | io.sockets.on('connection', function (socket) { 88 | var units = placeUnits(); 89 | socket.emit('place units', units); 90 | }); 91 | -------------------------------------------------------------------------------- /rts/after_recipe4/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/after_recipe4/sprites.png -------------------------------------------------------------------------------- /rts/after_recipe5/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/after_recipe5/game.js: -------------------------------------------------------------------------------- 1 | window.onload = function() { 2 | Crafty.init(); 3 | Crafty.viewport.scale(3.5); 4 | var iso = Crafty.isometric.size(16); 5 | var mapWidth = 20; 6 | var mapHeight = 40; 7 | Crafty.sprite(16, "sprites.png", { 8 | grass: [0,0,1,1], 9 | selected_grass: [1,0,1,1], 10 | blue_box: [2,0,1,1], 11 | blue_one: [3,0,1,1], 12 | blue_two: [4,0,1,1], 13 | blue_three: [5,0,1,1], 14 | blue_bomb: [6,0,1,1], 15 | blue_flag: [7,0,1,1], 16 | red_box: [8,0,1,1], 17 | red_one: [9,0,1,1], 18 | red_two: [10,0,1,1], 19 | red_three: [11,0,1,1], 20 | red_bomb: [12,0,1,1], 21 | red_flag: [13,0,1,1], 22 | selected_box: [14,0,1,1] 23 | }); 24 | var unitClicked = null; 25 | var moveUnit = function(place){ 26 | var xDistance = Math.abs(unitClicked.x - place.x); 27 | var yDistance = Math.abs(unitClicked.y - place.y); 28 | var distance = Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2)*4); 29 | unitClicked.tween({x: place.x, y: place.y}, Math.round(distance*3)) 30 | unitClicked.addComponent(unitClicked.trueSprite); 31 | unitClicked = null; 32 | }; 33 | var setMap = function(){ 34 | for(var x = 0; x < mapWidth; x++) { 35 | for(var y = 0; y < mapHeight; y++) { 36 | var bias = ((y % 2) ? 1 : 0); 37 | var z = x+y + bias; 38 | var tile = Crafty.e("2D, DOM, grass, Mouse") 39 | .attr('z',z) 40 | .areaMap([7,0],[8,0],[15,5],[15,6],[8,9],[7,9],[0,6],[0,5]) 41 | .bind("MouseOver", function() { 42 | this.addComponent("selected_grass"); 43 | this.removeComponent("grass"); 44 | }).bind("MouseOut", function() { 45 | this.addComponent("grass"); 46 | this.removeComponent("selected_grass"); 47 | }).bind("Click", function() { 48 | if(unitClicked){ 49 | moveUnit(this); 50 | } 51 | }); 52 | 53 | iso.place(x,y,0, tile); 54 | } 55 | } 56 | }; 57 | setMap(); 58 | var placeUnits = function(units){ 59 | for(var i = 0; i < units.length; i++){ 60 | var unitSprite = units[i].color + "_" + units[i].type; 61 | var componentList = "2D, DOM, Mouse, Tween, " + unitSprite; 62 | var unit = Crafty.e(componentList) 63 | .attr('z',100) 64 | .areaMap([7,0],[8,0],[14,3],[14,8],[8,12],[7,12],[2,8],[2,3]); 65 | unit.trueSprite = unitSprite; 66 | unit.bind("Click", function() { 67 | if(unitClicked){ 68 | if(unitClicked !== this){ 69 | moveUnit(this); 70 | }; 71 | }else{ 72 | this.removeComponent(this.trueSprite); 73 | this.addComponent('selected_box'); 74 | unitClicked = this; 75 | }; 76 | }); 77 | iso.place(units[i].xPosition,units[i].yPosition,0, unit); 78 | }; 79 | } 80 | 81 | var socket = io.connect('http://localhost:1234'); 82 | socket.on('place units', function(units){ 83 | placeUnits(units); 84 | }); 85 | }; 86 | -------------------------------------------------------------------------------- /rts/after_recipe5/httpserver.js: -------------------------------------------------------------------------------- 1 | console.log("ahoy hoy, check me out at http://localhost:1234"); 2 | var http = require('http'); 3 | http.createServer(function (request, response) { 4 | console.log("Request received."); 5 | response.write('

AHOY HOY!

'); 6 | response.end(); 7 | }).listen(1234); 8 | -------------------------------------------------------------------------------- /rts/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RTS 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /rts/after_recipe5/server.js: -------------------------------------------------------------------------------- 1 | var placeUnits = function(){ 2 | var yLocations = [2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38]; 3 | var pickY = function(alignment){ 4 | var y = Math.floor(Math.random(yLocations.length)*yLocations.length); 5 | return yLocations.splice(y, 1) - alignment; 6 | }; 7 | var xPositionRed = 18; 8 | var xPositionBlue = 1; 9 | 10 | return [ 11 | {color: "red", 12 | type: "one", 13 | xPosition: xPositionRed, 14 | yPosition: pickY(1)}, 15 | {color: "red", 16 | type: "one", 17 | xPosition: xPositionRed, 18 | yPosition: pickY(1)}, 19 | {color: "red", 20 | type: "one", 21 | xPosition: xPositionRed, 22 | yPosition: pickY(1)}, 23 | {color: "red", 24 | type: "two", 25 | xPosition: xPositionRed, 26 | yPosition: pickY(1)}, 27 | {color: "red", 28 | type: "two", 29 | xPosition: xPositionRed, 30 | yPosition: pickY(1)}, 31 | {color: "red", 32 | type: "three", 33 | xPosition: xPositionRed, 34 | yPosition: pickY(1)}, 35 | {color: "red", 36 | type: "three", 37 | xPosition: xPositionRed, 38 | yPosition: pickY(1)}, 39 | {color: "red", 40 | type: "bomb", 41 | xPosition: xPositionRed, 42 | yPosition: pickY(1)}, 43 | {color: "red", 44 | type: "flag", 45 | xPosition: xPositionRed, 46 | yPosition: pickY(1)}, 47 | {color: "blue", 48 | type: "one", 49 | xPosition: xPositionBlue, 50 | yPosition: pickY(0)}, 51 | {color: "blue", 52 | type: "one", 53 | xPosition: xPositionBlue, 54 | yPosition: pickY(0)}, 55 | {color: "blue", 56 | type: "one", 57 | xPosition: xPositionBlue, 58 | yPosition: pickY(0)}, 59 | {color: "blue", 60 | type: "two", 61 | xPosition: xPositionBlue, 62 | yPosition: pickY(0)}, 63 | {color: "blue", 64 | type: "two", 65 | xPosition: xPositionBlue, 66 | yPosition: pickY(0)}, 67 | {color: "blue", 68 | type: "three", 69 | xPosition: xPositionBlue, 70 | yPosition: pickY(0)}, 71 | {color: "blue", 72 | type: "three", 73 | xPosition: xPositionBlue, 74 | yPosition: pickY(0)}, 75 | {color: "blue", 76 | type: "bomb", 77 | xPosition: xPositionBlue, 78 | yPosition: pickY(0)}, 79 | {color: "blue", 80 | type: "flag", 81 | xPosition: xPositionBlue, 82 | yPosition: pickY(0)} 83 | ] 84 | }; 85 | 86 | var io = require('socket.io').listen(1234); 87 | io.sockets.on('connection', function (socket) { 88 | var units = placeUnits(); 89 | socket.emit('place units', units); 90 | }); 91 | -------------------------------------------------------------------------------- /rts/after_recipe5/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/after_recipe5/sprites.png -------------------------------------------------------------------------------- /rts/after_recipe6/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/after_recipe6/httpserver.js: -------------------------------------------------------------------------------- 1 | console.log("ahoy hoy, check me out at http://localhost:1234"); 2 | var http = require('http'); 3 | http.createServer(function (request, response) { 4 | console.log("Request received."); 5 | response.write('

AHOY HOY!

'); 6 | response.end(); 7 | }).listen(1234); 8 | -------------------------------------------------------------------------------- /rts/after_recipe6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RTS 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /rts/after_recipe6/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/after_recipe6/sprites.png -------------------------------------------------------------------------------- /rts/final/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/final/httpserver.js: -------------------------------------------------------------------------------- 1 | console.log("ahoy hoy, check me out at http://localhost:1234"); 2 | var http = require('http'); 3 | http.createServer(function (request, response) { 4 | console.log("Request received."); 5 | response.write('

AHOY HOY!

'); 6 | response.end(); 7 | }).listen(1234); 8 | -------------------------------------------------------------------------------- /rts/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RTS 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /rts/final/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/final/sprites.png -------------------------------------------------------------------------------- /rts/initial/.gitignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | .DS_Store 3 | node_modules 4 | -------------------------------------------------------------------------------- /rts/initial/sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/rts/initial/sprites.png -------------------------------------------------------------------------------- /shooter/after_recipe1/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe1/background1.png -------------------------------------------------------------------------------- /shooter/after_recipe1/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe1/background2.png -------------------------------------------------------------------------------- /shooter/after_recipe1/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe1/background3.png -------------------------------------------------------------------------------- /shooter/after_recipe1/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe1/background4.png -------------------------------------------------------------------------------- /shooter/after_recipe1/game.js: -------------------------------------------------------------------------------- 1 | var PLAYGROUND_WIDTH = 700; 2 | var PLAYGROUND_HEIGHT = 250; 3 | var REFRESH_RATE = 15; 4 | var farParallaxSpeed = 1; 5 | var closeParallaxSpeed = 3; 6 | 7 | var background1 = new $.gQ.Animation({imageURL: "background1.png"}); 8 | var background2 = new $.gQ.Animation({imageURL: "background2.png"}); 9 | var background3 = new $.gQ.Animation({imageURL: "background3.png"}); 10 | var background4 = new $.gQ.Animation({imageURL: "background4.png"}); 11 | 12 | $("#playground").playground({height: PLAYGROUND_HEIGHT, width: PLAYGROUND_WIDTH, keyTracker: true}); 13 | 14 | $.playground().addGroup("background", {width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}) 15 | .addSprite("background1", {animation: background1, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}) 16 | .addSprite("background2", {animation: background2, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT, posx: PLAYGROUND_WIDTH}) 17 | .addSprite("background3", {animation: background3, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}) 18 | .addSprite("background4", {animation: background4, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT, posx: PLAYGROUND_WIDTH}) 19 | 20 | $.playground().registerCallback(function(){ 21 | $("#background1").x(($("#background1").x() - farParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 22 | $("#background2").x(($("#background2").x() - farParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 23 | $("#background3").x(($("#background3").x() - closeParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 24 | $("#background4").x(($("#background4").x() - closeParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 25 | }, REFRESH_RATE); 26 | $.playground().startGame(); 27 | -------------------------------------------------------------------------------- /shooter/after_recipe1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shooter 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /shooter/after_recipe2/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe2/background1.png -------------------------------------------------------------------------------- /shooter/after_recipe2/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe2/background2.png -------------------------------------------------------------------------------- /shooter/after_recipe2/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe2/background3.png -------------------------------------------------------------------------------- /shooter/after_recipe2/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe2/background4.png -------------------------------------------------------------------------------- /shooter/after_recipe2/game.css: -------------------------------------------------------------------------------- 1 | .enemy{ 2 | color:red; 3 | background-color: black; 4 | font-size:24px; 5 | border:1px 6 | solid red; 7 | text-align:center; 8 | }; 9 | -------------------------------------------------------------------------------- /shooter/after_recipe2/game.js: -------------------------------------------------------------------------------- 1 | var PLAYGROUND_WIDTH = 700; 2 | var PLAYGROUND_HEIGHT = 250; 3 | var REFRESH_RATE = 15; 4 | var farParallaxSpeed = 1; 5 | var closeParallaxSpeed = 3; 6 | var enemyHeight = 30; 7 | var enemyWidth = 60; 8 | var enemySpawnRate = 1000; 9 | 10 | function Enemy(node, value){ 11 | this.value = value; 12 | this.speed = 5; 13 | this.node = node; 14 | this.update = function(){ 15 | this.node.x(-this.speed, true); 16 | }; 17 | }; 18 | 19 | var background1 = new $.gQ.Animation({imageURL: "background1.png"}); 20 | var background2 = new $.gQ.Animation({imageURL: "background2.png"}); 21 | var background3 = new $.gQ.Animation({imageURL: "background3.png"}); 22 | var background4 = new $.gQ.Animation({imageURL: "background4.png"}); 23 | 24 | $("#playground").playground({height: PLAYGROUND_HEIGHT, width: PLAYGROUND_WIDTH, keyTracker: true}); 25 | 26 | $.playground().addGroup("background", {width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}) 27 | .addSprite("background1", {animation: background1, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}) 28 | .addSprite("background2", {animation: background2, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT, posx: PLAYGROUND_WIDTH}) 29 | .addSprite("background3", {animation: background3, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}) 30 | .addSprite("background4", {animation: background4, width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT, posx: PLAYGROUND_WIDTH}) 31 | .end() 32 | .addGroup("enemies", {width: PLAYGROUND_WIDTH, height: PLAYGROUND_HEIGHT}) 33 | 34 | $.playground().registerCallback(function(){ 35 | $("#background1").x(($("#background1").x() - farParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 36 | $("#background2").x(($("#background2").x() - farParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 37 | $("#background3").x(($("#background3").x() - closeParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 38 | $("#background4").x(($("#background4").x() - closeParallaxSpeed - PLAYGROUND_WIDTH) % (-2 * PLAYGROUND_WIDTH) + PLAYGROUND_WIDTH); 39 | $(".enemy").each(function(){ 40 | this.enemy.update(); 41 | if(($(this).x()+ enemyWidth) < 0){ 42 | $(this).remove(); 43 | } 44 | }); 45 | 46 | }, REFRESH_RATE); 47 | $.playground().registerCallback(function(){ 48 | var enemyValue = Math.ceil(Math.random()*21) - 11; 49 | var name = "enemy_"+(new Date).getTime(); 50 | $("#enemies").addSprite(name, {animation: '', posx: PLAYGROUND_WIDTH, posy: Math.random()*PLAYGROUND_HEIGHT*0.9,width: enemyWidth, height: enemyHeight}); 51 | var enemyElement = $("#"+name); 52 | enemyElement.addClass("enemy"); 53 | enemyElement[0].enemy = new Enemy(enemyElement, enemyValue); 54 | enemyElement.text(enemyValue); 55 | }, enemySpawnRate); 56 | 57 | $.playground().startGame(); 58 | -------------------------------------------------------------------------------- /shooter/after_recipe2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shooter 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /shooter/after_recipe3/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe3/background1.png -------------------------------------------------------------------------------- /shooter/after_recipe3/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe3/background2.png -------------------------------------------------------------------------------- /shooter/after_recipe3/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe3/background3.png -------------------------------------------------------------------------------- /shooter/after_recipe3/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe3/background4.png -------------------------------------------------------------------------------- /shooter/after_recipe3/game.css: -------------------------------------------------------------------------------- 1 | .enemy{ 2 | color:red; 3 | background-color: black; 4 | font-size:24px; 5 | border:1px solid red; 6 | text-align:center; 7 | } 8 | #player{ 9 | color:white; 10 | background-color:black; 11 | font-size:24px; 12 | border: 1px solid white; 13 | text-align:center; 14 | } 15 | -------------------------------------------------------------------------------- /shooter/after_recipe3/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shooter 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /shooter/after_recipe4/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe4/background1.png -------------------------------------------------------------------------------- /shooter/after_recipe4/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe4/background2.png -------------------------------------------------------------------------------- /shooter/after_recipe4/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe4/background3.png -------------------------------------------------------------------------------- /shooter/after_recipe4/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe4/background4.png -------------------------------------------------------------------------------- /shooter/after_recipe4/game.css: -------------------------------------------------------------------------------- 1 | .enemy{ 2 | color:red; 3 | background-color: black; 4 | font-size:24px; 5 | border:1px solid red; 6 | text-align:center; 7 | } 8 | #player{ 9 | color:white; 10 | background-color:black; 11 | font-size:24px; 12 | border: 1px solid white; 13 | text-align:center; 14 | } 15 | -------------------------------------------------------------------------------- /shooter/after_recipe4/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shooter 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /shooter/after_recipe5/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe5/background1.png -------------------------------------------------------------------------------- /shooter/after_recipe5/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe5/background2.png -------------------------------------------------------------------------------- /shooter/after_recipe5/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe5/background3.png -------------------------------------------------------------------------------- /shooter/after_recipe5/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/after_recipe5/background4.png -------------------------------------------------------------------------------- /shooter/after_recipe5/game.css: -------------------------------------------------------------------------------- 1 | .enemy{ 2 | color:red; 3 | background-color: black; 4 | font-size:24px; 5 | border:1px solid red; 6 | text-align:center; 7 | } 8 | #player{ 9 | color:white; 10 | background-color:black; 11 | font-size:24px; 12 | border: 1px solid white; 13 | text-align:center; 14 | } 15 | .playerMissiles{ 16 | text-align:center; 17 | border: solid 1px green; 18 | font-size:24px; 19 | color:green; 20 | background-color:black; 21 | } 22 | .number{ 23 | color:green; 24 | } 25 | -------------------------------------------------------------------------------- /shooter/after_recipe5/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shooter 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /shooter/final/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/final/background1.png -------------------------------------------------------------------------------- /shooter/final/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/final/background2.png -------------------------------------------------------------------------------- /shooter/final/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/final/background3.png -------------------------------------------------------------------------------- /shooter/final/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/final/background4.png -------------------------------------------------------------------------------- /shooter/final/game.css: -------------------------------------------------------------------------------- 1 | .enemy{ 2 | color:red; 3 | background-color: black; 4 | font-size:24px; 5 | border:1px solid red; 6 | text-align:center; 7 | } 8 | #player{ 9 | color:white; 10 | background-color:black; 11 | font-size:24px; 12 | border: 1px solid white; 13 | text-align:center; 14 | } 15 | .playerMissiles{ 16 | text-align:center; 17 | border: solid 1px green; 18 | font-size:24px; 19 | color:green; 20 | background-color:black; 21 | } 22 | .number{ 23 | color:green; 24 | } 25 | -------------------------------------------------------------------------------- /shooter/final/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Shooter 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /shooter/initial/background1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/initial/background1.png -------------------------------------------------------------------------------- /shooter/initial/background2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/initial/background2.png -------------------------------------------------------------------------------- /shooter/initial/background3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/initial/background3.png -------------------------------------------------------------------------------- /shooter/initial/background4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/initial/background4.png -------------------------------------------------------------------------------- /shooter/initial/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EvanBurchard/jsarcade/a4c81f582acb97fdd4160fd0d3f4d367ec1c2d97/shooter/initial/index.html --------------------------------------------------------------------------------