Added coin creator
This commit is contained in:
26
controllers/prototype/index.js
vendored
26
controllers/prototype/index.js
vendored
@@ -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);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
3
controllers/prototype/urls.js
vendored
3
controllers/prototype/urls.js
vendored
@@ -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'
|
||||
};
|
||||
|
||||
@@ -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")
|
||||
|
||||
15
controllers/prototype/views/prototype_clicker.jade
Normal file
15
controllers/prototype/views/prototype_clicker.jade
Normal 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
|
||||
|
||||
Reference in New Issue
Block a user