Skip to content
Browse files

added error flash msg and pharmacy hint

  • Loading branch information...
1 parent 051197a commit 376257016e2e0a6b0a2e4c84071d4dd5e738210c Jen Fong-Adwent committed Aug 12, 2012
View
3 package.json
@@ -14,7 +14,8 @@
"hiredis": "0.1.14",
"redis": "0.7.2",
"nconf": "0.6.4",
- "express-uglify": "0.3.0"
+ "express-uglify": "0.3.0",
+ "express-messages": ">= 0.0.2"
},
"devDependencies": {
"mocha": "1.2.2",
View
4 public/javascripts/lib/game.js
@@ -5,6 +5,7 @@ define(['jquery'], function ($) {
var stats = $('ol.stats');
var statsDashboard = $('ol.dashboard-stats');
var player = $('img.player');
+ var tools = $('ol.tools');
var fightAction = $('img.action');
var message = $('.battle-message');
var fightAgain = $('.fight-again');
@@ -71,6 +72,7 @@ define(['jquery'], function ($) {
playerHP = 0;
message.text('You lost :(');
}
+ tools.fadeOut();
}
updateStats({
@@ -102,7 +104,6 @@ define(['jquery'], function ($) {
};
fightAction.fadeIn();
-
battleTrigger(params);
}
},
@@ -128,6 +129,7 @@ define(['jquery'], function ($) {
if (!toolType.data('health')) {
self.removeClass('enabled').addClass('disabled');
}
+
activeStoreItems.each(function(idx, item) {
var item = $(this);
if (item.data('cost') > data.result.gold) {
View
BIN public/misc/pharmacy-preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
18 public/stylesheets/main.css
@@ -121,6 +121,18 @@ a {
overflow: hidden;
}
+#messages {
+ background-color: #f00;
+ position: absolute;
+ bottom: 20px;
+ color: #fff;
+ font-size: 17px;
+ line-height: 22px;
+ padding: 10px;
+ width: 200px;
+ left: 300px;
+}
+
h1 {
font-family: 'CabinSketchRegular';
font-size: 100px;
@@ -878,3 +890,9 @@ a.fight-again:hover {
height: 107px;
width: 200px;
}
+
+#hp .info-tip {
+ top: 82px;
+ height: 228px;
+ padding: 15px 50px 30px 55px;
+}
View
1 routes/auth.js
@@ -15,6 +15,7 @@ module.exports = function(app, db, nconf, isLoggedIn) {
res.redirect('/dashboard');
});
} else {
+ req.flash('error', 'An error occurred while attempting to log in.');
res.redirect('/');
}
});
View
3 settings.js
@@ -57,7 +57,8 @@ module.exports = function(app, configurations, express) {
app.dynamicHelpers({
session: function (req, res) {
return req.session;
- }
+ },
+ messages: require('express-messages')
});
return app;
View
5 views/game_dashboard.jade
@@ -16,10 +16,13 @@ block content
a(href='/universe', class='button') Explore!
if session.last_level_played
a(href='/detail/#{session.last_level_played}', class='button') Last Location
+ a(href='/store', class='button') Store
li#hp
h3 HP
span= session.hp
- a(href='/store', class='button') Store
+ if parseInt(session.hp) < 100
+ .info-tip Need more health? Look for this
+ img(src='/misc/pharmacy-preview.png')
li#xp
h3 XP
span= session.xp
View
2 views/index.jade
@@ -4,3 +4,5 @@ block content
p.intro Welcome to a world of chaos, space and wormholes.
h1 NoodleRPG
+
+ != messages()

0 comments on commit 3762570

Please sign in to comment.
Something went wrong with that request. Please try again.