Skip to content

Commit

Permalink
Resolved conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Christos Constantinou committed Apr 29, 2012
2 parents d531d3c + 5b88dc1 commit 11e1156
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 31 deletions.
17 changes: 9 additions & 8 deletions scripts/watair/watair.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ Sprite.create = function spriteCreateFn(x, y, imageName, app, updateFunction)
c.app = app;
c.img = new Image();
c.imageName = imageName ? imageName: 'textures/cratebubble_up_1.png';

c.console = app.console;

c.update = updateFunction;

Expand Down Expand Up @@ -115,14 +117,12 @@ Watair.prototype =

init: function initFn()
{
var console = window.console;
if (console)
{
console.log('Init');
}
this.console.log('Init');

var that = this;

function buildPlayer(x, y, filename, allSprites) {
var sprite = Sprite.create(x, y, filename, this.app, function()
var sprite = Sprite.create(x, y, filename, that.app, function()
{
if (this.mvX && Math.abs(this.x - this.destX) > 9)
{
Expand Down Expand Up @@ -159,7 +159,6 @@ Watair.prototype =
} else {
sprite.setDirection('right');
}
console.log("delta:" + this.dx + ", " + this.dy);
this.mvX = this.mvY = true;
};

Expand Down Expand Up @@ -275,7 +274,7 @@ Watair.prototype =
{
// Termination
// Fish loses
console.log('Dead Fish');
this.console.log('Dead Fish');
}
}

Expand All @@ -288,6 +287,8 @@ Watair.create = function watairCreateFn(gameSettings, app)

watair.app = app;
watair.sprites = [];

watair.console = app.console;

return watair;
};
Expand Down
51 changes: 30 additions & 21 deletions scripts/worm/wormapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Application.prototype =
{func : this.createHTMLWriter, isDependent : true, noCallback : true},
{func : this.enterLoadingLoop, isDependent : true}
];

this.enterCallbackChain(this, creationFunctions);

var endpoint = 'http://10.10.2.44:8083';
Expand All @@ -94,11 +95,11 @@ Application.prototype =

// Socket events
socket.on('connect', function(){
console.log("Connected to server!");
app.console.log("Connected to server!");
});

socket.on('disconnect', function(s){
console.log("Disconnected from server!");
app.console.log("Disconnected from server!");
});

socket.on('msg', function(data) {
Expand Down Expand Up @@ -152,6 +153,7 @@ Application.prototype =

loadImages : function loadImagesFn(mappingTable)
{
var app = this;
this.images = [];

var backgroundImageName = 'textures/bg.jpg';
Expand All @@ -164,11 +166,7 @@ Application.prototype =
}
else
{
var console = window.console;
if (console)
{
console.error('Image missing: ', backgroundImageName);
}
app.console.error('Image missing: ', backgroundImageName);

}

Expand All @@ -186,11 +184,8 @@ Application.prototype =
images[imageName] = image;
return image;
} else {
var console = window.console;
if (console)
{
console.error('Image for sprite ' + sprite + ' missing: ', sprite.imageName);
}
app.console.error('Image for sprite ' + sprite + ' missing: ', sprite.imageName);
return null;
}
}

Expand Down Expand Up @@ -221,7 +216,7 @@ Application.prototype =
return animFilenames;
}

function loadAnimFrames(sprite, images, animFilenames, animFrames) {
function loadAnimFrames(sprite, images, animFilenames, aFrames) {
var animFrames = [];
for (var i = 0; i < animFilenames.length; i++)
{
Expand Down Expand Up @@ -645,7 +640,7 @@ Application.prototype =
app.soundTitleMusic = sound;
backgroundSoundSource.play(app.soundTitleMusic);
} else {
console.log('Failed to load sounds');
app.console.log('Failed to load sounds');
}
}
});
Expand All @@ -659,7 +654,7 @@ Application.prototype =
// backgroundSoundSource.play(sound);
app.soundMainMusic = sound;
} else {
console.log('Failed to load sounds');
app.console.log('Failed to load sounds');
}
}
});
Expand All @@ -672,7 +667,7 @@ Application.prototype =
{
app.soundBubbleDown = sound;
} else {
console.log('Failed to load sounds');
app.console.log('Failed to load sounds');
}
}
});
Expand All @@ -685,7 +680,7 @@ Application.prototype =
{
app.soundBubbleUp = sound;
} else {
console.log('Failed to load sounds');
app.console.log('Failed to load sounds');
}
}
});
Expand All @@ -698,7 +693,7 @@ Application.prototype =
{
app.soundLooser = sound;
} else {
console.log('Failed to load sounds');
app.console.log('Failed to load sounds');
}
}
});
Expand All @@ -711,7 +706,7 @@ Application.prototype =
{
app.soundWinner = sound;
} else {
console.log('Failed to load sounds');
app.console.log('Failed to load sounds');
}
}
});
Expand All @@ -724,7 +719,7 @@ Application.prototype =
{
app.soundScoreScreen = sound;
} else {
console.log('Failed to load sounds');
app.console.log('Failed to load sounds');
}
}
});
Expand Down Expand Up @@ -790,7 +785,7 @@ Application.prototype =

function onMouseDown(keynum)
{
console.log("onMouseDown");
app.console.log("onMouseDown");
//game.onMouseDown(keynum);
}

Expand Down Expand Up @@ -1344,6 +1339,20 @@ Application.prototype =
Application.create = function applicationCreateFn(runInEngine)
{
var application = new Application();

var console = window.console;
if (console)
{
application.console = console;
}
else
{
application.console = {
log: function () {},
warn: function () {},
error: function () {}
};
}

// Ensures shutdown function is only called once
application.hasShutDown = false;
Expand Down
4 changes: 2 additions & 2 deletions templates/watair.canvas.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*{% extends "base/base_template.html" %}*/

/*{% block tz_app_title %}*/App Name - Turbulenz Engine/*{% endblock %}*/
/*{% block tz_app_title_name %}*/App Name/*{% endblock %}*/
/*{% block tz_app_title %}*/Watair - Turbulenz Engine/*{% endblock %}*/
/*{% block tz_app_title_name %}*/Watair/*{% endblock %}*/

/*{% block tz_app_html_controls %}*/
<div class="html-control control-output-pair">
Expand Down

0 comments on commit 11e1156

Please sign in to comment.