Skip to content
Browse files

[~] Typo fixes.

  • Loading branch information...
1 parent b95a227 commit 2c5bbed0f941392291961cf3f5801886bc24adbf @Andrew8xx8 committed
Showing with 15 additions and 16 deletions.
  1. +11 −11 js/bullets.js
  2. +2 −3 js/enemy.js
  3. +2 −2 js/player.js
View
22 js/bullets.js
@@ -15,31 +15,31 @@ TextGalactic.Bullets = atom.Class({
}
},
- create: function (fromPoint, bullitType, direction) {
- var bullit = this.storage.push(new TextGalactic.Bullet(this.scene, {
+ create: function (fromPoint, bulletType, direction) {
+ var bullet = this.storage.push(new TextGalactic.Bullet(this.scene, {
shape: new Circle(fromPoint, TextGalactic.Settings.font_size),
- type: bullitType,
+ type: bulletType,
direction: direction,
- bullits: this
+ bullets: this
}));
- return bullit;
+ return bullet;
},
- checkPlayerCollision: function (bullit) {
+ checkPlayerCollision: function (bullet) {
var player = this.controller.getPlayer();
- if (player.getCollisionRectangle(bullit.shape.radius).hasPoint(bullit.shape)) {
+ if (player.getCollisionRectangle(bullet.shape.radius).hasPoint(bullet.shape)) {
player.hit();
- bullit.destroy();
+ bullet.destroy();
}
},
- checkEnemyCollision: function (bullit) {
- var enemy = this.controller.getEnemies().find([bullit.shape._center.x, bullit.shape._center.y]);
+ checkEnemyCollision: function (bullet) {
+ var enemy = this.controller.getEnemies().find([bullet.shape._center.x, bullet.shape._center.y]);
if (enemy !== null) {
- bullit.explode();
+ bullet.explode();
}
},
});
View
5 js/enemy.js
@@ -1,4 +1,4 @@
-TextGalactic.Enemies = {
+TextGalactic.EnemiesTypes = {
0: {
text: "W",
health: 100,
@@ -76,8 +76,7 @@ TextGalactic.Enemy = atom.Class(
/** @constructs */
initialize: function (scene, options) {
this.parent( scene, options );
- this.addEvent( 'moveDrag', this.redraw );
- this.enemy = TextGalactic.Enemies[options.enemyType];
+ this.enemy = TextGalactic.EnemiesTypes[options.enemyType];
this.speed = this.enemy.speed;
this.health = this.enemy.health;
this.dx = (getRandomInt(0, 1) == 0) ? 1: -1;
View
4 js/player.js
@@ -34,7 +34,7 @@ TextGalactic.Player = atom.Class(
speed: TextGalactic.Settings.speed - 50 ,
- bulletType: TextGalactic.BullitTypes['simple'],
+ bulletType: TextGalactic.BulletTypes['simple'],
hit: function () {
this.health = this.health - 25;
@@ -93,7 +93,7 @@ TextGalactic.Player = atom.Class(
move(this, dx, dy);
if (this.rate > this.bulletType.rate) {
- this.options.controller.getBullits().create(
+ this.options.controller.getBullets().create(
new Point(this.shape.from.x, this.shape.from.y),
this.bulletType,
'up'

0 comments on commit 2c5bbed

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