Navigation Menu

Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Removed jQuery dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
scambier committed Nov 2, 2014
1 parent ecad048 commit e90e3b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 0 additions & 1 deletion index.html
Expand Up @@ -22,7 +22,6 @@
}
</style>

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="lib/impact/impact.js"></script>
<script type="text/javascript" src="lib/game/main.js"></script>
</head>
Expand Down
13 changes: 12 additions & 1 deletion lib/plugins/component.js
Expand Up @@ -31,6 +31,17 @@ ig.module('plugins.component')
* Will be called at each Entity's draw call
*/
draw: function () {
},

_extend: function(obj) {
for (var key in obj) {
if (key in this) {
this[key] = obj[key];
}
else {
console.error('You cannot dynamically add properties to components, only modify them. Check your addComponent() method.')
}
}
}
});

Expand All @@ -48,7 +59,7 @@ ig.module('plugins.component')
* @returns {Component}
*/
addComponent: function (comp, settings) {
$.extend(comp, settings);
comp._extend(settings);
comp.delegate = this;
this.components.push(comp);
comp.added();
Expand Down

0 comments on commit e90e3b4

Please sign in to comment.