Initial commit: Carrot Hunter v2 with 20 levels
19
Carrot_Hunter/app.manifest
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "Carrot Hunter",
|
||||
"start_url": "/index.html",
|
||||
"display": "fullscreen",
|
||||
"orientation": "portrait",
|
||||
"icons": [{
|
||||
"src": "icon-16.png",
|
||||
"sizes": "16x16",
|
||||
}, {
|
||||
"src": "icon-32.png",
|
||||
"sizes": "32x32",
|
||||
}, {
|
||||
"src": "icon-128.png",
|
||||
"sizes": "128x128",
|
||||
}, {
|
||||
"src": "icon-256.png",
|
||||
"sizes": "256x256",
|
||||
}]
|
||||
}
|
||||
1
Carrot_Hunter/background.js
Normal file
@@ -0,0 +1 @@
|
||||
chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('index.html', { frame: 'chrome', bounds: { width: 1024, height: 575}, minWidth:1024, minHeight: 575 }); }); chrome.commands.onCommand.addListener(function(command) { console.log("Command triggered: " + command); if (command == "cmdNew") { chrome.app.window.create('index.html', { frame: 'chrome', bounds: { width: 500, height: 900}, minWidth:500, minHeight: 900 }); } });
|
||||
2638
Carrot_Hunter/c2runtime.js
Normal file
28
Carrot_Hunter/c2webappstart.js
Normal file
@@ -0,0 +1,28 @@
|
||||
// Size the canvas to fill the browser viewport.
|
||||
jQuery(window).resize(function() {
|
||||
cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());
|
||||
});
|
||||
|
||||
window.addEventListener('orientationchange', cr_sizeCanvas, false);
|
||||
|
||||
// Start the Construct 2 project running on window load.
|
||||
jQuery(document).ready(function ()
|
||||
{
|
||||
// Create new runtime using the c2canvas
|
||||
cr_createRuntime("c2canvas");
|
||||
|
||||
cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());
|
||||
});
|
||||
|
||||
// Pause and resume on page becoming visible/invisible
|
||||
function onVisibilityChanged() {
|
||||
if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)
|
||||
cr_setSuspended(true);
|
||||
else
|
||||
cr_setSuspended(false);
|
||||
};
|
||||
|
||||
document.addEventListener("visibilitychange", onVisibilityChanged, false);
|
||||
document.addEventListener("mozvisibilitychange", onVisibilityChanged, false);
|
||||
document.addEventListener("webkitvisibilitychange", onVisibilityChanged, false);
|
||||
document.addEventListener("msvisibilitychange", onVisibilityChanged, false);
|
||||
BIN
Carrot_Hunter/chrome-icon.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
Carrot_Hunter/chrome-icon16.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
121
Carrot_Hunter/debug.html
Normal file
@@ -0,0 +1,121 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Carrot Hunter - Debug</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
<style>
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
html, body {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
overflow: hidden;
|
||||
touch-action: none;
|
||||
-ms-touch-action: none;
|
||||
}
|
||||
canvas {
|
||||
touch-action-delay: none;
|
||||
touch-action: none;
|
||||
-ms-touch-action: none;
|
||||
}
|
||||
#debug {
|
||||
position: fixed;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
background: rgba(255,0,0,0.8);
|
||||
color: white;
|
||||
padding: 10px;
|
||||
font-family: monospace;
|
||||
font-size: 12px;
|
||||
z-index: 9999;
|
||||
max-width: 90%;
|
||||
max-height: 200px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ok {
|
||||
background: rgba(0,255,0,0.8) !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="debug">Loading...</div>
|
||||
<div id="fb-root"></div>
|
||||
|
||||
<script>
|
||||
var debugLog = [];
|
||||
function log(msg, isError) {
|
||||
console.log(msg);
|
||||
debugLog.push((isError ? '❌ ' : '✓ ') + msg);
|
||||
updateDebug();
|
||||
}
|
||||
|
||||
function updateDebug() {
|
||||
var div = document.getElementById('debug');
|
||||
div.innerHTML = debugLog.join('<br>');
|
||||
if (debugLog.length > 0 && !debugLog[debugLog.length - 1].startsWith('❌')) {
|
||||
div.className = 'ok';
|
||||
}
|
||||
}
|
||||
|
||||
window.onerror = function(msg, url, line) {
|
||||
log('ERROR: ' + msg + ' at line ' + line, true);
|
||||
return false;
|
||||
};
|
||||
|
||||
log('Starting...');
|
||||
</script>
|
||||
|
||||
<script src="c2runtime.js" onload="log('c2runtime.js loaded')" onerror="log('Failed to load c2runtime.js', true)"></script>
|
||||
|
||||
<canvas id="c2canvas" width="854" height="480">
|
||||
<h1>Your browser does not support HTML5 Canvas</h1>
|
||||
</canvas>
|
||||
|
||||
<script>
|
||||
log('Canvas element created');
|
||||
var canvas = document.getElementById('c2canvas');
|
||||
if (canvas) {
|
||||
log('Canvas found: ' + canvas.width + 'x' + canvas.height);
|
||||
} else {
|
||||
log('Canvas NOT found!', true);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"
|
||||
onload="log('jQuery loaded: v' + jQuery.fn.jquery)"
|
||||
onerror="log('Failed to load jQuery', true)"></script>
|
||||
|
||||
<script>
|
||||
// Wait for jQuery to load
|
||||
var checkJQuery = setInterval(function() {
|
||||
if (typeof jQuery !== 'undefined') {
|
||||
clearInterval(checkJQuery);
|
||||
log('jQuery ready');
|
||||
loadWebAppStart();
|
||||
}
|
||||
}, 100);
|
||||
|
||||
function loadWebAppStart() {
|
||||
var script = document.createElement('script');
|
||||
script.src = 'c2webappstart.js';
|
||||
script.onload = function() {
|
||||
log('c2webappstart.js loaded');
|
||||
setTimeout(function() {
|
||||
if (typeof cr_createRuntime !== 'undefined') {
|
||||
log('Game initialized successfully!');
|
||||
} else {
|
||||
log('cr_createRuntime not found', true);
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
script.onerror = function() {
|
||||
log('Failed to load c2webappstart.js', true);
|
||||
};
|
||||
document.body.appendChild(script);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
BIN
Carrot_Hunter/icon-114.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
Carrot_Hunter/icon-128.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
Carrot_Hunter/icon-16.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
Carrot_Hunter/icon-256.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
Carrot_Hunter/icon-32.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
Carrot_Hunter/images/back-sheet0.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
Carrot_Hunter/images/backgroud-sheet0.png
Normal file
|
After Width: | Height: | Size: 68 KiB |
BIN
Carrot_Hunter/images/bg-sheet0.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
Carrot_Hunter/images/bg1-sheet0.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Carrot_Hunter/images/bg2-sheet0.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
Carrot_Hunter/images/bg3-sheet0.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
Carrot_Hunter/images/bg_info-sheet0.png
Normal file
|
After Width: | Height: | Size: 31 KiB |
BIN
Carrot_Hunter/images/bgk-sheet0.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
Carrot_Hunter/images/bgk6-sheet0.png
Normal file
|
After Width: | Height: | Size: 156 B |
BIN
Carrot_Hunter/images/bglevel2-sheet0.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
Carrot_Hunter/images/bgmlm-sheet0.png
Normal file
|
After Width: | Height: | Size: 82 KiB |
BIN
Carrot_Hunter/images/bgpause-sheet0.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
Carrot_Hunter/images/bgrund-sheet0.png
Normal file
|
After Width: | Height: | Size: 141 KiB |
BIN
Carrot_Hunter/images/bgstage2-sheet0.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
Carrot_Hunter/images/block-sheet0.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
Carrot_Hunter/images/block2-sheet0.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
Carrot_Hunter/images/block3-sheet0.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
Carrot_Hunter/images/block4-sheet0.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
Carrot_Hunter/images/block5-sheet0.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
Carrot_Hunter/images/block6-sheet0.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
Carrot_Hunter/images/block7-sheet0.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
Carrot_Hunter/images/block9-sheet0.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
Carrot_Hunter/images/buttonlevel-sheet0.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
Carrot_Hunter/images/buttonnext-sheet0.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
Carrot_Hunter/images/buttonreplay-sheet0.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
Carrot_Hunter/images/buuton-sheet0.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
Carrot_Hunter/images/carrots-sheet0.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
Carrot_Hunter/images/carrotspeed-sheet0.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
Carrot_Hunter/images/carrotungu-sheet0.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
Carrot_Hunter/images/door-sheet0.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
Carrot_Hunter/images/dtk-sheet0.png
Normal file
|
After Width: | Height: | Size: 168 B |
BIN
Carrot_Hunter/images/enemy1-sheet0.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Carrot_Hunter/images/enemy1-sheet1.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
Carrot_Hunter/images/enemy2-sheet0.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
Carrot_Hunter/images/enemy2-sheet1.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
Carrot_Hunter/images/explosion-sheet0.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
Carrot_Hunter/images/info-sheet0.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
0
Carrot_Hunter/images/jmlwrtl-sheet0.png
Normal file
44
Carrot_Hunter/index.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Carrot Hunter</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
|
||||
<style>
|
||||
* {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
html, body {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
overflow: hidden;
|
||||
touch-action: none;
|
||||
-ms-touch-action: none;
|
||||
}
|
||||
canvas {
|
||||
touch-action-delay: none;
|
||||
touch-action: none;
|
||||
-ms-touch-action: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="fb-root"></div>
|
||||
<script src="c2runtime.js"></script>
|
||||
<canvas id="c2canvas" width="854" height="480">
|
||||
<h1>Your browser does not appear to support HTML5. Try upgrading your browser to the latest version. <a href="http://www.whatbrowser.org">What is a browser?</a>
|
||||
<br/><br/><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Microsoft Internet Explorer</a><br/>
|
||||
<a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a><br/>
|
||||
<a href="http://www.google.com/chrome/">Google Chrome</a><br/>
|
||||
<a href="http://www.apple.com/safari/download/">Apple Safari</a></h1>
|
||||
</canvas>
|
||||
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
|
||||
<script src="c2webappstart.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
17
Carrot_Hunter/manifest.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"manifest_version": 2,
|
||||
"name": "Carrot Hunter",
|
||||
"version": "1.0",
|
||||
"minimum_chrome_version": "28",
|
||||
"app": {
|
||||
"background": {
|
||||
"scripts": ["background.js"]
|
||||
}
|
||||
},
|
||||
"icons": {
|
||||
"16": "icon-16.png",
|
||||
"32": "icon-32.png",
|
||||
"128": "icon-128.png",
|
||||
"256": "icon-256.png"
|
||||
}
|
||||
}
|
||||