Skip to content

Commit

Permalink
Added items to buildings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rosshadden committed Dec 21, 2012
1 parent df89b05 commit 9489b4e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 10 deletions.
3 changes: 2 additions & 1 deletion public/js/entities/buildings/Building.js
Expand Up @@ -36,7 +36,8 @@ define(['entities/Entity'], function(Entity){

render: function(){
return {
name: this.name
name: this.name,
items: this.items
};
}
});
Expand Down
13 changes: 12 additions & 1 deletion public/js/entities/buildings/barracks.js
Expand Up @@ -17,7 +17,18 @@ define(['./Building'], function(Building){
Barracks.super.constructor.call(this, [50, 100, 25], position, materials);
},

name: 'Barracks'
name: 'Barracks',

items: [{
name: 'infantry',
type: 'unit'
}, {
name: 'rpg',
type: 'unit'
}, {
name: 'engineer',
type: 'unit'
}]
});

return Barracks;
Expand Down
10 changes: 9 additions & 1 deletion public/js/entities/buildings/command-center.js
Expand Up @@ -17,7 +17,15 @@ define(['./Building'], function(Building){
CommandCenter.super.constructor.call(this, [100, 100, 50], position, materials);
},

name: 'Command Center'
name: 'Command Center',

items: [{
name: 'power-plant',
type: 'structure'
}, {
name: 'mcv',
type: 'unit'
}]
});

return CommandCenter;
Expand Down
11 changes: 5 additions & 6 deletions public/js/gui/main.html
@@ -1,9 +1,8 @@
<h1>{{name}}</h1>
<ul>
<li class="structure">
<p>Barracks</p>
</li>
<li class="unit">
<p>Tank</p>
</li>
{{#each items}}
<li class="{{type}}">
<p>{{name}}</p>
</li>
{{/each}}
</ul>
2 changes: 1 addition & 1 deletion routes/index.js
@@ -1,5 +1,5 @@
exports.index = function(req, res) {
res.render('index', {
title: 'WebGL Playground'
title: 'WebGL RTS'
});
};

0 comments on commit 9489b4e

Please sign in to comment.