diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/.DS_Store differ diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..a44fe1f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,7 @@ +Copyright (c) 2013 ambc + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e09b887 --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# [The Bunnies, Inc. ](http://ambrosechua.github.com/thebunniesinc) + +Follow [@thebunniesinc](http://twitter.com/thebunniesinc) for updates. + +**WARNING** Game is not playable. Proceed at your own risk. + +The Bunnies, Inc is still in alpha. Help is strongly appreciated. See my progress at: [j.mp/bunniesalpha](http://j.mp/bunniesalpha) + +## Description +* A HTML5 and CSS3 game built with jQuery, G. Maps API and Canvas Element. + + +HTML5 Powered with CSS3 / Styling, Graphics, 3D & Effects, and Offline & Storage + + +> All the bunnies in the world have turned evil after Dr. Evil Bunny caused an mysterious explosion. All, except you, the last bunny standing. Your mission: get into Dr. Evil Bunny's lab while avoiding the evil bunnies (and at worst killing them) and till then, to be continued... + +## License +* MIT see [LICENSE.md](https://github.com/ambrosechua/thebunniesinc/blob/master/LICENSE.md) diff --git a/alpha/assets/assets-raw.jpg b/alpha/assets/assets-raw.jpg new file mode 100644 index 0000000..66bafb1 Binary files /dev/null and b/alpha/assets/assets-raw.jpg differ diff --git a/alpha/assets/bar.png b/alpha/assets/bar.png new file mode 100644 index 0000000..1f89703 Binary files /dev/null and b/alpha/assets/bar.png differ diff --git a/alpha/assets/barfill.png b/alpha/assets/barfill.png new file mode 100644 index 0000000..07e3c85 Binary files /dev/null and b/alpha/assets/barfill.png differ diff --git a/alpha/assets/cursor.png b/alpha/assets/cursor.png new file mode 100644 index 0000000..5332027 Binary files /dev/null and b/alpha/assets/cursor.png differ diff --git a/alpha/assets/eknife.png b/alpha/assets/eknife.png new file mode 100644 index 0000000..7a69101 Binary files /dev/null and b/alpha/assets/eknife.png differ diff --git a/alpha/assets/ft.png b/alpha/assets/ft.png new file mode 100644 index 0000000..11f1c47 Binary files /dev/null and b/alpha/assets/ft.png differ diff --git a/alpha/assets/house.png b/alpha/assets/house.png new file mode 100644 index 0000000..11bfdfe Binary files /dev/null and b/alpha/assets/house.png differ diff --git a/alpha/assets/icon.png b/alpha/assets/icon.png new file mode 100644 index 0000000..b1d7e65 Binary files /dev/null and b/alpha/assets/icon.png differ diff --git a/alpha/assets/pauseplay.png b/alpha/assets/pauseplay.png new file mode 100644 index 0000000..a76869e Binary files /dev/null and b/alpha/assets/pauseplay.png differ diff --git a/alpha/assets/the-bunnies.png b/alpha/assets/the-bunnies.png new file mode 100644 index 0000000..412f895 Binary files /dev/null and b/alpha/assets/the-bunnies.png differ diff --git a/alpha/assets/wrench.png b/alpha/assets/wrench.png new file mode 100644 index 0000000..d56e018 Binary files /dev/null and b/alpha/assets/wrench.png differ diff --git a/alpha/assets/you.png b/alpha/assets/you.png new file mode 100644 index 0000000..f4c2a8b Binary files /dev/null and b/alpha/assets/you.png differ diff --git a/alpha/cache.manifest b/alpha/cache.manifest new file mode 100644 index 0000000..30724e9 --- /dev/null +++ b/alpha/cache.manifest @@ -0,0 +1,15 @@ +CACHE MANIFEST +# v2.0.0d14 +CACHE: +index.html +main.js +main.css +assets/cursor.png +assets/ft.png +assets/house.png +assets/icon.png +assets/pauseplay.png +assets/the-bunnies.png +assets/you.png +NETWORK: +* \ No newline at end of file diff --git a/alpha/index.html b/alpha/index.html new file mode 100644 index 0000000..c3d3662 --- /dev/null +++ b/alpha/index.html @@ -0,0 +1,134 @@ + + + +The Bunnies, Inc. + + + + + + + + +
+
+
+Loading... +
+
+ +
Pause
+ +
+
+
+
+ +
+

