Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Andrew8xx8/text_galactic
base: 42b93b0c4b
...
head fork: Andrew8xx8/text_galactic
compare: b95a227be1
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 6 files changed
  • 0 commit comments
  • 2 contributors
Commits on Mar 23, 2012
Konstantin Molchanov Numerous naming errors fixed
826c5fb
Konstantin Molchanov Shit removed
2bea1ce
@Andrew8xx8 Merge pull request #1 from moigagoo/master
[~] Naming improvements.
b95a227
View
4 index.html
@@ -11,8 +11,8 @@
<script src="./js/init.js"></script>
<script src="./js/collection.js"></script>
<script src="./js/controller.js"></script>
- <script src="./js/bullit.js"></script>
- <script src="./js/bullits.js"></script>
+ <script src="./js/bullet.js"></script>
+ <script src="./js/bullets.js"></script>
<script src="./js/player.js"></script>
<script src="./js/enemy.js"></script>
<script src="./js/enemies.js"></script>
View
16 js/bullit.js → js/bullet.js
@@ -1,4 +1,4 @@
-TextGalactic.BullitTypes = {
+TextGalactic.BulletTypes = {
simple: {
text: ".",
rate: 10,
@@ -25,9 +25,9 @@ TextGalactic.BullitTypes = {
}
};
-TextGalactic.Bullit = atom.Class(
+TextGalactic.Bullet = atom.Class(
/**
- * @lends TextGalactic.Bullit#
+ * @lends TextGalactic.Bullet#
* @augments LibCanvas.Scene.Element#
*/
{
@@ -35,7 +35,7 @@ TextGalactic.Bullit = atom.Class(
direction: 'up',
- type: TextGalactic.BullitTypes['simple'],
+ type: TextGalactic.BulletTypes['simple'],
/** @constructs */
initialize: function (scene, options) {
@@ -54,12 +54,12 @@ TextGalactic.Bullit = atom.Class(
if (this.direction == 'up') {
move(this, 0, -moveSpeed);
- this.options.bullits.checkEnemyCollision(this);
+ this.options.bullets.checkEnemyCollision(this);
} else {
move(this, 0, moveSpeed);
- this.options.bullits.checkPlayerCollision(this);
+ this.options.bullets.checkPlayerCollision(this);
}
- // Deestroy bullit if it's the canvas
+ // Deestroy bullet if it's the canvas
if (
this.shape._center.y > this.scene.resources.rectangle.to.y
|| this.shape._center.y < this.scene.resources.rectangle.from.y
@@ -70,7 +70,7 @@ TextGalactic.Bullit = atom.Class(
explode: function (){
this.destroy;
- this.options.bullits._destroy(this);
+ this.options.bullets._destroy(this);
},
renderTo: function (ctx) {
View
4 js/bullits.js → js/bullets.js
@@ -1,4 +1,4 @@
-TextGalactic.Bullits = atom.Class({
+TextGalactic.Bullets = atom.Class({
Extends: TextGalactic.Collection,
@@ -16,7 +16,7 @@ TextGalactic.Bullits = atom.Class({
},
create: function (fromPoint, bullitType, direction) {
- var bullit = this.storage.push(new TextGalactic.Bullit(this.scene, {
+ var bullit = this.storage.push(new TextGalactic.Bullet(this.scene, {
shape: new Circle(fromPoint, TextGalactic.Settings.font_size),
type: bullitType,
direction: direction,
View
6 js/controller.js
@@ -19,13 +19,13 @@ TextGalactic.Controller = atom.Class(
this.enemies = new TextGalactic.Enemies(this.activeScene, this);
- this.bullits = new TextGalactic.Bullits(this.activeScene, this);
+ this.bullets = new TextGalactic.Bullets(this.activeScene, this);
this.createEnemies()
},
- getBullits: function() {
- return this.bullits;
+ getBullets: function() {
+ return this.bullets;
},
getPlayer: function() {
View
50 js/enemy.js
@@ -1,52 +1,52 @@
-TextGalactic.Enemis = {
+TextGalactic.Enemies = {
0: {
text: "W",
- healf: 100,
+ health: 100,
speed: 150,
},
1: {
text: "T",
- healf: 150,
+ health: 150,
speed: 140,
},
2: {
text: "Y",
- healf: 200,
+ health: 200,
speed: 130,
- bullitType: TextGalactic.BullitTypes['big'],
+ bulletType: TextGalactic.BulletTypes['big'],
},
3: {
text: "U",
- healf: 250,
+ health: 250,
speed: 120,
},
4: {
text: "I",
- healf: 300,
+ health: 300,
speed: 110,
- bullitType: TextGalactic.BullitTypes['lazer'],
+ bulletType: TextGalactic.BulletTypes['lazer'],
},
5: {
text: "H",
- healf: 350,
+ health: 350,
speed: 100,
},
6: {
text: "X",
- healf: 360,
+ health: 360,
speed: 90,
- bullitType: TextGalactic.BullitTypes['simple'],
+ bulletType: TextGalactic.BulletTypes['simple'],
},
7: {
text: "V",
- healf: 370,
+ health: 370,
speed: 70,
},
8: {
text: "M",
- healf: 380,
+ health: 380,
speed: 50,
- bullitType: TextGalactic.BullitTypes['simple'],
+ bulletType: TextGalactic.BulletTypes['simple'],
}
}
@@ -77,9 +77,9 @@ TextGalactic.Enemy = atom.Class(
initialize: function (scene, options) {
this.parent( scene, options );
this.addEvent( 'moveDrag', this.redraw );
- this.enemy = TextGalactic.Enemis[options.enemyType];
+ this.enemy = TextGalactic.Enemies[options.enemyType];
this.speed = this.enemy.speed;
- this.healf = this.enemy.healf;
+ this.health = this.enemy.health;
this.dx = (getRandomInt(0, 1) == 0) ? 1: -1;
this.dy = getRandomArbitary(0.8, 1.2);
},
@@ -89,7 +89,7 @@ TextGalactic.Enemy = atom.Class(
},
rate: 0,
- healf: 0,
+ health: 0,
dx: 1,
dy: -1,
@@ -99,10 +99,10 @@ TextGalactic.Enemy = atom.Class(
speed: TextGalactic.Settings.speed - 50 ,
hit: function() {
- this.healf = this.healf - 100;
+ this.health = this.health - 100;
this.redraw();
- if (this.healf < 0) {
+ if (this.health < 0) {
return null;
}
@@ -131,11 +131,11 @@ TextGalactic.Enemy = atom.Class(
this.normalize_d();
// make shoot
- if (this.enemy.bullitType !== undefined) {
- if (this.rate > this.enemy.bullitType.rate * 4) {
- this.options.controller.getBullits().create(
+ if (this.enemy.bulletType !== undefined) {
+ if (this.rate > this.enemy.bulletType.rate * 4) {
+ this.options.controller.getBullets().create(
new Point(this.shape.from.x, this.shape.to.y),
- this.enemy.bullitType,
+ this.enemy.bulletType,
'down'
);
@@ -148,8 +148,8 @@ TextGalactic.Enemy = atom.Class(
renderTo: function (ctx) {
//ctx.fill( this.shape, ctx.createRectangleGradient( this.shape, this.colors[this.lives] ));
- var healfq = Math.round(this.healf/this.enemy.healf * 255);
- ctx.fillStyle = "rgb(" + (healfq) + ", " + (healfq) + "," + (healfq) + ")";
+ var healthq = Math.round(this.health/this.enemy.health * 255);
+ ctx.fillStyle = "rgb(" + (healthq) + ", " + (healthq) + "," + (healthq) + ")";
ctx.font = "normal normal " + TextGalactic.Settings.font_size + "px courier";
ctx.fillText(this.enemy.text, this.shape.from.x, this.shape.to.y);
View
16 js/player.js
@@ -28,19 +28,19 @@ TextGalactic.Player = atom.Class(
return this.collisionRectangle;
},
- healf: 300,
+ health: 300,
rate: 0,
speed: TextGalactic.Settings.speed - 50 ,
- bullitType: TextGalactic.BullitTypes['simple'],
+ bulletType: TextGalactic.BullitTypes['simple'],
hit: function () {
- this.healf = this.healf - 25;
+ this.health = this.health - 25;
this.redraw();
- if (this.healf < 0) {
+ if (this.health < 0) {
this.destroy();
}
@@ -92,10 +92,10 @@ TextGalactic.Player = atom.Class(
move(this, dx, dy);
- if (this.rate > this.bullitType.rate) {
+ if (this.rate > this.bulletType.rate) {
this.options.controller.getBullits().create(
new Point(this.shape.from.x, this.shape.from.y),
- this.bullitType,
+ this.bulletType,
'up'
);
@@ -106,8 +106,8 @@ TextGalactic.Player = atom.Class(
},
renderTo: function (ctx) {
- var healfq = Math.round(this.healf/300 * 255);
- ctx.fillStyle = "rgb(255, " + (healfq) + "," + (healfq) + ")";
+ var healthq = Math.round(this.health/300 * 255);
+ ctx.fillStyle = "rgb(255, " + (healthq) + "," + (healthq) + ")";
ctx.font = "normal normal " + TextGalactic.Settings.font_size + "px courier";
ctx.fillText("A", this.shape.from.x, this.shape.to.y);

No commit comments for this range

Something went wrong with that request. Please try again.