Permalink
Browse files

Level switch created

  • Loading branch information...
1 parent 8c1dc27 commit 59e92ba39840b28cdb466931bf0154ecdf04688f @hugeen committed Nov 22, 2012
Showing with 22 additions and 6 deletions.
  1. +11 −0 assets/css/defend_the_den.css
  2. +1 −1 game/components/waves_manager.js
  3. +2 −2 game/levels.js
  4. +6 −2 game/scenes/level.js
  5. +1 −1 game/skills.js
  6. +1 −0 templates/levels/level.html
@@ -273,4 +273,15 @@ body {
.skill_on_cooldown .skill_key {
background-color: red;
+}
+
+.display_warning {
+ position: absolute;
+ width: 100%;
+ font-size: 40px;
+ text-align: center;
+ height: 40px;
+ margin-top: -20px;
+ top: 50%;
+ color: white;
}
@@ -13,7 +13,7 @@ define([
if(this.currentWave < this.wavesCount) {
this.next();
} else {
- alert("stage clear");
+ window.location.replace("#/levels/2")
}
}
View
@@ -2,7 +2,7 @@ define(function() {
return [{
id: 1,
- speed: 0.5,
+ speed: 0.75,
waves: [{
"1": "*****",
"2": "*****",
@@ -20,7 +20,7 @@ define(function() {
}]
}, {
id: 2,
- speed: 0.6,
+ speed: 0.8,
waves: [{
"1": "*****",
"2": "*****",
@@ -9,9 +9,10 @@ define([
'collections/skills',
'text!templates/game_ui/skills.html',
'text!templates/game_ui/skill.html',
+ 'text!templates/levels/level.html',
'game/mouse',
'mouseTrap'
-], function(_, $, Crafty, Burst, PlayerEntity, MonsterEntity, keyboard, skills, _skills, _skill, mouse, Mousetrap) {
+], function(_, $, Crafty, Burst, PlayerEntity, MonsterEntity, keyboard, skills, _skills, _skill, _level, mouse, Mousetrap) {
return {
name: "level",
@@ -20,7 +21,10 @@ define([
Crafty.e("WavesManager").start(options.level.get("waves"), options.level.get("speed"));
$("#wrapper").append(_.template(_skills));
-
+ $("#wrapper").append(_.template(_level, { level: options.level }));
+ setTimeout(function() {
+ $(".display_warning").remove();
+ }, 2000);
var player = PlayerEntity.create();
skills.each(function(skill) {
View
@@ -18,7 +18,7 @@ define([
cooldown: 0.7,
action: function() {
var player = PlayerEntity.get();
- var damages = { min: 400, max: 600 };
+ var damages = { min: 40, max: 60 };
Crafty.e("Attack").cast({
x: player.x+40,
y: player.y+25
@@ -0,0 +1 @@
+<div class="dialog_font display_warning">Level <%= level.get("id") %></div>

0 comments on commit 59e92ba

Please sign in to comment.