Added coin creator

This commit is contained in:
Thomas FORGIONE
2015-07-17 11:32:57 +02:00
parent 267cfddd27
commit b397a18bea
11 changed files with 338 additions and 17 deletions

View File

@@ -145,3 +145,29 @@ module.exports.tutorial = function(req, res) {
res.send(result);
});
};
module.exports.clicker = function(req, res, next) {
var scene = req.params.scene;
switch (scene) {
case 'peach': res.locals.scene = "L3D.initPeach"; break;
case 'coolcoolmountain': res.locals.scene = "L3D.initMountain"; break;
case 'whomp': res.locals.scene = "L3D.initWhomp"; break;
case 'bobomb': res.locals.scene = "L3D.initBobomb"; break;
default:
// 404
var err = new Error('Incorrect scene');
err.status = 404;
next(err);
break;
}
res.setHeader('Content-Type', 'text/html');
res.render('prototype_clicker.jade', res.locals, function(err, result) {
res.send(result);
});
}

View File

@@ -7,5 +7,6 @@ module.exports = {
'/prototype/replay/:id': 'replay',
'/prototype/replay_info/:id': 'replay_info',
'/prototype/tutorial': 'tutorial',
'/prototype/sponza': 'sponza'
'/prototype/sponza': 'sponza',
'/prototype/coin-creator/:scene': 'clicker'
};

View File

@@ -26,6 +26,7 @@ block content
nav.navbar.navbar-default.navbar-fixed-bottom
.container
button#reset.btn.btn-primary.navbar-btn(style={'margin-right': '10px', 'margin-bottom':'10px'}) Reset camera
block extrabutton
button#undo.btn.btn-default.navbar-btn(style={'margin-right': '10px', 'margin-bottom': '10px'})
span.glyphicon.glyphicon-triangle-left('aria-hidden'="true")

View File

@@ -0,0 +1,15 @@
extends ./prototype
block title
title #{title} - Prototype
block mainjs
script initMainScene = #{scene};
script Recommendation = L3D.ArrowRecommendation;
script(src="/static/js/filesaver.min.js")
script(src="/static/js/coincreator.min.js")
block extrabutton
button#save.btn.btn-primary.navbar-btn(style={'margin-right': '10px', 'margin-bottom':'10px'}, onclick="saveCoins();") Save coins