Paused

+
▶ Continue playing
+
End game
+
+ + + +
+

About

+The Bunnies Inc. by ambc
+
+

Starring

+The Bunnies,
+Google Maps and
+ + +HTML5 Powered with CSS3 / Styling, Graphics, 3D & Effects, and Offline & Storage + +
+Entire game licensed under MIT.
+Parts of this game includes code from other sources.
+Release history. | Website. +
+ +

Aww, snap!

Please use a updated browser to play.

+ +
+
+
+
+ +
+
 
+
+ +
+ +
+
+
+
+ + + + + + + diff --git a/alpha/main.css b/alpha/main.css new file mode 100644 index 0000000..54b0bce --- /dev/null +++ b/alpha/main.css @@ -0,0 +1,375 @@ + +@import url(http://fonts.googleapis.com/css?family=Londrina+Solid|Londrina+Shadow); +* { +margin: 0; +outline: none; +padding: 0;/* +-webkit-touch-callout: none; +-webkit-user-select: none; +-khtml-user-select: none; +-moz-user-select: none; +-ms-user-select: none;*/ +user-select: none; +font-family: "Londrina Solid";/* +-webkit-box-sizing: border-box; +-moz-box-sizing: border-box;*/ +box-sizing: border-box; +} +html { +height: 100%; +width: 100%; +overflow: hidden; +background-color: #222; +} +body { +background-color: #222; +color: #eee; +text-align: center; +width: 100%; +height: 100%; +font-size: 20px; +line-height: 20px; +vertical-align: middle; +overflow: hidden; +cursor: url(assets/cursor.png) 4 4, auto; +} +#loading { +background-color: #aaa; +color: rgba(0, 0, 0, 0.5); +text-align: center; +z-index: 9990; +position: absolute; +top: 0; +bottom: 0; +left: 0; +right: 0; +/* backface-visibility: hidden; */ +} +#loadingc { +position: absolute; +top: 50%; +left: 50%; +z-index: 9999; +margin: -50px 0 0 -100px; +height: 100px; +width: 200px; +font-size: 20px; +} + +@keyframes loading { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +}/* +@-moz-keyframes loading { + from { + -moz-transform: rotate(0deg); + } + to { + -moz-transform: rotate(360deg); + } +} +@-webkit-keyframes loading { + from { + -webkit-transform: rotate(0deg); + } + to { + -webkit-transform: rotate(360deg); + } +} +@-ms-keyframes loading { + from { + -ms-transform: rotate(0deg); + } + to { + -ms-transform: rotate(360deg); + } +} +@-o-keyframes loading { + from { + -o-transform: rotate(0deg); + } + to { + -o-transform: rotate(360deg); + } +}*/ +.loading { + width: 20px; + height: 20px; + margin-right: 0px; + background-color: rgba(0, 0, 0, 0.5); + border-radius: 10px; + border-top-right-radius: 0px;/* + -webkit-border-radius: 10px; + -webkit-border-top-right-radius: 0px; + -moz-border-radius: 10px; + -moz-border-top-right-radius: 0px; + -o-border-radius: 10px; + -o-border-top-right-radius: 0px; + -ms-border-radius: 10px; + -ms-border-top-right-radius: 0px;*/ + animation: loading 1s infinite;/* + -webkit-animation: loading 1s infinite; + -moz-animation: loading 1s infinite; + -o-animation: loading 1s infinite; + -ms-animation: loading 1s infinite;*/ + display: inline-block; +} +#map_canvas { +width: 100%; +height: 100%; +} +#dpf, #dpb, #dpl, #dpr { +width: 50px; +height: 50px; +line-height: 50px; +font-size: 20px; +border: 1px solid #999; +border-radius: 10px; +background-color: #bbb; +color: #333; +opacity: 0.8; +z-index: 3; +} +#dpf:active, #dpb:active, #dpl:active, #dpr:active { +background-color: #aaa; +border: 1px solid #888; +} +#dpf { +position: absolute; +bottom: 130px; +right: 60px; +} +#dpb { +position: absolute; +bottom: 30px; +right: 60px; +} +#dpl { +position: absolute; +bottom: 80px; +right: 110px; +} +#dpr { +position: absolute; +bottom: 80px; +right: 10px; +} + +#bar { +background-color: rgba(0, 0, 0, 0.0); +z-index: 2; +color: #eee; +padding: 10px 0px; +position: absolute; +top: 0; +left: 0; +right: 0; +vertical-align: middle; +border: 1px solid rgba(0, 0, 0, 0.0); +} +#you { +position: absolute; +top: 0; +left: 0; +z-index: 2; +width: 100%; +height: 100%; +} +#menu, #tgpm, #aboutc { +text-align: center; +position: absolute; +top: 0; +left: 0; +right: 0; +bottom: 0; +z-index: 6; +background-color: rgba(0, 0, 0, 0.8); +} +#menu > h1 { +font-family: "Londrina Shadow"; +padding: 30px 10px; +font-size: 30px; +line-height: 30px; +word-spacing: 20px; +background: transparent url("assets/the-bunnies.png") center center no-repeat; +background-size: 250px 40px; +color: transparent; +} +h1 { +font-family: "Londrina Shadow"; +padding: 30px 10px; +font-size: 30px; +line-height: 30px; +} +h2 { +font-family: "Londrina Shadow"; +font-size: 25px; +padding: 15px 5px; +line-height: 25px; +font-weight: 300; +} +.btn { +color: #fff; +padding: 5px 10px; +margin: 10px auto; +box-shadow: -5px -5px 1px rgba(255, 255, 255, 0.25); +border: 1px dashed #fff; +font-size: 20px; +display: block; +width: 200px; +background-color: rgba(255, 255, 255, 0.5); +text-decoration: none; +} +.btn:hover { +box-shadow: -3px -3px 1px rgba(255, 255, 255, 0.25); +position: relative; +top: -2px; +left: -2px; +background-color: rgba(255, 255, 255, 0.4); +} +#dir { +width: 2px; +height: 100px; +background-color: #fff; +} +#dirh { +width: 2px; +height: 200px; +position: absolute; +left: 50%; +top: 50%; +z-index: 2; +margin: -100px 0 0 -1px; +} +#tgp { +margin: 0; +width: auto; +padding: 10px 5px; +z-index: 4; +line-height: 20px; +position: absolute; +right: 0px; +top: 0px; +font-size: 20px; +display: none; +/* box-shadow: -5px 5px 1px rgba(255, 255, 255, 0.25); */ +color: #fff; +border-radius: 5px; +background: transparent url("assets/pauseplay.png") no-repeat right top; +width: 42px; +background-size: 42px 84px; +color: transparent; +} +#tgp:hover { +/* box-shadow: -3px 3px 1px rgba(255, 255, 255, 0.25); */ +position: absolute; +right: 2px; +top: 2px; +} +#tgpm, #aboutc { +display: none; +} +#aboutc { +line-height: 25px; +font-size: 20px; +} +#play-holder { +width: 600px; +margin-left: auto; +margin-right: auto; +margin-bottom: -10px; +} +#play-b-holder { +display: inline-block; +} +#opt-holder { +display: inline-block; +height: 0; +overflow: hidden; +transition: all 1s; +float: right; +color: #fff; +font-size: 20px; +width: 200px; +/* background-color: rgba(255, 255, 255, 0.5); */ +text-decoration: none; +margin-top: -42px; +margin-right: -10px; +background: rgba(255, 255, 255, 0.1) url(assets/wrench.png) no-repeat 5px 5px; +} +#play-holder:hover > #opt-holder { +height: 75px; +} +#opt-holder > select { +margin: 20px 20px; +appearance: none; +color: #fff; +padding: 3px; +box-shadow: -5px -5px 1px rgba(255, 255, 255, 0.15); +border: 1px dashed #fff; +font-size: 15px; +display: block; +background-color: rgba(255, 255, 255, 0.3); +text-decoration: none; +border-radius: 0; +background-image: none; +letter-spacing: 1px; +width: auto; +} +#opt-holder > select:hover { +box-shadow: -3px -3px 1px rgba(255, 255, 255, 0.15); +position: relative; +top: -2px; +left: -2px; +background-color: rgba(255, 255, 255, 0.4); +} + +h1 > sup { +font-size: 13px; +line-height: 13px; +font-weight: 400; +color: red; +} +#sec { +float: center; +display: inline-block; +} +#kills { +float: left; +display: inline-block; +margin-left: 30px; +} +#frame { +width: 0; +height: 0; +} +#bunny { +display: none; +width: 100px; +height: 175px; +position: absolute; +top: 50%; +left: 50%; +margin-top: -82.5px; +margin-left: -50px; +background: url(assets/you.png); +background-size: 100% 100%; +z-index: 3; +} +.enemy { +display: block; +width: 100px; +height: 175px; +position: absolute; +top: 0px; +left: 0px; +margin-top: -82.5px; +margin-left: -50px; +background: url(assets/eknife.png); +background-size: 100% 100%; +z-index: 1; +} \ No newline at end of file diff --git a/alpha/main.js b/alpha/main.js new file mode 100644 index 0000000..26076db --- /dev/null +++ b/alpha/main.js @@ -0,0 +1,347 @@ +$(document).ready(function() { + +var step=3; +var stti=10; +var frames=stti/2; +var interf=0; +var interb=0; +var interl=0; +var interr=0; +var player={ +x: 0, +y: 0, +health: 100, +weapon: 0 +}; +var evil=[]; + +function spawnevil() { +newevil=$('
'); +where=Math.floor(Math.random()+0.5); +if (where==0) { +top=0; +left=Math.floor(Math.random()*window.innerWidth+0.5); +} +else if (where==1) { +left=0; +top=Math.floor(Math.random()*window.innerHeight+0.5); +} +newevil.css("left", left+"px"); +newevil.css("top", top+"px"); +$("#frame").append(newevil); +} + +function angle(x, y, bx, by) { +return Math.atan2(bx-x, by-y)/Math.PI*-180; +} + +function dpf() { +map.panBy(0, -step); +player.x -= step; +} +function dpb() { +map.panBy(0, step); +player.x += step; +} +function dpl() { +map.panBy(-step, 0); +player.y -= step; +} +function dpr() { +map.panBy(step, 0); +player.y += step; +} + +window.addEventListener('load', function(e) { +window.applicationCache.addEventListener('updateready', function(e) { +if (window.applicationCache.status == window.applicationCache.UPDATEREADY) { +window.applicationCache.swapCache(); +if (confirm('An update for this game has been downloaded. Update now? ')) { +window.location.reload(); +} +} else { +} +}, false); +}, false); + +function setin(dir) { +//functorun=functor; +//functorun(); +if (dir==0 && !interf) { +interf=setInterval(function() { +dpf(); +}, stti); +} +if (dir==1 && !interb) { +interb=setInterval(function() { +dpb(); +}, stti); +} +if (dir==2 && !interl) { +interl=setInterval(function() { +dpl(); +}, stti); +} +if (dir==3 && !interr) { +interr=setInterval(function() { +dpr(); +}, stti); +} +} +function clrin(dir) { +if (dir==0) { +clearInterval(interf); +interf=0; +} +if (dir==1) { +clearInterval(interb); +interb=0; +} +if (dir==2) { +clearInterval(interl); +interl=0; +} +if (dir==3) { +clearInterval(interr); +interr=0; +} +} + +if (!(("ontouchstart" in window) || ("onmsgesturechange" in window))) { +$("#dpf, #dpb, #dpl, #dpr").css("display", "none"); +} + +//stackoverflow +function getPosition(e) { +var targ; +if (!e) +e = window.event; +if (e.target) +targ = e.target; +else if (e.srcElement) +targ = e.srcElement; +if (targ.nodeType == 3) +targ = targ.parentNode; +var x = e.pageX - $(targ).offset().left; +var y = e.pageY - $(targ).offset().top; +$("#dirh").css("transform", "rotate("+angle(x, y, $("#you").width()/2, $("#you").height()/2)+"deg)"); + +} + +function start() { + +$("#tgpm").fadeOut(); + +counter=setInterval(function() { +timenow=new Date().getTime(); +sec=timenow-timebefore; +$("#sec").html(sec+"ms"); +}, 1); + + +$("#you").on("mousedown", function(event) { +getPosition(event); +}); +$("#you").on("mousemove", function(event) { +getPosition(event); +}); +$("#you").on("mouseup", function(event) { +getPosition(event); +}); + + +if (("ontouchstart" in window) || ("onmsgesturechange" in window)) { +$("#dpf").on("touchstart", function() { +setin(0); +}); +$("#dpb").on("touchstart", function() { +setin(1); +}); +$("#dpl").on("touchstart", function() { +setin(2); +}); +$("#dpr").on("touchstart", function() { +setin(3); +}); +$("#dpf").on("touchend", function() { +clrin(0); +}); +$("#dpb").on("touchend", function() { +clrin(1); +}); +$("#dpl").on("touchend", function() { +clrin(2); +}); +$("#dpr").on("touchend", function() { +clrin(3); +}); +} +else { + +$("#dpf").on("mousedown", function() { +setin(0); +}); +$("#dpb").on("mousedown", function() { +setin(1); +}); +$("#dpl").on("mousedown", function() { +setin(2); +}); +$("#dpr").on("mousedown", function() { +setin(3); +}); +$("#dpf").on("mouseup", function() { +clrin(0); +}); +$("#dpb").on("mouseup", function() { +clrin(1); +}); +$("#dpl").on("mouseup", function() { +clrin(2); +}); +$("#dpr").on("mouseup", function() { +clrin(3); +}); +} + +$(document).off("keydown"); + +wasdown=0; +$(document).on("keydown", function(eve) { +w=eve.which; +if (w==87) { +setin(0); +} +else if (w==83) { +setin(1); +} +else if (w==65) { +setin(2); +} +else if (w==68) { +setin(3); +} +else if (w==38) { +setin(0); +} +else if (w==40) { +setin(1); +} +else if (w==37) { +setin(2); +} +else if (w==39) { +setin(3); +} +else if (w==27 || w==81) { +end(); +} +}); +$(document).on("keyup", function(eve) { +w=eve.which; +if (w==87) { +clrin(0); +} +else if (w==83) { +clrin(1); +} +else if (w==65) { +clrin(2); +} +else if (w==68) { +clrin(3); +} +else if (w==38) { +clrin(0); +} +else if (w==40) { +clrin(1); +} +else if (w==37) { +clrin(2); +} +else if (w==39) { +clrin(3); +} +}); +} + + +function end() { +clrin(0); +clrin(1); +clrin(2); +clrin(3); +clearInterval(counter); +$("#you").off("mousedown").off("mousemove").off("mouseup"); +if (("ontouchstart" in window) || ("onmsgesturechange" in window)) { +$("#dpf").off("touchstart").off("touchend"); +$("#dpb").off("touchstart").off("touchend"); +$("#dpl").off("touchstart").off("touchend"); +$("#dpr").off("touchstart").off("touchend"); +} +else { +$("#dpf").off("mousedown").off("mouseup"); +$("#dpb").off("mousedown").off("mouseup"); +$("#dpl").off("mousedown").off("mouseup"); +$("#dpr").off("mousedown").off("mouseup"); +} +wasdown=0; +$(document).off("keyup").off("keydown"); +$(document).on("keydown", function(eve) { +if (eve.which==27 || eve.which==81) { +start(); +} +}); +$("#tgpm").fadeIn(); +} + + + +function getready() { +$("#menu").fadeOut(); +$("#bar").css("background-color", "rgba(0, 0, 0, 0.5)"); +$("#sec").html("Ready"); +$("#bunny").fadeIn(); +setTimeout(function() { +$("#sec").html("Set"); +}, 2000); +setTimeout(function() { +$("#sec").html("Go! "); +}, 4000); +setTimeout(function() { +$("#kills").html("0 kills"); +$("#tgp").fadeIn().click(function() { +end(); +}); +$("#cont").click(function() { +start(); +}); + + +timebefore=new Date().getTime(); +start(); +}, 4500); +} + +$("#endg").click(function() { +window.location.reload(); +}); +$("#aboutc").click(function() { +$("#aboutc").fadeOut(); +}); +$("#about").click(function() { +$("#aboutc").fadeIn(); +}); + +$("#play").click(function() { +getready(); +}); + +$("#opt-maptype").change(function() { +x=["h", "r", "s", "t"].indexOf($("#opt-maptype > option:selected").val()); +maptype=[google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, google.maps.MapTypeId.TERRAIN][x]; +map.setMapTypeId(maptype); +}); + +}); \ No newline at end of file diff --git a/alpha/xcf/assets-raw.xcf b/alpha/xcf/assets-raw.xcf new file mode 100644 index 0000000..cdfe57d Binary files /dev/null and b/alpha/xcf/assets-raw.xcf differ diff --git a/alpha/xcf/bar.xcf b/alpha/xcf/bar.xcf new file mode 100644 index 0000000..398ec9e Binary files /dev/null and b/alpha/xcf/bar.xcf differ diff --git a/alpha/xcf/barfill.xcf b/alpha/xcf/barfill.xcf new file mode 100644 index 0000000..bd05b05 Binary files /dev/null and b/alpha/xcf/barfill.xcf differ diff --git a/alpha/xcf/cursor.xcf b/alpha/xcf/cursor.xcf new file mode 100644 index 0000000..607c47d Binary files /dev/null and b/alpha/xcf/cursor.xcf differ diff --git a/alpha/xcf/eknife.xcf b/alpha/xcf/eknife.xcf new file mode 100644 index 0000000..715039d Binary files /dev/null and b/alpha/xcf/eknife.xcf differ diff --git a/alpha/xcf/ft.xcf b/alpha/xcf/ft.xcf new file mode 100644 index 0000000..1216347 Binary files /dev/null and b/alpha/xcf/ft.xcf differ diff --git a/alpha/xcf/house.xcf b/alpha/xcf/house.xcf new file mode 100644 index 0000000..2d31339 Binary files /dev/null and b/alpha/xcf/house.xcf differ diff --git a/alpha/xcf/icon.xcf b/alpha/xcf/icon.xcf new file mode 100644 index 0000000..b6be341 Binary files /dev/null and b/alpha/xcf/icon.xcf differ diff --git a/alpha/xcf/pauseplay.xcf b/alpha/xcf/pauseplay.xcf new file mode 100644 index 0000000..3b96c72 Binary files /dev/null and b/alpha/xcf/pauseplay.xcf differ diff --git a/alpha/xcf/the-bunnies.xcf b/alpha/xcf/the-bunnies.xcf new file mode 100644 index 0000000..7286861 Binary files /dev/null and b/alpha/xcf/the-bunnies.xcf differ diff --git a/alpha/xcf/you.xcf b/alpha/xcf/you.xcf new file mode 100644 index 0000000..064e213 Binary files /dev/null and b/alpha/xcf/you.xcf differ