Skip to content

Commit

Permalink
小BUG修复
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxsoft committed Mar 21, 2015
1 parent f97b0c8 commit 0b19508
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/danmu/danmu/sprite.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
move: function() {
this.x += this.speed.x;
this.y += this.speed.y;
if (this.children !== null) {
if (!typeof this.children == "undefined") {
for (var i = 0; i < this.children.length; i++) {
this.children[i].speed = this.speed;
this.children[i].move();
Expand All @@ -53,7 +53,7 @@ module.exports = {
* 向此精灵添加一个子精灵
*/
appendChild: function(sprite) {
if (this.children === null) {
if (typeof this.children == "undefined") {
this.children = [];
}
this.children.push(sprite);
Expand All @@ -63,7 +63,7 @@ module.exports = {
* 渲染子精灵
*/
drawChildren: function() {
if (this.children !== null) {
if (!typeof this.children == "undefined") {
for (var i = 0; i < this.children.length; i++) {
this.children[i].draw();
}
Expand Down

0 comments on commit 0b19508

Please sign in to comment.