Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HexGL #64

Open
wants to merge 7 commits into
base: v1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/routes/games/games.json
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,18 @@
"releaseDate": "?",
"tags": []
},
{
"description": "HexGL is a futuristic, fast-paced racing game built by Thibaut Despoulain using HTML5, Javascript and WebGL and a tribute to the original Wipeout and F-Zero series.",
"developer": "BKcore",
"id": "hexGL",
"image": "hexgl.png",
"platform": "PC",
"name": "HexGL",
"tags": [
"action",
"racing"
]
},
{
"description": "In Basket Random game, try to score a basket by using only one key with different variations from each other!",
"developer": "Unknown",
Expand Down Expand Up @@ -1298,4 +1310,4 @@
]
}
]
}
}
1 change: 1 addition & 0 deletions static/game/hexgl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
4 changes: 4 additions & 0 deletions static/game/hexgl/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
AddType application/x-web-app-manifest+json .webapp
ExpiresByType application/x-web-app-manifest+json "access"
AddType text/cache-manifest .appcache
ExpiresByType text/cache-manifest "access"
21 changes: 21 additions & 0 deletions static/game/hexgl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Thibaut Despoulain

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.
26 changes: 26 additions & 0 deletions static/game/hexgl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
HexGL
=========

Source code of [HexGL](http://hexgl.bkcore.com), the futuristic HTML5 racing game by [Thibaut Despoulain](http://bkcore.com)

## Branches
* **[Master](https://github.com/BKcore/HexGL)** - Public release (stable).

## License

Unless specified in the file, HexGL's code and resources are now licensed under the *MIT License*.

## Installation

cd ~/
git clone git://github.com/BKcore/HexGL.git
cd HexGL
python -m SimpleHTTPServer
chromium index.html

To use full size textures, swap the two textures/ and textures.full/ directories.

## Note

The development of HexGL is in a hiatus for now until I find some time and interest to work on it again.
That said, feel free to post issues, patches, or anything to make the game better and I'll gladly review and merge them.
74 changes: 74 additions & 0 deletions static/game/hexgl/cache.appcache
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
CACHE MANIFEST
# v1.0.1-ffos-201302192207
# HexGL by Thibaut Despoulain (BKcore.com)
index.html
css/BebasNeue-webfont.eot
css/BebasNeue-webfont.ttf
css/fonts.css
css/mobile-controls-2.jpg
css/mobile-over.jpg
css/BebasNeue-webfont.svg
css/BebasNeue-webfont.woff
css/mobile-controls-1.jpg
css/mobile.jpg
css/touchcontroller.css
libs/Three.dev.js
libs/ShaderExtras.js
libs/postprocessing/EffectComposer.js
libs/postprocessing/RenderPass.js
libs/postprocessing/BloomPass.js
libs/postprocessing/ShaderPass.js
libs/postprocessing/MaskPass.js
libs/Detector.js
libs/Stats.js
libs/DAT.GUI.min.js
bkcore.coffee/controllers/TouchController.js
bkcore.coffee/controllers/OrientationController.js
bkcore/Timer.js
bkcore/ImageData.js
bkcore/Utils.js
bkcore/threejs/RenderManager.js
bkcore/threejs/Shaders.js
bkcore/threejs/Particles.js
bkcore/threejs/Loader.js
bkcore/hexgl/HUD.js
bkcore/hexgl/RaceData.js
bkcore/hexgl/ShipControls.js
bkcore/hexgl/ShipEffects.js
bkcore/hexgl/CameraChase.js
bkcore/hexgl/Gameplay.js
bkcore/hexgl/tracks/Cityscape.js
bkcore/hexgl/HexGL.js
geometries/bonus/base/base.js
geometries/booster/booster.js
geometries/ships/feisar/feisar.js
geometries/tracks/cityscape/scrapers1.js
geometries/tracks/cityscape/scrapers2.js
geometries/tracks/cityscape/startbanner.js
geometries/tracks/cityscape/start.js
geometries/tracks/cityscape/track.js
geometries/tracks/cityscape/bonus/speed.js
textures/tracks/cityscape/collision.png
textures/tracks/cityscape/diffuse.jpg
textures/tracks/cityscape/height.png
textures/tracks/cityscape/start/diffuse.jpg
textures/tracks/cityscape/start/start.jpg
textures/tracks/cityscape/scrapers2/diffuse.jpg
textures/tracks/cityscape/scrapers1/diffuse.jpg
textures/skybox/dawnclouds/nx.jpg
textures/skybox/dawnclouds/ny.jpg
textures/skybox/dawnclouds/nz.jpg
textures/skybox/dawnclouds/px.jpg
textures/skybox/dawnclouds/pz.jpg
textures/skybox/dawnclouds/py.jpg
textures/ships/feisar/diffuse.jpg
textures/ships/feisar/booster/booster.png
textures/ships/feisar/booster/boostersprite.jpg
textures/bonus/base/diffuse.jpg
textures/particles/cloud.png
textures/particles/damage.png
textures/particles/spark.png
textures/hud/hud-bg.png
textures/hud/hex.jpg
textures/hud/hud-fg-speed.png
textures/hud/hud-fg-shield.png
Binary file added static/game/hexgl/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/game/hexgl/icon_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/game/hexgl/icon_256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/game/hexgl/icon_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/game/hexgl/icon_64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
129 changes: 129 additions & 0 deletions static/game/hexgl/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<!doctype html>
<html lang="en">
<head>
<title>HexGL by BKcore</title>
<meta charset="utf-8">
<meta name="description" content="HexGL is a futuristic racing game built by Thibaut Despoulain (BKcore) using HTML5, Javascript and WebGL. Come challenge your friends on this fast-paced 3D game!">
<meta property="og:title" content="HexGL, the HTML5 futuristic racing game." />
<meta property="og:type" content="game" />
<meta property="og:url" content="http://hexgl.bkcore.com/" />
<meta property="og:image" content="http://hexgl.bkcore.com/image.png" />
<meta property="og:site_name" content="HexGL by BKcore" />
<meta property="fb:admins" content="1482017639" />
<link rel="icon" href="http://hexgl.bkcore.com/favicon.png" type="image/png">
<link rel="shortcut icon" href="http://hexgl.bkcore.com/favicon.png" type="image/png">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/multi.css" type="text/css" charset="utf-8">
<link rel="stylesheet" href="css/fonts.css" type="text/css" charset="utf-8">
<style>
body {
padding:0;
margin:0;
}
canvas { pointer-events:none; width: 100%;}
#overlay{
position: absolute;
z-index: 9999;
top: 0;
left: 0;
width: 100%;
}
</style>
<script type="text/javascript">
//analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-26274524-4']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>

<body>
<div id="step-1">
<div id="global"></div>
<div id="title">
</div>
<div id="menucontainer">
<div id="menu">
<div id="start">Start</div>
<div id="s-controlType">Controls: Keyboard</div>
<div id="s-quality">Quality: High</div>
<div id="s-hud">HUD: On</div>
<div id="s-godmode" style="display: none">Godmode: Off</div>
<div id="s-credits">Credits</div>
</div>
</div>
</div>
<div id="step-2" style="display: none">
<div id="ctrl-help">Click/Touch to continue.</div>
</div>
<div id="step-3" style="display: none">
<div id="progressbar"></div>
</div>
<div id="step-4" style="display: none">
<div id="overlay"></div>
<div id="main"></div>
</div>
<div id="step-5" style="display: none">
<div id="time"></div>
<div id="ctrl-help">Click/Touch to continue.</div>
</div>
<div id="credits" style="display: none">
<h3>Code</h3>
<p><b>Concept and Development</b><br>Thibaut Despoulain (BKcore)</p>
<p><b>Contributors</b><br>townxelliot<br>mahesh.kk</p>
<p><b>Technologies</b><br>WebGL<br>JavaScript<br>CoffeeScript<br>Three.js<br>LeapMotion</p>
<h3>Graphics</h3>
<p><b>HexMKI base model</b><br>Charnel</p>
<p><b>Track texture</b><br>Nobiax</p>
<h4>Click anywhere to continue.</h4>
</div>

<div id="leapinfo" style="display: none"></div>

<script src="libs/leap-0.4.1.min.js"></script>
<script src="libs/Three.dev.js"></script>
<script src="libs/ShaderExtras.js"></script>
<script src="libs/postprocessing/EffectComposer.js"></script>
<script src="libs/postprocessing/RenderPass.js"></script>
<script src="libs/postprocessing/BloomPass.js"></script>
<script src="libs/postprocessing/ShaderPass.js"></script>
<script src="libs/postprocessing/MaskPass.js"></script>
<script src="libs/Detector.js"></script>
<script src="libs/Stats.js"></script>
<script src="libs/DAT.GUI.min.js"></script>

<script src="bkcore.coffee/controllers/TouchController.js"></script>
<script src="bkcore.coffee/controllers/OrientationController.js"></script>
<script src="bkcore.coffee/controllers/GamepadController.js"></script>

<script src="bkcore.coffee/Timer.js"></script>
<script src="bkcore.coffee/ImageData.js"></script>
<script src="bkcore.coffee/Utils.js"></script>

<script src="bkcore/threejs/RenderManager.js"></script>
<script src="bkcore/threejs/Shaders.js"></script>
<script src="bkcore/threejs/Particles.js"></script>
<script src="bkcore/threejs/Loader.js"></script>

<script src="bkcore/Audio.js"></script>

<script src="bkcore/hexgl/HUD.js"></script>
<script src="bkcore/hexgl/RaceData.js"></script>
<script src="bkcore/hexgl/ShipControls.js"></script>
<script src="bkcore/hexgl/ShipEffects.js"></script>
<script src="bkcore/hexgl/CameraChase.js"></script>
<script src="bkcore/hexgl/Gameplay.js"></script>

<script src="bkcore/hexgl/tracks/Cityscape.js"></script>

<script src="bkcore/hexgl/HexGL.js"></script>

<script src="launch.js"></script>

</body>
</html>
85 changes: 85 additions & 0 deletions static/game/hexgl/launch.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
$ = (_) -> document.getElementById _

init = (controlType, quality, hud, godmode) ->
hexGL = new bkcore.hexgl.HexGL(
document: document
width: window.innerWidth
height: window.innerHeight
container: $ 'main'
overlay: $ 'overlay'
gameover: $ 'step-5'
quality: quality
difficulty: 0
hud: hud is 1
controlType: controlType
godmode: godmode
track: 'Cityscape'
)
window.hexGL=hexGL

progressbar = $ 'progressbar'
hexGL.load(
onLoad: ->
console.log 'LOADED.'
hexGL.init()
$('step-3').style.display = 'none'
$('step-4').style.display = 'block'
hexGL.start()
onError: (s) ->
console.error "Error loading #{ s }."
onProgress: (p, t, n) ->
console.log("LOADED "+t+" : "+n+" ( "+p.loaded+" / "+p.total+" ).")
progressbar.style.width = "#{ p.loaded / p.total * 100 }%"
)

u = bkcore.Utils.getURLParameter

defaultControls = if bkcore.Utils.isTouchDevice() then 1 else 0

s = [
['controlType', ['KEYBOARD', 'TOUCH', 'LEAP MOTION CONTROLLER',
'GAMEPAD'], defaultControls, defaultControls, 'Controls: ']
['quality', ['LOW', 'MID', 'HIGH', 'VERY HIGH'], 3, 3, 'Quality: ']
['hud', ['OFF', 'ON'], 1, 1, 'HUD: ']
['godmode', ['OFF', 'ON'], 0, 1, 'Godmode: ']
]

for a in s
do(a)->
a[3] = u(a[0]) ? a[2]
e = $ "s-#{a[0]}"
(f = -> e.innerHTML = a[4]+a[1][a[3]])()
e.onclick = -> f(a[3] = (a[3]+1)%a[1].length)
$('step-2').onclick = ->
$('step-2').style.display = 'none'
$('step-3').style.display = 'block'
init s[0][3], s[1][3], s[2][3], s[3][3]
$('step-5').onclick = ->
window.location.reload()
$('s-credits').onclick = ->
$('step-1').style.display = 'none'
$('credits').style.display = 'block'
$('credits').onclick = ->
$('step-1').style.display = 'block'
$('credits').style.display = 'none'

hasWebGL = ->
gl = null
canvas = document.createElement('canvas');
try
gl = canvas.getContext("webgl")
if not gl?
try
gl = canvas.getContext("experimental-webgl")
return gl?

if not hasWebGL()
getWebGL = $('start')
getWebGL.innerHTML = 'WebGL is not supported!'
getWebGL.onclick = ->
window.location.href = 'http://get.webgl.org/'
else
$('start').onclick = ->
$('step-1').style.display = 'none'
$('step-2').style.display = 'block'
$('step-2').style.backgroundImage = "url(css/help-#{s[0][3]}.png)"
Loading