Final commit of the day

This commit is contained in:
Webeled
2013-10-11 22:49:51 +01:00
parent eb98998046
commit 786aa2900e
7 changed files with 5 additions and 64 deletions
@@ -1,5 +1,5 @@
<?php
$title = "Group move towards object";
$title = "Group moves towards object";
require('../head.php');
?>
@@ -35,7 +35,7 @@
// First is the callback
// Second is the context in which the callback runs, in this case game.physics
// Third is the parameter the callback expects - it is always sent the Group child as the first parameter
balls.forEach(game.physics.moveTowardsMouse, game.physics, false, 200);
balls.forEach(game.physics.moveToPointer, game.physics, false, 200);
}
else
{
-59
View File
@@ -1,59 +0,0 @@
<?php
$title = "Animation from a Texture Atlas";
require('../head.php');
?>
<script type="text/javascript">
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create});
function preload() {
// Texture Atlas Method 4
//
// We load a TexturePacker JSON file and image and show you how to make several unique sprites from the same file
game.load.atlas('atlas', 'assets/pics/texturepacker_test.png', 'assets/pics/texturepacker_test.json');
}
var chick;
var car;
var mech;
var robot;
var cop;
function create() {
game.stage.backgroundColor = 'rgb(40, 40, 40)';
chick = game.add.sprite(64, 64, 'atlas');
// You can set the frame based on the frame name (which TexturePacker usually sets to be the filename of the image itself)
chick.frameName = 'budbrain_chick.png';
// Or by setting the frame index
//chick.frame = 0;
cop = game.add.sprite(600, 64, 'atlas');
cop.frameName = 'ladycop.png';
robot = game.add.sprite(50, 300, 'atlas');
robot.frameName = 'robot.png';
car = game.add.sprite(100, 400, 'atlas');
car.frameName = 'supercars_parsec.png';
mech = game.add.sprite(250, 100, 'atlas');
mech.frameName = 'titan_mech.png';
}
</script>
<?php
require('../foot.php');
?>
@@ -1,5 +1,5 @@
<?php
$title = "Animation from a Texture Atlas";
$title = "Several sprites using only one texture file";
require('../head.php');
?>
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
$title = "Using duration and scale";
$title = "Alpha fading a sprite";
require('../head.php');
?>
@@ -1,5 +1,5 @@
<?php
$title = "Bounce";
$title = "Tweening several properties";
require('../head.php');
?>