mirror of
https://github.com/wassname/phaser.git
synced 2026-09-12 12:40:47 +08:00
Putting everything back together again :)
This commit is contained in:
+3
-9
@@ -74,18 +74,10 @@
|
||||
<TypeScriptCompile Include="scrollzones\region demo.ts" />
|
||||
<TypeScriptCompile Include="scrollzones\parallax.ts" />
|
||||
<TypeScriptCompile Include="scrollzones\ballscroller.ts" />
|
||||
<TypeScriptCompile Include="physics\circle 1.ts" />
|
||||
<TypeScriptCompile Include="physics\aabb vs aabb 1.ts" />
|
||||
<Content Include="physics\aabb vs aabb 1.js">
|
||||
<DependentUpon>aabb vs aabb 1.ts</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="physics\circle 1.js">
|
||||
<DependentUpon>circle 1.ts</DependentUpon>
|
||||
</Content>
|
||||
<TypeScriptCompile Include="physics\test 1.ts" />
|
||||
<Content Include="physics\test 1.js">
|
||||
<DependentUpon>test 1.ts</DependentUpon>
|
||||
</Content>
|
||||
<Content Include="scrollzones\ballscroller.js">
|
||||
<DependentUpon>ballscroller.ts</DependentUpon>
|
||||
</Content>
|
||||
@@ -166,6 +158,8 @@
|
||||
<DependentUpon>boot screen.ts</DependentUpon>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Folder Include="particles\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" />
|
||||
</Project>
|
||||
+5820
-4048
File diff suppressed because it is too large
Load Diff
@@ -14,24 +14,24 @@
|
||||
//atari.physics.shape.setSize(150, 50);
|
||||
//atari.physics.shape.offset.setTo(50, 25);
|
||||
//atari.physics.gravity.setTo(0, 2);
|
||||
atari.physics.bounce.setTo(0.7, 0.7);
|
||||
atari.physics.drag.setTo(10, 10);
|
||||
atari.body.bounce.setTo(0.7, 0.7);
|
||||
atari.body.drag.setTo(10, 10);
|
||||
}
|
||||
function update() {
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
atari.body.acceleration.x = 0;
|
||||
atari.body.acceleration.y = 0;
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
|
||||
atari.physics.acceleration.x = -150;
|
||||
atari.body.acceleration.x = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
|
||||
atari.physics.acceleration.x = 150;
|
||||
atari.body.acceleration.x = 150;
|
||||
}
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.UP)) {
|
||||
atari.physics.acceleration.y = -150;
|
||||
atari.body.acceleration.y = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) {
|
||||
atari.physics.acceleration.y = 150;
|
||||
atari.body.acceleration.y = 150;
|
||||
}
|
||||
}
|
||||
function render() {
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
atari.body.renderDebugInfo(16, 16);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -24,39 +24,39 @@
|
||||
//atari.physics.shape.offset.setTo(50, 25);
|
||||
|
||||
//atari.physics.gravity.setTo(0, 2);
|
||||
atari.physics.bounce.setTo(0.7, 0.7);
|
||||
atari.physics.drag.setTo(10, 10);
|
||||
atari.body.bounce.setTo(0.7, 0.7);
|
||||
atari.body.drag.setTo(10, 10);
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
atari.body.acceleration.x = 0;
|
||||
atari.body.acceleration.y = 0;
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
|
||||
{
|
||||
atari.physics.acceleration.x = -150;
|
||||
atari.body.acceleration.x = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
|
||||
{
|
||||
atari.physics.acceleration.x = 150;
|
||||
atari.body.acceleration.x = 150;
|
||||
}
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
|
||||
{
|
||||
atari.physics.acceleration.y = -150;
|
||||
atari.body.acceleration.y = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))
|
||||
{
|
||||
atari.physics.acceleration.y = 150;
|
||||
atari.body.acceleration.y = 150;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
atari.body.renderDebugInfo(16, 16);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,34 +14,34 @@
|
||||
//atari = game.add.sprite(350, 500, 'atari');
|
||||
atari = game.add.sprite(0, 310, 'atari');
|
||||
card = game.add.sprite(400, 300, 'card');
|
||||
//card.physics.immovable = true;
|
||||
//card.body.immovable = true;
|
||||
//atari.texture.alpha = 0.5;
|
||||
//atari.scale.setTo(1.5, 1.5);
|
||||
atari.physics.shape.setSize(150, 50);
|
||||
atari.physics.shape.offset.setTo(50, 25);
|
||||
//atari.physics.gravity.setTo(0, 2);
|
||||
atari.physics.bounce.setTo(1, 1);
|
||||
//atari.physics.drag.setTo(10, 10);
|
||||
card.physics.bounce.setTo(0.7, 0.7);
|
||||
//card.physics.velocity.x = -50;
|
||||
//atari.body.shape.setSize(150, 50);
|
||||
//atari.body.shape.offset.setTo(50, 25);
|
||||
//atari.body.gravity.setTo(0, 2);
|
||||
atari.body.bounce.setTo(1, 1);
|
||||
//atari.body.drag.setTo(10, 10);
|
||||
card.body.bounce.setTo(0.7, 0.7);
|
||||
//card.body.velocity.x = -50;
|
||||
}
|
||||
function update() {
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
atari.body.acceleration.x = 0;
|
||||
atari.body.acceleration.y = 0;
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
|
||||
atari.physics.acceleration.x = -150;
|
||||
atari.body.acceleration.x = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
|
||||
atari.physics.acceleration.x = 150;
|
||||
atari.body.acceleration.x = 150;
|
||||
}
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.UP)) {
|
||||
atari.physics.acceleration.y = -150;
|
||||
atari.body.acceleration.y = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) {
|
||||
atari.physics.acceleration.y = 150;
|
||||
atari.body.acceleration.y = 150;
|
||||
}
|
||||
// collide?
|
||||
}
|
||||
function render() {
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
card.physics.renderDebugInfo(200, 16);
|
||||
atari.body.renderDebugInfo(16, 16);
|
||||
card.body.renderDebugInfo(200, 16);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -23,44 +23,44 @@
|
||||
atari = game.add.sprite(0, 310, 'atari');
|
||||
card = game.add.sprite(400, 300, 'card');
|
||||
|
||||
//card.physics.immovable = true;
|
||||
//card.body.immovable = true;
|
||||
|
||||
//atari.texture.alpha = 0.5;
|
||||
//atari.scale.setTo(1.5, 1.5);
|
||||
|
||||
atari.physics.shape.setSize(150, 50);
|
||||
atari.physics.shape.offset.setTo(50, 25);
|
||||
//atari.body.shape.setSize(150, 50);
|
||||
//atari.body.shape.offset.setTo(50, 25);
|
||||
|
||||
//atari.physics.gravity.setTo(0, 2);
|
||||
atari.physics.bounce.setTo(1, 1);
|
||||
//atari.physics.drag.setTo(10, 10);
|
||||
//atari.body.gravity.setTo(0, 2);
|
||||
atari.body.bounce.setTo(1, 1);
|
||||
//atari.body.drag.setTo(10, 10);
|
||||
|
||||
card.physics.bounce.setTo(0.7, 0.7);
|
||||
//card.physics.velocity.x = -50;
|
||||
card.body.bounce.setTo(0.7, 0.7);
|
||||
//card.body.velocity.x = -50;
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
atari.body.acceleration.x = 0;
|
||||
atari.body.acceleration.y = 0;
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
|
||||
{
|
||||
atari.physics.acceleration.x = -150;
|
||||
atari.body.acceleration.x = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
|
||||
{
|
||||
atari.physics.acceleration.x = 150;
|
||||
atari.body.acceleration.x = 150;
|
||||
}
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
|
||||
{
|
||||
atari.physics.acceleration.y = -150;
|
||||
atari.body.acceleration.y = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))
|
||||
{
|
||||
atari.physics.acceleration.y = 150;
|
||||
atari.body.acceleration.y = 150;
|
||||
}
|
||||
|
||||
// collide?
|
||||
@@ -69,8 +69,8 @@
|
||||
|
||||
function render() {
|
||||
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
card.physics.renderDebugInfo(200, 16);
|
||||
atari.body.renderDebugInfo(16, 16);
|
||||
card.body.renderDebugInfo(200, 16);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/// <reference path="../../Phaser/Game.ts" />
|
||||
(function () {
|
||||
var game = new Phaser.Game(this, 'game', 800, 600, init, create, update, render);
|
||||
function init() {
|
||||
// Using Phasers asset loader we load up a PNG from the assets folder
|
||||
game.loader.addImageFile('atari', 'assets/sprites/mushroom2.png');
|
||||
game.loader.addImageFile('card', 'assets/sprites/mana_card.png');
|
||||
game.loader.load();
|
||||
}
|
||||
var atari;
|
||||
var card;
|
||||
function create() {
|
||||
atari = game.add.sprite(200, 300, 'atari');
|
||||
card = game.add.sprite(400, 300, 'card');
|
||||
//atari.texture.alpha = 0.5;
|
||||
//atari.scale.setTo(1.5, 1.5);
|
||||
atari.physics.setCircle(100);
|
||||
//atari.physics.shape.setSize(150, 50);
|
||||
//atari.physics.shape.offset.setTo(7, 5);
|
||||
//atari.physics.gravity.setTo(0, 2);
|
||||
atari.physics.bounce.setTo(0.7, 0.7);
|
||||
//atari.physics.drag.setTo(10, 10);
|
||||
card.physics.bounce.setTo(0.7, 0.7);
|
||||
}
|
||||
function update() {
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
|
||||
atari.physics.acceleration.x = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
|
||||
atari.physics.acceleration.x = 150;
|
||||
}
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.UP)) {
|
||||
atari.physics.acceleration.y = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) {
|
||||
atari.physics.acceleration.y = 150;
|
||||
}
|
||||
}
|
||||
function render() {
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
}
|
||||
})();
|
||||
@@ -1,70 +0,0 @@
|
||||
/// <reference path="../../Phaser/Game.ts" />
|
||||
|
||||
(function () {
|
||||
|
||||
var game = new Phaser.Game(this, 'game', 800, 600, init, create, update, render);
|
||||
|
||||
function init() {
|
||||
|
||||
// Using Phasers asset loader we load up a PNG from the assets folder
|
||||
game.loader.addImageFile('atari', 'assets/sprites/mushroom2.png');
|
||||
game.loader.addImageFile('card', 'assets/sprites/mana_card.png');
|
||||
game.loader.load();
|
||||
|
||||
}
|
||||
|
||||
var atari: Phaser.Sprite;
|
||||
var card: Phaser.Sprite;
|
||||
|
||||
function create() {
|
||||
|
||||
atari = game.add.sprite(200, 300, 'atari');
|
||||
card = game.add.sprite(400, 300, 'card');
|
||||
//atari.texture.alpha = 0.5;
|
||||
//atari.scale.setTo(1.5, 1.5);
|
||||
|
||||
atari.physics.setCircle(100);
|
||||
|
||||
//atari.physics.shape.setSize(150, 50);
|
||||
//atari.physics.shape.offset.setTo(7, 5);
|
||||
|
||||
//atari.physics.gravity.setTo(0, 2);
|
||||
atari.physics.bounce.setTo(0.7, 0.7);
|
||||
//atari.physics.drag.setTo(10, 10);
|
||||
|
||||
card.physics.bounce.setTo(0.7, 0.7);
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
|
||||
{
|
||||
atari.physics.acceleration.x = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
|
||||
{
|
||||
atari.physics.acceleration.x = 150;
|
||||
}
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
|
||||
{
|
||||
atari.physics.acceleration.y = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))
|
||||
{
|
||||
atari.physics.acceleration.y = 150;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -1,42 +0,0 @@
|
||||
/// <reference path="../../Phaser/Game.ts" />
|
||||
/// <reference path="../../Phaser/core/Polygon.ts" />
|
||||
/// <reference path="../../Phaser/utils/SpriteUtils.ts" />
|
||||
(function () {
|
||||
var game = new Phaser.Game(this, 'game', 800, 600, init, create, update, render);
|
||||
function init() {
|
||||
// Using Phasers asset loader we load up a PNG from the assets folder
|
||||
game.loader.addImageFile('atari', 'assets/sprites/atari800xl.png');
|
||||
game.loader.load();
|
||||
}
|
||||
var atari;
|
||||
var p;
|
||||
var atari2;
|
||||
var p2;
|
||||
function create() {
|
||||
atari = game.add.sprite(200, 300, 'atari');
|
||||
atari.texture.alpha = 0.2;
|
||||
atari2 = game.add.sprite(500, 300, 'atari');
|
||||
atari2.texture.alpha = 0.2;
|
||||
p = new Phaser.Polygon(game, Phaser.SpriteUtils.getAsPoints(atari));
|
||||
p2 = new Phaser.Polygon(game, Phaser.SpriteUtils.getAsPoints(atari2));
|
||||
}
|
||||
function update() {
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
|
||||
atari.physics.acceleration.x = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
|
||||
atari.physics.acceleration.x = 150;
|
||||
}
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.UP)) {
|
||||
atari.physics.acceleration.y = -150;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) {
|
||||
atari.physics.acceleration.y = 150;
|
||||
}
|
||||
}
|
||||
function render() {
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
p.render();
|
||||
p2.render();
|
||||
}
|
||||
})();
|
||||
@@ -1,70 +0,0 @@
|
||||
/// <reference path="../../Phaser/Game.ts" />
|
||||
/// <reference path="../../Phaser/core/Polygon.ts" />
|
||||
/// <reference path="../../Phaser/utils/SpriteUtils.ts" />
|
||||
|
||||
(function () {
|
||||
|
||||
var game = new Phaser.Game(this, 'game', 800, 600, init, create, update, render);
|
||||
|
||||
function init() {
|
||||
|
||||
// Using Phasers asset loader we load up a PNG from the assets folder
|
||||
game.loader.addImageFile('atari', 'assets/sprites/atari800xl.png');
|
||||
game.loader.load();
|
||||
|
||||
}
|
||||
|
||||
var atari: Phaser.Sprite;
|
||||
var p: Phaser.Polygon;
|
||||
|
||||
var atari2: Phaser.Sprite;
|
||||
var p2: Phaser.Polygon;
|
||||
|
||||
function create() {
|
||||
|
||||
atari = game.add.sprite(200, 300, 'atari');
|
||||
atari.texture.alpha = 0.2;
|
||||
|
||||
atari2 = game.add.sprite(500, 300, 'atari');
|
||||
atari2.texture.alpha = 0.2;
|
||||
|
||||
p = new Phaser.Polygon(game, Phaser.SpriteUtils.getAsPoints(atari));
|
||||
p2 = new Phaser.Polygon(game, Phaser.SpriteUtils.getAsPoints(atari2));
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
atari.physics.acceleration.x = 0;
|
||||
atari.physics.acceleration.y = 0;
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT))
|
||||
{
|
||||
atari.physics.acceleration.x = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT))
|
||||
{
|
||||
atari.physics.acceleration.x = 150;
|
||||
}
|
||||
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.UP))
|
||||
{
|
||||
atari.physics.acceleration.y = -150;
|
||||
}
|
||||
else if (game.input.keyboard.isDown(Phaser.Keyboard.DOWN))
|
||||
{
|
||||
atari.physics.acceleration.y = 150;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
atari.physics.renderDebugInfo(16, 16);
|
||||
|
||||
p.render();
|
||||
p2.render();
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -14,7 +14,7 @@
|
||||
// The sprite is 320 x 200 pixels in size
|
||||
// If we don't set an origin then the sprite will rotate around 0,0 - the top left corner
|
||||
game.add.tween(fuji).to({
|
||||
rotation: 360
|
||||
angle: 360
|
||||
}, 2000, Phaser.Easing.Linear.None, true, 0, true);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
// The sprite is 320 x 200 pixels in size
|
||||
// If we don't set an origin then the sprite will rotate around 0,0 - the top left corner
|
||||
game.add.tween(fuji).to({ rotation: 360 }, 2000, Phaser.Easing.Linear.None, true, 0, true);
|
||||
game.add.tween(fuji).to({ angle: 360 }, 2000, Phaser.Easing.Linear.None, true, 0, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user