Merge branch 'photonstorm/097'

This commit is contained in:
Sean
2013-07-18 19:25:32 +08:00
258 changed files with 23277 additions and 661 deletions
+8
View File
@@ -56,6 +56,14 @@
<TypeScriptCompile Include="cameras\basic camera 1.ts" />
<TypeScriptCompile Include="buttons\basic button.ts" />
<TypeScriptCompile Include="buttons\basic button 2.ts" />
<TypeScriptCompile Include="audio\play sound 1.ts" />
<TypeScriptCompile Include="audio\audio sprites 1.ts" />
<Content Include="audio\audio sprites 1.js">
<DependentUpon>audio sprites 1.ts</DependentUpon>
</Content>
<Content Include="audio\play sound 1.js">
<DependentUpon>play sound 1.ts</DependentUpon>
</Content>
<Content Include="buttons\basic button 2.js">
<DependentUpon>basic button 2.ts</DependentUpon>
</Content>
Binary file not shown.
@@ -0,0 +1,84 @@
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/">
<xmpDM:Tracks>
<rdf:Bag>
<rdf:li rdf:parseType="Resource">
<xmpDM:trackName>CuePoint Markers</xmpDM:trackName>
<xmpDM:trackType>Cue</xmpDM:trackType>
<xmpDM:frameRate>f44100</xmpDM:frameRate>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<xmpDM:trackName>Subclip Markers</xmpDM:trackName>
<xmpDM:trackType>InOut</xmpDM:trackType>
<xmpDM:frameRate>f44100</xmpDM:frameRate>
</rdf:li>
</rdf:Bag>
</xmpDM:Tracks>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:MetadataDate>2013-07-16T02:39:59+01:00</xmp:MetadataDate>
<xmp:ModifyDate>2013-07-16T02:39:59+01:00</xmp:ModifyDate>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#">
<xmpMM:InstanceID>xmp.iid:CF0377343CEDE211B46AA47009D9EF1D</xmpMM:InstanceID>
<xmpMM:DocumentID>xmp.did:CF0377343CEDE211B46AA47009D9EF1D</xmpMM:DocumentID>
<xmpMM:OriginalDocumentID>xmp.did:CE0377343CEDE211B46AA47009D9EF1D</xmpMM:OriginalDocumentID>
<xmpMM:History>
<rdf:Seq>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:CE0377343CEDE211B46AA47009D9EF1D</stEvt:instanceID>
<stEvt:when>2013-07-16T02:39:59+01:00</stEvt:when>
<stEvt:softwareAgent>Adobe Audition CS6 (Windows)</stEvt:softwareAgent>
<stEvt:changed>/metadata</stEvt:changed>
</rdf:li>
<rdf:li rdf:parseType="Resource">
<stEvt:action>saved</stEvt:action>
<stEvt:instanceID>xmp.iid:CF0377343CEDE211B46AA47009D9EF1D</stEvt:instanceID>
<stEvt:when>2013-07-16T02:39:59+01:00</stEvt:when>
<stEvt:softwareAgent>Adobe Audition CS6 (Windows)</stEvt:softwareAgent>
<stEvt:changed>/</stEvt:changed>
</rdf:li>
</rdf:Seq>
</xmpMM:History>
<xmpMM:DerivedFrom rdf:parseType="Resource">
<stRef:instanceID>xmp.iid:CE0377343CEDE211B46AA47009D9EF1D</stRef:instanceID>
<stRef:documentID>xmp.did:CE0377343CEDE211B46AA47009D9EF1D</stRef:documentID>
<stRef:originalDocumentID>xmp.did:CE0377343CEDE211B46AA47009D9EF1D</stRef:originalDocumentID>
</xmpMM:DerivedFrom>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>audio/ogg; codec="vorbis"</dc:format>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
+44
View File
@@ -0,0 +1,44 @@
/// <reference path="../../Phaser/Game.ts" />
/// <reference path="../../Phaser/sound/SoundManager.ts" />
/// <reference path="../../Phaser/sound/Sound.ts" />
//var PhaserGlobal = { disableWebAudio: true };
(function () {
var game = new Phaser.Game(this, 'game', 800, 600, init, create, null, render);
function init() {
game.load.audio('rabbit', [
'assets/mp3/peter_rabbit.m4a',
'assets/mp3/peter_rabbit.mp3',
'assets/mp3/peter_rabbit.ogg'
]);
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
game.load.start();
}
audioSprite:
Phaser.Sound
button:
Phaser.Button
pause:
Phaser.Button
function create() {
this.audioSprite = game.add.audio('rabbit');
this.audioSprite.addMarker('title', 3.00, 5.00, 1, true);
this.audioSprite.addMarker('help', 6.00, 12.00);
this.audioSprite.addMarker('intro', 14.00, 19.00);
this.audioSprite.addMarker('peter', 20.00, 21.50);
this.button = game.add.button(game.stage.centerX, 400, 'button', playMusic, this, 2, 1, 0);
//this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
}
function playMusic() {
this.audioSprite.play('help');
}
function render() {
this.audioSprite.renderDebug(32, 32);
}
function togglePause() {
if(this.music.paused) {
this.music.resume();
} else {
this.music.pause();
}
}
})();
+58
View File
@@ -0,0 +1,58 @@
/// <reference path="../../Phaser/Game.ts" />
/// <reference path="../../Phaser/sound/SoundManager.ts" />
/// <reference path="../../Phaser/sound/Sound.ts" />
//var PhaserGlobal = { disableWebAudio: true };
(function () {
var game = new Phaser.Game(this, 'game', 800, 600, init, create, null, render);
function init() {
game.load.audio('rabbit', ['assets/mp3/peter_rabbit.m4a', 'assets/mp3/peter_rabbit.mp3', 'assets/mp3/peter_rabbit.ogg']);
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
game.load.start();
}
audioSprite: Phaser.Sound;
button: Phaser.Button;
pause: Phaser.Button;
function create() {
this.audioSprite = game.add.audio('rabbit');
this.audioSprite.addMarker('title', 3.00, 5.00, 1, true);
this.audioSprite.addMarker('help', 6.00, 12.00);
this.audioSprite.addMarker('intro', 14.00, 19.00);
this.audioSprite.addMarker('peter', 20.00, 21.50);
this.button = game.add.button(game.stage.centerX, 400, 'button', playMusic, this, 2, 1, 0);
//this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
}
function playMusic() {
this.audioSprite.play('help');
}
function render() {
this.audioSprite.renderDebug(32, 32);
}
function togglePause() {
if (this.music.paused)
{
this.music.resume();
}
else
{
this.music.pause();
}
}
})();
+55
View File
@@ -0,0 +1,55 @@
/// <reference path="../../Phaser/Game.ts" />
/// <reference path="../../Phaser/sound/SoundManager.ts" />
/// <reference path="../../Phaser/sound/Sound.ts" />
//var PhaserGlobal = { fakeiOSTouchLock: true, disableWebAudio: true };
(function () {
var game = new Phaser.Game(this, 'game', 800, 600, init, create, null, render);
function init() {
//game.load.audio('wizball', ['assets/mp3/oedipus_wizball_highscore.ogg', 'assets/mp3/oedipus_wizball_highscore.mp3']);
game.load.audio('boden', [
'assets/mp3/bodenstaendig_2000_in_rock_4bit.mp3'
]);
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
game.load.start();
}
button:
Phaser.Button
music:
Phaser.Sound
volumeUp:
Phaser.Button
volumeDown:
Phaser.Button
pause:
Phaser.Button
function create() {
this.music = game.add.audio('boden');
this.button = game.add.button(game.stage.centerX, 400, 'button', playMusic, this, 2, 1, 0);
//this.volumeUp = game.add.button(0, 0, 'button', volUp, this, 2, 1, 0);
//this.volumeDown = game.add.button(700, 0, 'button', volDown, this, 2, 1, 0);
//this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
}
function render() {
this.music.renderDebug(0, 300);
}
function togglePause() {
if(this.music.paused) {
this.music.resume();
} else {
this.music.pause();
}
}
function volUp() {
//game.sound.volume += 0.1;
this.music.volume += 0.1;
console.log('vol up', game.sound.volume);
}
function volDown() {
//game.sound.volume -= 0.1;
this.music.volume -= 0.1;
console.log('vol down', game.sound.volume);
}
function playMusic() {
this.music.play();
}
})();
+70
View File
@@ -0,0 +1,70 @@
/// <reference path="../../Phaser/Game.ts" />
/// <reference path="../../Phaser/sound/SoundManager.ts" />
/// <reference path="../../Phaser/sound/Sound.ts" />
//var PhaserGlobal = { fakeiOSTouchLock: true, disableWebAudio: true };
(function () {
var game = new Phaser.Game(this, 'game', 800, 600, init, create, null, render);
function init() {
//game.load.audio('wizball', ['assets/mp3/oedipus_wizball_highscore.ogg', 'assets/mp3/oedipus_wizball_highscore.mp3']);
game.load.audio('boden', ['assets/mp3/bodenstaendig_2000_in_rock_4bit.mp3']);
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
game.load.start();
}
button: Phaser.Button;
music: Phaser.Sound;
volumeUp: Phaser.Button;
volumeDown: Phaser.Button;
pause: Phaser.Button;
function create() {
this.music = game.add.audio('boden');
this.button = game.add.button(game.stage.centerX, 400, 'button', playMusic, this, 2, 1, 0);
//this.volumeUp = game.add.button(0, 0, 'button', volUp, this, 2, 1, 0);
//this.volumeDown = game.add.button(700, 0, 'button', volDown, this, 2, 1, 0);
//this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
}
function render() {
this.music.renderDebug(0, 300);
}
function togglePause() {
if (this.music.paused)
{
this.music.resume();
}
else
{
this.music.pause();
}
}
function volUp() {
//game.sound.volume += 0.1;
this.music.volume += 0.1;
console.log('vol up', game.sound.volume);
}
function volDown() {
//game.sound.volume -= 0.1;
this.music.volume -= 0.1;
console.log('vol down', game.sound.volume);
}
function playMusic() {
this.music.play();
}
})();
+763 -193
View File
File diff suppressed because it is too large Load Diff
+14 -3
View File
@@ -16,15 +16,26 @@
atari = game.add.physicsSprite(300, 450, 'atari', null, Phaser.Types.BODY_STATIC);
//atari.rotation = 10;
//atari.body.transform.setRotation(1);
atari.body.angle = 1;
//atari.body.angle = 1;
atari.body.setTransform(atari.body.position, 1);
atari.body.syncTransform();
// atari = 220px width (110 = center x)
// ball = 32px width (16 = center x)
// Ball will be a dynamic body and fall based on gravity
ball = game.add.physicsSprite(300 - 20, 0, 'ball');
ball.body.angle = 1;
//ball.body.angle = 1;
//ball.body.transform.setRotation(1);
//ball.body.fixedRotation = true;
}
// limit the velocity or things can go nuts
ball.body.linearDamping = 0.5;
ball.body.angularDamping = 0.5;
// when the ball bounces out of the game world, call the resetBall function
ball.outOfBoundsAction = Phaser.Types.OUT_OF_BOUNDS_PERSIST;
ball.events.onOutOfBounds.add(resetBall, this);
}
function resetBall() {
ball.body.setPosition(300, 0);
}
function render() {
Phaser.DebugUtils.renderPhysicsBodyInfo(atari.body, 32, 32);
Phaser.DebugUtils.renderPhysicsBodyInfo(ball.body, 320, 32);
+16 -2
View File
@@ -25,17 +25,31 @@
atari = game.add.physicsSprite(300, 450, 'atari', null, Phaser.Types.BODY_STATIC);
//atari.rotation = 10;
//atari.body.transform.setRotation(1);
atari.body.angle = 1;
//atari.body.angle = 1;
atari.body.setTransform(atari.body.position, 1);
atari.body.syncTransform();
// atari = 220px width (110 = center x)
// ball = 32px width (16 = center x)
// Ball will be a dynamic body and fall based on gravity
ball = game.add.physicsSprite(300-20, 0, 'ball');
ball.body.angle = 1;
//ball.body.angle = 1;
//ball.body.transform.setRotation(1);
//ball.body.fixedRotation = true;
// limit the velocity or things can go nuts
ball.body.linearDamping = 0.5;
ball.body.angularDamping = 0.5;
// when the ball bounces out of the game world, call the resetBall function
ball.outOfBoundsAction = Phaser.Types.OUT_OF_BOUNDS_PERSIST;
ball.events.onOutOfBounds.add(resetBall, this);
}
function resetBall() {
ball.body.setPosition(300, 0);
}
function render() {
+3 -3
View File
@@ -6,10 +6,10 @@
game.load.image('bunny', 'assets/sprites/bunny.png');
game.load.start();
}
var bunny;
function create() {
// Here we'll assign the new sprite to the local smallBunny variable
bunny = game.add.sprite(0, 0, 'bunny');
// Here we'll assign the new sprite to the local bunny variable
var bunny = game.add.sprite(0, 0, 'bunny');
// And this sets the alpha of the sprite to 0.5, which is 50% opaque
bunny.alpha = 0.5;
}
})();