From 0cd85c8e3e4a4101f21ce2f269c987177f3d82b1 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Sun, 5 Oct 2014 14:28:54 +0200 Subject: Import jaws source diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2a2af19 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +The jaws/ subdirectory is from http://jawsjs.com, and is separately licensed (LGPL) and copyrighted. + +"vaquita1.jpg" was contributed anonymously for promoting vaquitas + + +Files: pixyvaquita* +Copyright: 2014 Michele Bini +License: Creative Commons Attribution Share-alike + + +Files: index.html.coffee, game.html.coffee +Copyright: 2014 Michele Bini +License: MIT-LICENSE diff --git a/jaws/LICENSE b/jaws/LICENSE new file mode 100644 index 0000000..65c5ca8 --- /dev/null +++ b/jaws/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/jaws/README.rdoc b/jaws/README.rdoc new file mode 100644 index 0000000..5a84523 --- /dev/null +++ b/jaws/README.rdoc @@ -0,0 +1,276 @@ += Jaws - HTML5 Javascript web game development library +{Build Status}[https://travis-ci.org/ippa/jaws] + +Depends on JavaScript Edition 5. Works with Chrome 9+, Firefox 3.6+, Safari 5+ & IE9. + +Licensed under LGPL so you're free to use it for commercial projects. + +== Highlights +* Animation(), Sprite(), SpriteSheet(), TileMap(), Assets() and other useful constructors +* Easy and robust game state system to switch between menus, play, high score lists and settings +* JSDOC Documentation & commented examples + +Jaws also: +- Uses 2D canvas to draw stuff on the screen +- Does not depend on any other JavaScript library +- Suple-simple-to-use collision detection, bounding box and circles. +- Doesn't try to force a certain "JS class pattern" on you, just pure JavaScript as mother nature intended it +- Tries to make assets (images, music, json data) in webgames as easy as possible +- Often does object literals as arguments for readabillity (ie. new Sprite({image: "player.png", x: 100, y: 100}) +- Builds on lessons learned from years of developing http://github.com/ippa/chingu (Ruby game lib) + +== Local build / test + npm install + npm test + +== Learn more +- {http://jawsjs.com/docs/index.html}[http://jawsjs.com/docs/index.html] - Jaws documentation +- {http://jawsjs.com/}[http://jawsjs.com/] - Official Jaws homepage. Overview and design choices. +- {http://jawsjs.com/jawsjs/test/index.html}[http://jawsjs.com/jawsjs/test/index.html] - Jaws testsuite (QUnit) + +== Tutorials +- {http://videlais.com/2013/05/17/learning-jawsjs-part-1/}[http://videlais.com/2013/05/17/learning-jawsjs-part-1/] - Intro to sprites, collisions and game states by Dan Cox. +- {http://videlais.com/2013/05/23/learning-jawsjs-part-2/}[http://videlais.com/2013/05/23/learning-jawsjs-part-2/] - SpriteList, collideOneWithMany and more. +- {http://videlais.com/2013/06/01/learning-jawsjs-part-3/}[http://videlais.com/2013/06/01/learning-jawsjs-part-3/] - Viewport & assets. +- {http://videlais.com/2013/06/05/learning-jawsjs-part-4/}[http://videlais.com/2013/06/05/learning-jawsjs-part-4/] - SpriteSheet, Animation and game states. + +== What kind of games can you make with Jaws? +Jaws is well suited for "classic" side/top scrolling games (tile based or not) where you have a number of sprite-sheet-animated sprites. +Jaws comes with basic rect-vs-rect/circle-vs-circle collision detection that works well in most cases. If you have _tons_ of sprites (for example, a bullet hell schmup) you probably want to use a physicslib like Box2D or spatial +hashing like quad trees to speed things up. Jaws use of canvas makes pixel perfect collisions and worms-style terrain relatively easy to develop. If your game is very GUI-heavy you might want to base your game on pure HTML-elements instead of canvas-sprites. + +== Simple examples demonstrating certain features +Check out the sourcecode for comments and explanations: + +* http://jawsjs.com/jawsjs/examples/example0.html - get a Jaws-app working with as little code as possible +* http://jawsjs.com/jawsjs/examples/example1.html - basic example with manual setup of canvas +* http://jawsjs.com/jawsjs/examples/example2.html - jaws game states +* http://jawsjs.com/jawsjs/examples/example3.html - jaws.Animation +* http://jawsjs.com/jawsjs/examples/example4.html - jaws.Rect based collision detection +* http://jawsjs.com/jawsjs/examples/example5.html - the jaws.Sprite({anchor: "..."}) parameter +* http://jawsjs.com/jawsjs/examples/example6.html - jaws.Parallax +* http://jawsjs.com/jawsjs/examples/example7.html - simple DOM-based sprite (DEPRECATED) +* http://jawsjs.com/jawsjs/examples/example8.html - jaws.TileMap +* http://jawsjs.com/jawsjs/examples/example9.html - jaws.Viewport (The basics for a sidescrolling platformer right here) +* http://jawsjs.com/jawsjs/examples/example10.html - jaws.game_states.Edit, a simple map editor +* http://jawsjs.com/jawsjs/examples/example11.html - jaws.gfx.retroScaleImage and Literal Notion game state +* http://jawsjs.com/jawsjs/examples/example12.html - jaws.viewport.drawTileMap() - optimized tile map drawing + +== Games using Jaws +* {http://www.ludumdare.com/compo/ludum-dare-29/?action=preview&uid=21212}[http://www.ludumdare.com/compo/ludum-dare-29/?action=preview&uid=21212] - DrillFish: drill through the levels as a very odd fish - by mezka +* {http://recardona.github.io/BitBot/}[http://recardona.github.io/BitBot/] - BitBot: puzzle, enter commands to the robot to reach the goal +* {http://ld27.pauljoannon.com//}[http://ld27.pauljoannon.com/] - Castle Clocksworth: Steampunk-style puzzle adventure +* {http://ippa.se/webgames/the_adventures_of_10_seconds/}[http://ippa.se/webgames/the_adventures_of_10_seconds/] - Small worms-style terrain puzzle-adventure! +* {http://mcfunkypants.com/LD26/}[http://mcfunkypants.com/LD26/] - Colorful abstract platformer by McFunkypants +* {http://games.subdimension.co.uk/LD26/}[http://games.subdimension.co.uk/LD26/] - Unique painting mini-game by Malphas Wats +* {http://mcfunkypants.com/RubbaRabbit/}[http://mcfunkypants.com/RubbaRabbit/] - Fullscreen platformer by McFunkypants +* {http://mcfunkypants.com/Gwendolynn/}[http://mcfunkypants.com/Gwendolynn/] - Gwendolynn, platformer by McFunkypants +* {http://gamejolt.com/games/arcade/b-w-tennis/13883/}[http://gamejolt.com/games/arcade/b-w-tennis/13883/] - Pong-clone by devpoga +* {http://ricardonakamura.org/game/ld25/}[http://ricardonakamura.org/game/ld25/] - Sword of Truth by http://ricardonakamura.org/ +* {http://gamejolt.com/games/arcade/for-victory/14267/}[http://gamejolt.com/games/arcade/for-victory/14267/] - Minimalistic game by devpoga +* {http://www.castleriot.com/}[http://www.castleriot.com/] - Multiplayer game with guards and thieves. By team @ http://nodeknockout.com/teams/third-times-the-char +* {http://ippa.se/webgames/the_escape/index.html}[http://ippa.se/webgames/the_escape/index.html] - "The Escape" - My Ludum Dare #21 entry. Adventure/Puzzle. +* {http://ippa.se/webgames/unexpected_outcome/index.html}[http://ippa.se/webgames/unexpected_outcome/index.html] - A 10-minute adventure game with pixel-perfect collisions +* {http://ippa.se/webgames/unwaivering/index.html}[http://ippa.se/webgames/unwaivering/index.html] - A Jaws-game for http://www.ludumdare.com/compo/2011/01/25/minild-24/ +* {http://dl.dropbox.com/u/73425602/ld23/index.html}[http://dl.dropbox.com/u/73425602/ld23/index.html] - LD #23 game by Nibelung (http://www.ludumdare.com/compo/author/nibelung/) +* {http://www.twitchtetris.com/}[http://www.twitchtetris.com/] - A tetris game by http://twitchcode.blogspot.com/ +* {http://www.mcfunkypants.com/kart/magma/}[http://www.mcfunkypants.com/kart/magma/] - Another pixel perfect game from MC Funky Pants. Don't touch the rising lava! +* {http://dl.dropbox.com/u/15658925/LD22%20release/game.html}[http://dl.dropbox.com/u/15658925/LD22%20release/game.html] - LD#22 entry by "Char" (http://www.ludumdare.com/compo/ludum-dare-22/?action=preview&uid=3407) +* {http://h31p.com/save-atherton/}[http://h31p.com/save-atherton/] - A political satire mini-game from https://github.com/dalethatcher +* {http://www.mcfunkypants.com/LD22/}[http://www.mcfunkypants.com/LD22/] - a Ludum Dare #22 entry by Christer Kaitila +* {http://nibster.net/LD/}[http://nibster.net/LD/] - a Ludum Dare #22 entry by https://github.com/Nibster +* {http://memetika.com/iron_santa/}[http://memetika.com/iron_santa/] - a Ludum Dare #22 entry by https://github.com/dmitrizagidulin +* {http://markbennett.ca/JAWS-on-a-plane/}[http://markbennett.ca/JAWS-on-a-plane/] - A minigame by https://github.com/MarkBennett +* {http://davidgomes.github.com/paxlure/}[http://davidgomes.github.com/paxlure/] - Zombie blasting minigame by https://github.com/davidgomes +* {http://crystalpart.com/hp/}[http://crystalpart.com/hp/] - A mini game by by Ashan Fernando (http://crystalpart.com/wp/) +* {http://magigames.org/runestone_defense.html}[http://magigames.org/runestone_defense.html] - Runestone, a tower defense game by David Blood +* {http://www.tinycrate.com/ld48/vivere/}[http://www.tinycrate.com/ld48/vivere/] - TinyCrate - An experimental game about mixing DNA by http://www.thank-etc-ok.com/ +* {http://www.tinycrate.com/ld48/volo/}[http://www.tinycrate.com/ld48/volo/] - VOLO - A game by http://www.thank-etc-ok.com +* {http://www.philbgarner.com/vampire/}[http://www.philbgarner.com/vampire/] - Scion of Dracula - Play dracula in search for Van Helsing. By Phil Garner. +* {http://charitygamejam.com/?Parachute%20Champ}[http://charitygamejam.com/?Parachute%20Champ] - Parachute Champ - land your parachute safely. By Nicholas Wrenn. +* {https://www.facebook.com/appcenter/hopeofabug}[https://www.facebook.com/appcenter/hopeofabug] - Facebook minigame by Fahad Mahmood. +... missing your game here? Mail me about it (my email is on my github profilepage). Or create a new issue. + +== Libs using Jaws +* {http://mcfunkypants.com/tower/} - Tower Game Starter Kit +* {http://mcfunkypants.com/ludus/}[http://mcfunkypants.com/ludus/] - Platformer Game Starter Kit +* {https://github.com/deisdestiny/Jaws-TS}[https://github.com/deisdestiny/Jaws-TS] - Jaws TypeScript Definitions + +== Loading Jaws +* jaws.js - includes the whole framework in one easy-to-include file. +* jaws-min.js - same as jaws.js but minified with Googles closure compiler. This is probably what you want to include in your project. +* jaws-dynamic.js - dynamically loads all separate jaws files. Useful for debugging errors when patching jaws since you get exact file/line# of possible errors. Warning, jaws-dynamic.js loads all Jaws-files asynchronously, resulting in Jaws might not be fully loaded when the browser reaches your game.js. You can solve this by hooking into the jaws.onload callback and put your jaws.start() there. + +You can also link to invidual files in your HTML: + + + +NOTE: core.js is always needed but after that you can pick and choose depending on what you need. +A rule of thumb is that a file named "foo.js" will include a constructor named Foo(). + +NOTE #2: jaws.js and jaws-min.js does Not include files from src/extras-dir. +Examples of files that aren't included in the mainbundle are: tile_map_pathfinding.js, pixel_map.js and audio.js (jaws