New Examples area finished, README updated. Getting closer to 1.1 release.

This commit is contained in:
photonstorm 2013-10-23 04:15:44 +01:00
parent cab3b53cf0
commit f1f42e4d41
16 changed files with 351 additions and 662 deletions

103
README.md
View file

@ -1,11 +1,11 @@
![Phaser Logo](http://www.photonstorm.com/wp-content/uploads/2013/09/phaser_10_release.jpg) ![Phaser Logo](http://www.photonstorm.com/wp-content/uploads/2013/09/phaser_10_release.jpg)
Phaser 1.0 Phaser 1.1
========== ==========
Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering. Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering.
Version: 1.0.6 - Released: September 24th 2013 Version: 1.1 - Released: October 24th 2013
By Richard Davey, [Photon Storm](http://www.photonstorm.com) By Richard Davey, [Photon Storm](http://www.photonstorm.com)
@ -22,24 +22,26 @@ Try out the [Phaser Test Suite](http://gametest.mobi/phaser/)
Welcome to Phaser Welcome to Phaser
----------------- -----------------
We're very pleased to have finally shipped the 1.0 release of Phaser. This version represents many months of hard work, feedback and refactoring based on the previous 0.5 through to 0.97 releases. You can see the full gory details in our change log. It's staggering to think just how much has been achieved in the short time the 1.0 branch of Phaser has been available. We've seen literally hundreds of bug fixes and updates. Exciting new features and enhancements have been merged into the core library thanks to contributions from the community. We also completely overhauled the Examples Suite, removed the requirement for PHP, rebuilt it in html+js and filled it with over 150 examples to dig in to and learn from. And more importantly we've got our first pass at the API docs online and ready too.
Sorry but the jsdocs aren't yet finished, but it is now our priority (along with bug fixing). If you run into problems, or just want to chat about how to best use Phaser then please do join our forums. It's an active and inspiring community. There is still more to be done of course. The API docs, while a good start, still need to be backed up with a proper comprehensive manual. And we desperately need to write some 'best practises' and 'getting started' tutorials. But at least now you don't have to flounder around in the dark and can turn to the examples and docs.
Now 1.0 is released we'll focus on getting the docs and more examples completed. Both of these will be pushed to the master repo on a regular basis. We will tag new releases of Phaser, but changes to the examples or docs won't be release tagged. There are so many exciting new features and tweaks in this build that we felt it warranted a proper full point release: 1.1. A few things have also changed, so games that were in development in the 1.0 version may need refactoring for 1.1, but we feel those changes have benefitted the framework as a whole.
Thank you to everyone who has encouraged us along the way. To those of you who worked with Phaser during its various incarnations, and who released full games with it despite there being zero API documentation available: you are our heroes. It's your kind words and enthusiasm, as well as our commercial need for Phaser that has kept us going. Now we're at 1.0 we will continue releasing rapidly and jumping on patches and bug reports quickly. As before "Thank you!" to everyone who has encouraged us along the way. To those of you who worked with Phaser during its various incarnations, and who released full games with it despite there being zero API documentation available: you are our heroes. It's your kind words and enthusiasm, as well as our commercial need for Phaser that has kept us going.
Phaser is everything we ever wanted from an HTML5 game framework. It will power all our client work going forward and we look forward to you joining us on this journey. Phaser is everything we ever wanted from an HTML5 game framework. It powers all of our client work in build today and remains our single most important product, and we've only just scratched the surface of what we have planned for it.
![Blasteroids](http://www.photonstorm.com/wp-content/uploads/2013/04/phaser_blaster.png) ![Blasteroids](http://www.photonstorm.com/wp-content/uploads/2013/04/phaser_blaster.png)
(swap for tanks)
Change Log Change Log
---------- ----------
Version 1.1 (in progress in the dev branch) Version 1.1
* JSDoc is go! We've added jsdoc3 blocks to every property and function, in every file. * JSDoc is go! We've added jsdoc3 blocks to every property and function, in every file.
* Brand new Example system (no more php!) and over 150 examples to learn from too.
* Added World.postUpdate - all sprite position changes, as a result of physics, happen here before the render. * Added World.postUpdate - all sprite position changes, as a result of physics, happen here before the render.
* Complete overhaul of Physics.Arcade.Body - now significantly more stable and faster too. * Complete overhaul of Physics.Arcade.Body - now significantly more stable and faster too.
* Updated ArcadePhysics.separateX/Y to use new body system - much better results now. * Updated ArcadePhysics.separateX/Y to use new body system - much better results now.
@ -133,95 +135,18 @@ Version 1.1 (in progress in the dev branch)
* You can now null a Sprite.crop and it will clear down the crop rect area correctly. * You can now null a Sprite.crop and it will clear down the crop rect area correctly.
* The default Game.antialias value is now 'true', so graphics will be smoothed automatically in canvas. Disable it via the Game constructor or Canvas utils. * The default Game.antialias value is now 'true', so graphics will be smoothed automatically in canvas. Disable it via the Game constructor or Canvas utils.
Outstanding Tasks
-----------------
* BUG: The pixel perfect click check doesn't work if the sprite is part of a texture atlas yet.
* TODO: look at Sprite.crop (http://www.html5gamedevs.com/topic/1617-error-in-spritecrop/) * TODO: look at Sprite.crop (http://www.html5gamedevs.com/topic/1617-error-in-spritecrop/)
* TODO: d-pad example (http://www.html5gamedevs.com/topic/1574-gameinputondown-question/) * TODO: d-pad example (http://www.html5gamedevs.com/topic/1574-gameinputondown-question/)
* TODO: more touch input examples (http://www.html5gamedevs.com/topic/1556-mobile-touch-event/) * TODO: more touch input examples (http://www.html5gamedevs.com/topic/1556-mobile-touch-event/)
* TODO: addMarker hh:mm:ss:ms * TODO: Sound.addMarker hh:mm:ss:ms
* TODO: swap state (non-destructive shift) * TODO: swap state (non-destructive shift)
* TODO: rotation offset * TODO: rotation offset
* TODO: check stage bgc on droid (http://www.html5gamedevs.com/topic/1629-stage-background-color-not-working-on-android-chrome/) * TODO: check stage bgc on droid (http://www.html5gamedevs.com/topic/1629-stage-background-color-not-working-on-android-chrome/)
Version 1.0.6 (September 24th 2013)
* Added check into Pointer.move to always consider a Sprite that has pixelPerfect enabled, regardless of render ID.
* BUG: The pixel perfect click check doesn't work if the sprite is part of a texture atlas yet.
* Fixed issue with anti-alias in the Game constructor not being set correctly (thanks luizbills)
* Added support for the Graphics game object back in and two examples (thanks earok for spotting)
* New: Tweens can now be chained via multiple to() calls + example created (thanks to powerfear for adding)
* Fixed Math.wrap (thanks TheJare)
* New: When loading a Sprite Sheet you can now pass negative values for the frame sizes which specifies the number of rows/columns to load instead (thanks TheJare)
* New: BitmapText now supports anchor and has fixed box dimensions (thanks TheJare)
* Fixed bug where if a State contains an empty Preloader the Update will not be called (thanks TheJare)
* Several new examples added (cameras, tweens, etc)
* Added in extra checks to halt collision if it involves an empty Group (thanks cang)
* Added time smoothing to Animation update to help frames hopefully not get too out of sync during long animations with high frame rates.
* Added frame skip to Animation.update. If it gets too far behind it will now skip frames to try and catch up.
Version 1.0.5 (September 20th 2013)
* Fixed issue in FrameData.getFrameIndexes where the input array was being ignored.
* Added Math.numberArray - Returns an Array containing the numbers from min to max (inclusive), useful for animation frame construction.
* Fixed a horrendously sneaky bug: If a new tween was created in the onComplete callback of a tween about to be deleted, it would get automatically spliced.
* Added a pendingDelete property to Tween to stop tweens that were removed during a callback from causing update errors during the TweenManager loop.
* Added Group.length property.
* Added explicit x/y attributes to Phaser.Text to make it work with the camera system (thanks cocoademon).
* Fixed issue stopping multiple animations from playing, only the most recent would play (frames array was being overwritten, thanks Legrandk)
* Updated Debug.renderSpriteBounds() so it doesn't use the deprecated Sprite.worldView any more (thanks MikeMnD)
* Added 2 new properties to the Text object: Text.text and Text.style, both are getter/setters and don't flag dirty unless changed, so safe for core loop use.
* Removed the exists check from Group.callAll, it now runs on all children (as the name implies)
* Added Group.callAllExists - you can now call a function on all children who have exists = the provided boolean.
* Finished off the Breakout example game - now fully playable, proper rebound, scoring, lives, etc.
* Removed Group.sort dummy entry until it's working.
* Removed ArcadePhysics.postUpdate.
* Updated Sprite.update to set renderable to false when the object goes out of Camera, not 'visible' false, otherwise it stops the transform being updated by Pixi.
* BUG: There is a known issue where the wrong rect coordinates are given to the QuadTree if the Sprite is a child of a Group or another Sprite which has an x/y offset.
Version 1.0.4 (September 18th 2013)
* Small fix to Phaser.Canvas to stop it from setting overflow hidden if the parent DOM element doesn't exist.
* Added Loader.setPreloadSprite(sprite, direction) - this will automatically apply a crop rect to the Sprite which is updated in line with the load progress.
* A lot of changes inside the StateManager. State functions are now passed through link() which automatically creates the key Game properties (load, input, etc)
* Fixed a bug in getFrameByName that wouldn't return the first frame in the array.
* Updated Phaser.Rectangle.intersects to use x and y instead of left and top so it can be used to check Physics bodies overlapping.
* Fixed issue in Cache where the Frame index wasn't being set correctly (thanks Cameron)
* Fixed issue in Sprite where boundsY wasn't set (thanks Cameron)
* For some reason there were 2 copies of the Canvas class in the build file - fixed, a few KB saved :)
Version 1.0.3 (September 17th 2013)
* FrameData.getFrameIndexes and getFrameIndexesByName refactored into a more versatile getFrames function.
* Various fixes to looping parameters in the Sound system.
* Documentation started across most classes. Keep track of progress in the Docs folder.
* Optimised AnimationManager.add so it will only get the required frames rather than all of them and is now faster at parsing the frame data.
* Fixed Phaser.Text and Phaser.BitmapText so they now render correctly and added several Text examples.
Version 1.0.2 (September 16th 2013)
* Added optional parameter to Animation.stop: resetFrame. If true the animation will be stopped and then the current frame reset to the first frame in the animation.
* Fixed an issue causing 'explode' particle bursts to ignore the quantity parameter.
* Added 'collideWorldBounds' to Emitter.makeParticles function.
* Added Emitter.angularDrag
* Changed Emitter.bounce from a number to a Point, so now set its x/y properties to control different amounts of bounce per axis.
* Fixed a bug in the AnimationManager where useNumericIndex was always set to true
* Added in lots of Particle examples
* Added in the start of a Breakout game
* Added in the start of a Platformer game
Version 1.0.1 (September 15th 2013)
* Added checks into every Group function to ensure that the Group has children before running them.
* Added optional flag to Group.create which allows you to set the default exists state of the Sprites.
* Sprite.animation.stop no longer needs an animation name parameter, will default to stopping the current animation.
* Fixed the license in package.json
* Fixed a logic bug in the separateTileX function that would sometimes cause tunneling of big sprites through small tiles.
Requirements Requirements
------------ ------------

View file

@ -1,7 +1,81 @@
Change Log Change Log
---------- ----------
V0.9.8 Version 1.0.6 (September 24th 2013)
* Added check into Pointer.move to always consider a Sprite that has pixelPerfect enabled, regardless of render ID.
* BUG: The pixel perfect click check doesn't work if the sprite is part of a texture atlas yet.
* Fixed issue with anti-alias in the Game constructor not being set correctly (thanks luizbills)
* Added support for the Graphics game object back in and two examples (thanks earok for spotting)
* New: Tweens can now be chained via multiple to() calls + example created (thanks to powerfear for adding)
* Fixed Math.wrap (thanks TheJare)
* New: When loading a Sprite Sheet you can now pass negative values for the frame sizes which specifies the number of rows/columns to load instead (thanks TheJare)
* New: BitmapText now supports anchor and has fixed box dimensions (thanks TheJare)
* Fixed bug where if a State contains an empty Preloader the Update will not be called (thanks TheJare)
* Several new examples added (cameras, tweens, etc)
* Added in extra checks to halt collision if it involves an empty Group (thanks cang)
* Added time smoothing to Animation update to help frames hopefully not get too out of sync during long animations with high frame rates.
* Added frame skip to Animation.update. If it gets too far behind it will now skip frames to try and catch up.
Version 1.0.5 (September 20th 2013)
* Fixed issue in FrameData.getFrameIndexes where the input array was being ignored.
* Added Math.numberArray - Returns an Array containing the numbers from min to max (inclusive), useful for animation frame construction.
* Fixed a horrendously sneaky bug: If a new tween was created in the onComplete callback of a tween about to be deleted, it would get automatically spliced.
* Added a pendingDelete property to Tween to stop tweens that were removed during a callback from causing update errors during the TweenManager loop.
* Added Group.length property.
* Added explicit x/y attributes to Phaser.Text to make it work with the camera system (thanks cocoademon).
* Fixed issue stopping multiple animations from playing, only the most recent would play (frames array was being overwritten, thanks Legrandk)
* Updated Debug.renderSpriteBounds() so it doesn't use the deprecated Sprite.worldView any more (thanks MikeMnD)
* Added 2 new properties to the Text object: Text.text and Text.style, both are getter/setters and don't flag dirty unless changed, so safe for core loop use.
* Removed the exists check from Group.callAll, it now runs on all children (as the name implies)
* Added Group.callAllExists - you can now call a function on all children who have exists = the provided boolean.
* Finished off the Breakout example game - now fully playable, proper rebound, scoring, lives, etc.
* Removed Group.sort dummy entry until it's working.
* Removed ArcadePhysics.postUpdate.
* Updated Sprite.update to set renderable to false when the object goes out of Camera, not 'visible' false, otherwise it stops the transform being updated by Pixi.
* BUG: There is a known issue where the wrong rect coordinates are given to the QuadTree if the Sprite is a child of a Group or another Sprite which has an x/y offset.
Version 1.0.4 (September 18th 2013)
* Small fix to Phaser.Canvas to stop it from setting overflow hidden if the parent DOM element doesn't exist.
* Added Loader.setPreloadSprite(sprite, direction) - this will automatically apply a crop rect to the Sprite which is updated in line with the load progress.
* A lot of changes inside the StateManager. State functions are now passed through link() which automatically creates the key Game properties (load, input, etc)
* Fixed a bug in getFrameByName that wouldn't return the first frame in the array.
* Updated Phaser.Rectangle.intersects to use x and y instead of left and top so it can be used to check Physics bodies overlapping.
* Fixed issue in Cache where the Frame index wasn't being set correctly (thanks Cameron)
* Fixed issue in Sprite where boundsY wasn't set (thanks Cameron)
* For some reason there were 2 copies of the Canvas class in the build file - fixed, a few KB saved :)
Version 1.0.3 (September 17th 2013)
* FrameData.getFrameIndexes and getFrameIndexesByName refactored into a more versatile getFrames function.
* Various fixes to looping parameters in the Sound system.
* Documentation started across most classes. Keep track of progress in the Docs folder.
* Optimised AnimationManager.add so it will only get the required frames rather than all of them and is now faster at parsing the frame data.
* Fixed Phaser.Text and Phaser.BitmapText so they now render correctly and added several Text examples.
Version 1.0.2 (September 16th 2013)
* Added optional parameter to Animation.stop: resetFrame. If true the animation will be stopped and then the current frame reset to the first frame in the animation.
* Fixed an issue causing 'explode' particle bursts to ignore the quantity parameter.
* Added 'collideWorldBounds' to Emitter.makeParticles function.
* Added Emitter.angularDrag
* Changed Emitter.bounce from a number to a Point, so now set its x/y properties to control different amounts of bounce per axis.
* Fixed a bug in the AnimationManager where useNumericIndex was always set to true
* Added in lots of Particle examples
* Added in the start of a Breakout game
* Added in the start of a Platformer game
Version 1.0.1 (September 15th 2013)
* Added checks into every Group function to ensure that the Group has children before running them.
* Added optional flag to Group.create which allows you to set the default exists state of the Sprites.
* Sprite.animation.stop no longer needs an animation name parameter, will default to stopping the current animation.
* Fixed the license in package.json
* Fixed a logic bug in the separateTileX function that would sometimes cause tunneling of big sprites through small tiles.
Version 0.9.8
* Massive refactoring across the entire codebase. * Massive refactoring across the entire codebase.
* Removed Basic and GameObject and put Sprite on a diet. 127 properties and methods cut down to 32. * Removed Basic and GameObject and put Sprite on a diet. 127 properties and methods cut down to 32.
@ -109,7 +183,7 @@ V0.9.8
* Added CanvasUtils class, including ability to set image rendering, add a canvas to the dom and other handy things. * Added CanvasUtils class, including ability to set image rendering, add a canvas to the dom and other handy things.
V0.9.6 Version 0.9.6
* Virtually every class now has documentation - if you spot a typo or something missing please shout (thanks pixelpicosean). * Virtually every class now has documentation - if you spot a typo or something missing please shout (thanks pixelpicosean).
* Grunt file updated to produce the new Special FX JS file (thanks HackManiac). * Grunt file updated to produce the new Special FX JS file (thanks HackManiac).
@ -197,7 +271,7 @@ V0.9.6
* Added the GameObjectFactory to Phaser.State * Added the GameObjectFactory to Phaser.State
* Added new format parameter to Loader.addTextureAtlas defining the format. Currently supported: JSON Array and Starling/Sparrow XML. * Added new format parameter to Loader.addTextureAtlas defining the format. Currently supported: JSON Array and Starling/Sparrow XML.
V0.9.5 Version 0.9.5
* Moved the BootScreen and PauseScreen out of Stage into their own classes (system/screens/BootScreen and PauseScreen). * Moved the BootScreen and PauseScreen out of Stage into their own classes (system/screens/BootScreen and PauseScreen).
* Updated the PauseScreen to show a subtle animation effect, making it easier to create your own interesting pause screens. * Updated the PauseScreen to show a subtle animation effect, making it easier to create your own interesting pause screens.
@ -231,7 +305,7 @@ V0.9.5
* Added fun new "map draw" test - rebound those carrots! :) * Added fun new "map draw" test - rebound those carrots! :)
* Changed SoundManager class to respect volume on first play (thanks initials and hackmaniac) * Changed SoundManager class to respect volume on first play (thanks initials and hackmaniac)
V0.9.4 Version 0.9.4
* Added Tilemap.getTile, getTileFromWorldXY, getTileFromInputXY * Added Tilemap.getTile, getTileFromWorldXY, getTileFromInputXY
* Added Tilemap.setCollisionByIndex and setCollisionByRange * Added Tilemap.setCollisionByIndex and setCollisionByRange
@ -261,7 +335,7 @@ V0.9.3
* Removed the need for DynamicTextures to require a key property and updated test cases. * Removed the need for DynamicTextures to require a key property and updated test cases.
* You can now pass an array or a single value to Input.Keyboard.addKeyCapture(). * You can now pass an array or a single value to Input.Keyboard.addKeyCapture().
V0.9.2 Version 0.9.2
* Fixed issue with create not being called if there was an empty init method. * Fixed issue with create not being called if there was an empty init method.
* Added ability to flip a sprite (Sprite.flipped = true) + a test case for it. * Added ability to flip a sprite (Sprite.flipped = true) + a test case for it.
@ -269,7 +343,7 @@ V0.9.2
* Sprite animations don't restart if you call play on them when they are already running. * Sprite animations don't restart if you call play on them when they are already running.
* Added Stage.disablePauseScreen. Set to true to stop your game pausing when the tab loses focus. * Added Stage.disablePauseScreen. Set to true to stop your game pausing when the tab loses focus.
V0.9.1 Version 0.9.1
* Added the new align property to GameObjects that controls placement when rendering. * Added the new align property to GameObjects that controls placement when rendering.
* Added an align example to the Sprites test group (click the mouse to change alignment position) * Added an align example to the Sprites test group (click the mouse to change alignment position)
@ -279,7 +353,7 @@ for new collision system.
* Game.Input now has 2 signals you can subscribe to for down/up events, see the Sprite align example for use. * Game.Input now has 2 signals you can subscribe to for down/up events, see the Sprite align example for use.
* Updated the States examples to bring in-line with 0.9 release. * Updated the States examples to bring in-line with 0.9 release.
V0.9 Version 0.9
* Large refactoring. Everything now lives inside the Phaser module, so all code and all tests have been updated to reflect this. Makes coding a tiny bit more verbose but stops the framework from globbing up the global namespace. Also should make code-insight work in WebStorm and similar editors. * Large refactoring. Everything now lives inside the Phaser module, so all code and all tests have been updated to reflect this. Makes coding a tiny bit more verbose but stops the framework from globbing up the global namespace. Also should make code-insight work in WebStorm and similar editors.
* Added the new GeomSprite object. This is a sprite that uses a geometry class for display (Circle, Rectangle, Point, Line). It's extremely flexible! * Added the new GeomSprite object. This is a sprite that uses a geometry class for display (Circle, Rectangle, Point, Line). It's extremely flexible!
@ -290,27 +364,27 @@ V0.9
* Added new Motion class which contains lots of handy functions like 'moveTowardsObject', 'velocityFromAngle' and more. * Added new Motion class which contains lots of handy functions like 'moveTowardsObject', 'velocityFromAngle' and more.
* Tween Manager added. You can now create tweens via Game.createTween (or for more control game.tweens). All the usual suspects are here: Bounce, * Elastic, Quintic, etc and it's hooked into the core game clock, so if your game pauses and resumes your tweens adjust accordingly. * Tween Manager added. You can now create tweens via Game.createTween (or for more control game.tweens). All the usual suspects are here: Bounce, * Elastic, Quintic, etc and it's hooked into the core game clock, so if your game pauses and resumes your tweens adjust accordingly.
V0.8 Version 0.8
* Added ability to set Sprite frame by name (sprite.frameName), useful when you've loaded a Texture Atlas with filename values set rather than using frame indexes. * Added ability to set Sprite frame by name (sprite.frameName), useful when you've loaded a Texture Atlas with filename values set rather than using frame indexes.
* Updated texture atlas 4 demo to show this. * Updated texture atlas 4 demo to show this.
* Fixed a bug that would cause a run-time error if you tried to create a sprite using an invalid texture key. * Fixed a bug that would cause a run-time error if you tried to create a sprite using an invalid texture key.
* Added in DynamicTexture support and a test case for it. * Added in DynamicTexture support and a test case for it.
V0.7 Version 0.7
* Renamed FullScreen to StageScaleMode as it's much more fitting. Tested across Android and iOS with the various scale modes. * Renamed FullScreen to StageScaleMode as it's much more fitting. Tested across Android and iOS with the various scale modes.
* Added in world x/y coordinates to the input class, and the ability to get world x/y input coordinates from any Camera. * Added in world x/y coordinates to the input class, and the ability to get world x/y input coordinates from any Camera.
* Added the RandomDataGenerator for seeded random number generation. * Added the RandomDataGenerator for seeded random number generation.
* Setting the game world size now resizes the default camera (optional bool flag) * Setting the game world size now resizes the default camera (optional bool flag)
V0.6 Version 0.6
* Added in Touch support for mobile devices (and desktops that enable it) and populated x/y coords in Input with common values from touch and mouse. * Added in Touch support for mobile devices (and desktops that enable it) and populated x/y coords in Input with common values from touch and mouse.
* Added new Circle geometry class (used by Touch) and moved them into a Geom folder. * Added new Circle geometry class (used by Touch) and moved them into a Geom folder.
* Added in Device class for device inspection. * Added in Device class for device inspection.
* Added FullScreen class to enable full-screen support on mobile devices (scrolls URL bar out of the way on iOS and Android) * Added FullScreen class to enable full-screen support on mobile devices (scrolls URL bar out of the way on iOS and Android)
V0.5 Version 0.5
* Initial release * Initial release

View file

@ -1,9 +1,105 @@
<?php <?php
require('funcs.php'); // Global
// $files = dirToArray(dirname(__FILE__));
$files = dirToArray('../');
$total = 0;
foreach ($files as $key => $value)
{
if (is_array($value) && count($value) > 0)
{
$total += count($value);
}
}
function getFile() {
global $files, $dir, $filename, $title, $code;
if (isset($_GET['d']) && isset($_GET['f']))
{
$dir = urldecode($_GET['d']);
$filename = urldecode($_GET['d']) . '/' . urldecode($_GET['f']);
$title = urldecode($_GET['t']);
if (file_exists($filename))
{
$code = file_get_contents($filename);
$files = dirToArray($dir);
}
}
}
function dirToArray($dir) {
$ignore = array('.', '..', '_site', 'assets', 'states', 'wip', 'games', 'basics');
$result = array();
$root = scandir($dir);
$dirs = array_diff($root, $ignore);
// We want these 2 to appear top of the list
array_unshift($dirs, 'basics', 'games');
foreach ($dirs as $key => $value)
{
if (is_dir($dir . DIRECTORY_SEPARATOR . $value))
{
$result[$value] = dirToArray($dir . DIRECTORY_SEPARATOR . $value);
}
else
{
if (substr($value, -3) == '.js')
{
$result[] = $value;
}
}
}
return $result;
}
function printJSLinks($dir, $files, $target) {
$output = "";
foreach ($files as $key => $value)
{
$value2 = substr($value, 0, -3);
$dir = urlencode($dir);
$file = urlencode($value);
$title = urlencode($value2);
if ($target == 'viewer')
{
$output .= " <a href=\"view_lite.php?d=$dir&amp;f=$file&amp;t=$title\" target=\"viewer\">$value2</a></br>\n";
}
else if ($target == 'json')
{
$output .= " { \"file\": \"$file\", \"title\": \"$value2\" },\n";
}
else
{
$output .= " <li><a href=\"view_full.php?d=$dir&amp;f=$file&amp;t=$title\">$value2</a></li>\n";
}
}
if ($target == 'json')
{
$output = rtrim($output);
$output = substr($output, 0, -1);
$output .= "\n";
}
return $output;
}
?> ?>
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'> <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head> <head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'> <meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>Phaser Examples JSON Build Script</title>
</head> </head>
<body> <body>

View file

@ -34,10 +34,31 @@ ul.nav-links > li > a:hover{text-decoration: underline;}
.phaser-examples{background: url('../../_site/images/phaser-examples.png') no-repeat; display: block; width: 485px; height: 205px; margin: 20px auto;} .phaser-examples{background: url('../../_site/images/phaser-examples.png') no-repeat; display: block; width: 485px; height: 205px; margin: 20px auto;}
.phaser-version{float: right; background: url('../../_site/images/phaser-version.png') no-repeat; display: block; width: 345px; height: 30px; color: #fff; font-size: 11px; text-shadow: 1px 1px #000; right:0; top:0; } .phaser-version{float: right; background: url('../../_site/images/phaser-version.png') no-repeat; display: block; width: 345px; height: 30px; color: #fff; font-size: 11px; text-shadow: 1px 1px #000; right:0; top:0; }
.phaser-version > span{margin-top: 10px; display: inline-block; margin-left: 60px; margin-right: 25px;} .phaser-version > span{margin-top: 10px; display: inline-block; margin-left: 60px; margin-right: 25px;}
.phaser-version > a{color: #fff; text-decoration: none; background: url('../../_site/images/version-button.png') no-repeat; background-size: cover; display: inline-block; width: 123px; height: 10px; vertical-align: middle; text-align: center;padding-top:11px; padding-bottom: 11px} .phaser-version > a {color: #fff; text-decoration: none; background: url('../../_site/images/version-button.png') no-repeat; background-size: cover; display: inline-block; width: 123px; height: 10px; vertical-align: middle; text-align: center;padding-top:11px; padding-bottom: 11px}
.phaser-version > a:hover{text-decoration: underline;} .phaser-version > a:hover{text-decoration: underline;}
.phaser-logo{display: block; float: right; width: 168px;height: 144px; background: url('../../_site/images/phaser-logo.png') no-repeat; margin-top: 40px; margin-right: 40px;} .phaser-logo{display: block; float: right; width: 168px;height: 144px; background: url('../../_site/images/phaser-logo.png') no-repeat; margin-top: 40px; margin-right: 40px;}
#upgrade {
display: none;
}
#welcome {
position: absolute;
top: 260px;
left: 40%;
width: 200px;
line-height: 28px;
}
#welcome p {
text-align: center;
text-shadow: 1px 1px 0 #fff;
}
#welcome a {
color: #7a50c4;
}
.error { margin-left: 48px; width: 700px; background-color: rgb(150,25,25); color:#fff; text-shadow: 1px 1px 0 #000; line-height: 24px } .error { margin-left: 48px; width: 700px; background-color: rgb(150,25,25); color:#fff; text-shadow: 1px 1px 0 #000; line-height: 24px }
.error p { .error p {

View file

@ -1,4 +1,13 @@
{ {
"basics": [
{ "file": "01+-+load+an+image.js", "title": "01 - load an image" }
],
"games": [
{ "file": "breakout.js", "title": "breakout" },
{ "file": "invaders.js", "title": "invaders" },
{ "file": "starstruck.js", "title": "starstruck" },
{ "file": "tanks.js", "title": "tanks" }
],
"animation": [ "animation": [
{ "file": "change+texture+on+click.js", "title": "change texture on click" }, { "file": "change+texture+on+click.js", "title": "change texture on click" },
{ "file": "local+json+object.js", "title": "local json object" }, { "file": "local+json+object.js", "title": "local json object" },
@ -40,12 +49,6 @@
{ "file": "graphics.js", "title": "graphics" }, { "file": "graphics.js", "title": "graphics" },
{ "file": "render+crisp.js", "title": "render crisp" } { "file": "render+crisp.js", "title": "render crisp" }
], ],
"games": [
{ "file": "breakout.js", "title": "breakout" },
{ "file": "invaders.js", "title": "invaders" },
{ "file": "starstruck.js", "title": "starstruck" },
{ "file": "tanks.js", "title": "tanks" }
],
"geometry": [ "geometry": [
{ "file": "circle.js", "title": "circle" }, { "file": "circle.js", "title": "circle" },
{ "file": "line.js", "title": "line" }, { "file": "line.js", "title": "line" },
@ -131,8 +134,8 @@
{ "file": "collide+world+bounds.js", "title": "collide world bounds" }, { "file": "collide+world+bounds.js", "title": "collide world bounds" },
{ "file": "destroy.js", "title": "destroy" }, { "file": "destroy.js", "title": "destroy" },
{ "file": "dynamic+crop.js", "title": "dynamic crop" }, { "file": "dynamic+crop.js", "title": "dynamic crop" },
{ "file": "extending+sprite+object+demo+2.js", "title": "extending sprite object demo 2" }, { "file": "extending+sprite+demo+1.js", "title": "extending sprite demo 1" },
{ "file": "extending+sprite+object.js", "title": "extending sprite object" }, { "file": "extending+sprite+demo+2.js", "title": "extending sprite demo 2" },
{ "file": "horizontal+crop.js", "title": "horizontal crop" }, { "file": "horizontal+crop.js", "title": "horizontal crop" },
{ "file": "move+a+sprite.js", "title": "move a sprite" }, { "file": "move+a+sprite.js", "title": "move a sprite" },
{ "file": "out+of+bounds.js", "title": "out of bounds" }, { "file": "out+of+bounds.js", "title": "out of bounds" },

View file

@ -1,119 +0,0 @@
<?php
require('funcs.php');
?>
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'></script>
<script src='assets/html/application.js' type='text/javascript'></script>
<link href='stylesheet.css' media='screen' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="header">
<div class="box100 no-padding">
<div class="phaser-version">
<span>Phaser Version: 1.1</span>
<!--<a href="#" class="version-button">Update to 1.2</a>-->
</div>
</div>
<div class="clear"></div>
<div class="line">
<div class="box20">
<ul class="nav-links">
<li class="link-home"><a href="http://phaser.io">Phaser Home</a></li>
<li class="link-latest"><a href="https://github.com/photonstorm/phaser">Download Latest</a></li>
<li class="link-forum"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Support Forum</a></li>
<li class="link-docs"><a href="#">Documentation</a></li>
<li class="link-twitter"><a href="https://twitter.com/photonstorm">Twitter</a></li>
</ul>
</div>
<div class="box60 txt-center">
<div class="phaser-examples"></div>
</div>
<div class="box20">
<div class="phaser-logo"></div>
</div>
</div>
</div>
<div class="clear clear25"></div>
<div class="line go-top border-bottom">
<?php
//echo "<h2>Total Tests: $total </h2>";
$i = 0;
foreach ($files as $key => $value)
{
// If $key is an array, output it as an h2 or something
if (is_array($value) && count($value) > 0)
{
if ($i == 1)
{
?>
<div class="clear5"></div>
<div class="line dark-bg">
<?php
}
else if ($i == 2)
{
?>
<div class="clear5"></div>
<div class="line bright-bg">
<?php
}
?>
<div class="box20">
<p class="title strong"><?php echo $key ?></p>
<p class="count-examples strong"><?php echo count($value) ?> examples</p>
</div>
<div class="box80">
<ul class="group-items">
<?php
echo printJSLinks($key, $value, false);
$i++;
if ($i == 3)
{
$i = 1;
}
}
?>
</ul>
</div>
</div>
<?php
}
?>
<div class="clear"></div>
<div id="footer" class="footer">
<div class="main-container centered">
<div class="prize-bg">
<a href="#" class="prize-button">View details &amp; submit</a>
</div>
<div class="line">
<div class="box20">
<a href="http://www.photonstorm.com" class="photonstorm-logo"></a>
&copy; 2013 Photon Storm Ltd.<br/>
All rights reserved.
</div>
<div class="box5">
<div class="flixel-logo"></div>
</div>
<div class="box15">
Looking for a flash game framework?<br/>
<a href="http://flixel.org">Try Flixel</a>
</div>
<div class="box55 float-right">
<ul class="footer-links">
<li><a class="github-icon" href="https://github.com/photonstorm/phaser">Phaser on Github</a></li>
<li><a class="twitter-icon" href="https://twitter.com/photonstorm">@photonstorm</a></li>
<li><a class="forums-icon" href="http://www.html5gamedevs.com/forum/14-phaser/">Phaser Forums</a></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -5,13 +5,19 @@ $(document).ready(function(){
.done(function(data) { .done(function(data) {
var i = 0; var i = 0;
var t = 0;
var len = 0; var len = 0;
var node = ''; var node = '';
var laser = ''; var laser = '';
$.each(data, function(dir, files) $.each(data, function(dir, files)
{ {
len = files.length / 4; len = Math.floor(files.length / 4) + 1;
if ((files.length / 4) % 1 == 0)
{
len--;
}
if (len > 9) if (len > 9)
{ {
@ -19,7 +25,7 @@ $(document).ready(function(){
} }
else else
{ {
laser = 'laser' + (len + 1); laser = 'laser' + len;
} }
if (i == 1) if (i == 1)
@ -38,6 +44,7 @@ $(document).ready(function(){
for (var e = 0; e < files.length; e++) for (var e = 0; e < files.length; e++)
{ {
node += '<li><a href="_site/view_full.html?d=' + dir + '&amp;f=' + files[e].file + '&amp;t=' + files[e].title + '">' + files[e].title + '</a></li>'; node += '<li><a href="_site/view_full.html?d=' + dir + '&amp;f=' + files[e].file + '&amp;t=' + files[e].title + '">' + files[e].title + '</a></li>';
t++;
} }
node += '</ul></div>'; node += '</ul></div>';
@ -53,6 +60,8 @@ $(document).ready(function(){
}); });
$("#total").append(t);
}) })
.fail(function() { .fail(function() {
@ -74,4 +83,16 @@ $(document).ready(function(){
}); });
$.getJSON("http://phaser.io/version.json")
.done(function(data) {
if (data.version !== '1.1')
{
$("#upgrade").append(data.version);
$("#upgrade").css('display', 'inline-block');
}
});
}); });

View file

@ -1,124 +0,0 @@
<?php
require('funcs.php');
?>
<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<style>
@font-face {
font-family: 'inconsolata';
src: url('assets/html/inconsolata.woff') format('woff');
font-weight: normal;
font-style: normal;
}
body {
background: #e0e4f1;
margin: 0px;
font-family: 'inconsolata';
font-size: 15px;
overflow: hidden;
}
a {
text-decoration: none;
color: #1c99bb;
}
a:hover {
background-color: #e69b0b;
color: #fff;
}
h1 {
font-size: 25px;
font-weight: normal;
}
h2 {
font-size: 20px;
font-weight: normal;
}
#header {
background: url(assets/html/lite_header.jpg) no-repeat left top;
width: 300px;
height: 100px;
}
#panel {
background: url(assets/html/lite_header_2.jpg) no-repeat left top;
width: 300px;
height: -webkit-calc(100% - 270px); /* Safari */
height: calc(100% - 270px);
overflow-x: hidden;
overflow-y: scroll;
}
#panel #list {
padding: 10px 20px;
line-height: 18px;
}
#footer {
background: url(assets/html/lite_footer.jpg) no-repeat left top;
width: 300px;
height: 170px;
color: #000;
text-align: center;
}
#viewer {
position: absolute;
top: 0px;
left: 300px;
width: -webkit-calc(100% - 300px); /* Safari */
width: calc(100% - 300px);
height: 100%;
border: 0px;
}
</style>
</head>
<body>
<div id="header"></div>
<div id="panel">
<div id="list">
<?php
foreach ($files as $key => $value)
{
// If $key is an array, output it as an h2 or something
if (is_array($value) && count($value) > 0)
{
echo "<h2>$key</h2>";
echo printJSLinks($key, $value, 'viewer');
}
}
?>
</div>
</div>
<div id="footer">
<p>Total examples: <?php echo $total?></p>
<p>Phaser version: 1.1</p>
<p>Layout borrowed from three.js</p>
</div>
<iframe id="viewer"></iframe>
</body>
</html>

View file

@ -1,123 +0,0 @@
<?php
// All JS files in build order.
// Much easier for debugging re: line numbers
?>
<script src="../src/Intro.js"></script>
<script src="../src/pixi/Pixi.js"></script>
<script src="../src/Phaser.js"></script>
<script src="../src/utils/Utils.js"></script>
<script src="../src/pixi/core/Matrix.js"></script>
<script src="../src/pixi/core/Point.js"></script>
<script src="../src/pixi/core/Rectangle.js"></script>
<script src="../src/pixi/display/DisplayObject.js"></script>
<script src="../src/pixi/display/DisplayObjectContainer.js"></script>
<script src="../src/pixi/display/Sprite.js"></script>
<script src="../src/pixi/display/Stage.js"></script>
<script src="../src/pixi/extras/CustomRenderable.js"></script>
<script src="../src/pixi/extras/Strip.js"></script>
<script src="../src/pixi/extras/Rope.js"></script>
<script src="../src/pixi/extras/TilingSprite.js"></script>
<script src="../src/pixi/filters/FilterBlock.js"></script>
<script src="../src/pixi/filters/MaskFilter.js"></script>
<script src="../src/pixi/primitives/Graphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasGraphics.js"></script>
<script src="../src/pixi/renderers/canvas/CanvasRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLBatch.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLGraphics.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderer.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLRenderGroup.js"></script>
<script src="../src/pixi/renderers/webgl/WebGLShaders.js"></script>
<script src="../src/pixi/text/BitmapText.js"></script>
<script src="../src/pixi/text/Text.js"></script>
<script src="../src/pixi/textures/BaseTexture.js"></script>
<script src="../src/pixi/textures/Texture.js"></script>
<script src="../src/pixi/textures/RenderTexture.js"></script>
<script src="../src/pixi/utils/EventTarget.js"></script>
<script src="../src/pixi/utils/Polyk.js"></script>
<script src="../src/core/Camera.js"></script>
<script src="../src/core/State.js"></script>
<script src="../src/core/StateManager.js"></script>
<script src="../src/core/LinkedList.js"></script>
<script src="../src/core/Signal.js"></script>
<script src="../src/core/SignalBinding.js"></script>
<script src="../src/core/Plugin.js"></script>
<script src="../src/core/PluginManager.js"></script>
<script src="../src/core/Stage.js"></script>
<script src="../src/core/Group.js"></script>
<script src="../src/core/World.js"></script>
<script src="../src/core/Game.js"></script>
<script src="../src/input/Input.js"></script>
<script src="../src/input/Key.js"></script>
<script src="../src/input/Keyboard.js"></script>
<script src="../src/input/Mouse.js"></script>
<script src="../src/input/MSPointer.js"></script>
<script src="../src/input/Pointer.js"></script>
<script src="../src/input/Touch.js"></script>
<script src="../src/input/InputHandler.js"></script>
<script src="../src/gameobjects/Events.js"></script>
<script src="../src/gameobjects/GameObjectFactory.js"></script>
<script src="../src/gameobjects/Sprite.js"></script>
<script src="../src/gameobjects/TileSprite.js"></script>
<script src="../src/gameobjects/Text.js"></script>
<script src="../src/gameobjects/BitmapText.js"></script>
<script src="../src/gameobjects/Button.js"></script>
<script src="../src/gameobjects/Graphics.js"></script>
<script src="../src/gameobjects/RenderTexture.js"></script>
<script src="../src/system/Canvas.js"></script>
<script src="../src/system/StageScaleMode.js"></script>
<script src="../src/system/Device.js"></script>
<script src="../src/system/RequestAnimationFrame.js"></script>
<script src="../src/math/RandomDataGenerator.js"></script>
<script src="../src/math/Math.js"></script>
<script src="../src/math/QuadTree.js"></script>
<script src="../src/geom/Circle.js"></script>
<script src="../src/geom/Point.js"></script>
<script src="../src/geom/Rectangle.js"></script>
<script src="../src/net/Net.js"></script>
<script src="../src/tween/TweenManager.js"></script>
<script src="../src/tween/Tween.js"></script>
<script src="../src/tween/Easing.js"></script>
<script src="../src/time/Time.js"></script>
<script src="../src/animation/AnimationManager.js"></script>
<script src="../src/animation/Animation.js"></script>
<script src="../src/animation/Frame.js"></script>
<script src="../src/animation/FrameData.js"></script>
<script src="../src/animation/AnimationParser.js"></script>
<script src="../src/loader/Cache.js"></script>
<script src="../src/loader/Loader.js"></script>
<script src="../src/loader/LoaderParser.js"></script>
<script src="../src/sound/Sound.js"></script>
<script src="../src/sound/SoundManager.js"></script>
<script src="../src/utils/Debug.js"></script>
<script src="../src/utils/Color.js"></script>
<script src="../src/physics/arcade/ArcadePhysics.js"></script>
<script src="../src/physics/arcade/Body.js"></script>
<script src="../src/particles/Particles.js"></script>
<script src="../src/particles/arcade/ArcadeParticles.js"></script>
<script src="../src/particles/arcade/Emitter.js"></script>
<script src="../src/tilemap/Tile.js"></script>
<script src="../src/tilemap/Tilemap.js"></script>
<script src="../src/tilemap/TilemapLayer.js"></script>
<script src="../src/tilemap/TilemapParser.js"></script>
<script src="../src/tilemap/Tileset.js"></script>
<script src="../src/PixiPatch.js"></script>

View file

@ -1,103 +0,0 @@
<?php
require('funcs.php');
getFile();
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>phaser - <?php echo $title?></title>
<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'></script>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<script src='assets/html/application.js' type='text/javascript'></script>
<link href='stylesheet.css' media='screen' rel='stylesheet' type='text/css'>
<?php
require('phaser-debug-js.php');
?>
<script src="<?php echo $filename?>"></script>
</head>
<body>
<div class="header">
<div class="box100 no-padding">
<div class="phaser-version">
<span>Phaser Version: 1.1</span>
<!--<a href="#" class="version-button">Update to 1.2</a>-->
</div>
</div>
<div class="clear"></div>
<div class="line">
<div class="box20">
<ul class="nav-links">
<li class="link-home"><a href="index.php">Back to examples</a></li>
</ul>
</div>
<div class="box60 txt-center">
<span class="main-title"><?php echo ucwords($title)?></span>
</div>
<div class="box20">
<div class="phaser-logo"></div>
</div>
</div>
<div class="game-panel centered">
<div id="phaser-example"></div>
<div class="game-controls">
<ul class="left-controls">
<li class="controls-label"></li>
<li class="up-label"></li>
<li class="down-label"></li>
<li class="left-label"></li>
<li class="right-label"></li>
<li class="space-label"></li>
</ul>
<ul class="right-controls">
<li class="pause-button"></li>
<li class="mute-button"></li>
<li class="reset-button"></li>
</ul>
</div>
</div>
</div>
<div class="clear filler"></div>
<p class="centered px800">Source code:</p>
<pre class="code-block prettyprint centered">
<?php
echo $code;
?>
</pre>
</div>
<div class="clear"></div>
<div id="footer" class="footer">
<div class="main-container centered">
<div class="prize-bg">
<a href="#" class="prize-button">View details &amp; submit</a>
</div>
<div class="line">
<div class="box20">
<a href="http://www.photonstorm.com" class="photonstorm-logo"></a>
&copy; 2013 Photon Storm Ltd.<br/>
All rights reserved.
</div>
<div class="box5">
<div class="flixel-logo"></div>
</div>
<div class="box15">
Looking for a flash game framework?<br/>
<a href="http://flixel.org">Try Flixel</a>
</div>
<div class="box55 float-right">
<ul class="footer-links">
<li><a class="github-icon" href="https://github.com/photonstorm/phaser">Phaser on Github</a></li>
<li><a class="twitter-icon" href="https://twitter.com/photonstorm">@photonstorm</a></li>
<li><a class="forums-icon" href="http://www.html5gamedevs.com/forum/14-phaser/">Phaser Forums</a></li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>

View file

@ -1,28 +0,0 @@
<?php
require('funcs.php');
getFile();
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>phaser - <?php echo $title?></title>
<?php
require('phaser-debug-js.php');
?>
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<script src="<?php echo $filename?>"></script>
</head>
<body>
<div id="phaser-example"></div>
<pre class="prettyprint">
<?php
echo $code;
?>
</pre>
</body>
</html>

View file

@ -1,27 +0,0 @@
<?php
require('funcs.php');
getFile();
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title><?php echo $title?></title>
<?php
require('phaser-debug-js.php');
?>
<script src="<?php echo $filename?>"></script>
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="phaser-example"></div>
</body>
</html>

View file

@ -0,0 +1,22 @@
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create });
function preload() {
// You can fill the preloader with as many assets as your game requires
// Here we are loading an image. The first parameter is the unique
// string by which we'll identify the image later in our code.
// The second parameter is the URL of the image (relative)
game.load.image('einstein', 'assets/pics/ra_einstein.png');
}
function create() {
// This creates a simple sprite that is using our loaded image and
// displays it on-screen
game.add.sprite(0, 0, 'einstein');
}

View file

@ -2,6 +2,7 @@
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Phaser Examples</title>
<link href="_site/css/phaser-examples.css" media="screen" rel="stylesheet" type="text/css"> <link href="_site/css/phaser-examples.css" media="screen" rel="stylesheet" type="text/css">
<script src="_site/js/jquery-2.0.3.min.js" type="text/javascript"></script> <script src="_site/js/jquery-2.0.3.min.js" type="text/javascript"></script>
<script src="_site/js/phaser-examples.js" type="text/javascript"></script> <script src="_site/js/phaser-examples.js" type="text/javascript"></script>
@ -12,7 +13,7 @@
<div class="box100 no-padding"> <div class="box100 no-padding">
<div class="phaser-version"> <div class="phaser-version">
<span>Phaser Version: 1.1</span> <span>Phaser Version: 1.1</span>
<a href="https://github.com/photonstorm/phaser/tree/dev" class="version-button">1.2 dev branch</a> <a id="upgrade" href="https://github.com/photonstorm/phaser" class="version-button">New version: </a>
</div> </div>
</div> </div>
@ -23,7 +24,7 @@
<li class="link-home"><a href="http://phaser.io">Phaser Home</a></li> <li class="link-home"><a href="http://phaser.io">Phaser Home</a></li>
<li class="link-latest"><a href="https://github.com/photonstorm/phaser">Download Latest</a></li> <li class="link-latest"><a href="https://github.com/photonstorm/phaser">Download Latest</a></li>
<li class="link-forum"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Support Forum</a></li> <li class="link-forum"><a href="http://www.html5gamedevs.com/forum/14-phaser/">Support Forum</a></li>
<li class="link-docs"><a href="#">Documentation</a></li> <li class="link-docs"><a href="../docs/out/">Documentation</a></li>
<li class="link-twitter"><a href="https://twitter.com/photonstorm">Twitter</a></li> <li class="link-twitter"><a href="https://twitter.com/photonstorm">Twitter</a></li>
</ul> </ul>
</div> </div>
@ -37,7 +38,13 @@
</div> </div>
<div class="clear clear25"></div> <div class="clear clear25"></div>
<p>Some stuff here</p> <div id="welcome">
<p>Total Examples: <span id="total"></span></p>
<p><a href="sideview.html">Switch to Side-View mode</a></p>
</div>
<div id="examples-list" class="line go-top border-bottom"></div> <div id="examples-list" class="line go-top border-bottom"></div>

29
examples/wip/fiddle.js Normal file
View file

@ -0,0 +1,29 @@
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: create });
function preload() {
game.load.image('ball', 'assets/sprites/yellow_ball.png');
}
var ball;
function create() {
ball = game.add.sprite(300, 0, 'ball');
startBounceTween();
}
function startBounceTween() {
ball.y = 0;
var bounce=game.add.tween(ball);
bounce.to({ y: game.world.height-ball.height }, 1000 + Math.random() * 3000, Phaser.Easing.Bounce.In);
bounce.onComplete.add(startBounceTween, this);
bounce.start();
}

View file

@ -55,40 +55,55 @@
return $result; return $result;
} }
function printJSLinks($dir, $files, $target) { function printJSLinks($dir, $files) {
$output = ""; $output = "";
foreach ($files as $key => $value) foreach ($files as $key => $value)
{ {
$value2 = substr($value, 0, -3); $value2 = substr($value, 0, -3);
$dir = urlencode($dir);
$file = urlencode($value); $file = urlencode($value);
$title = urlencode($value2);
if ($target == 'viewer') $output .= "<a href=\"wip/index.php?f=$file\">$value2</a><br />";
{
$output .= " <a href=\"view_lite.php?d=$dir&amp;f=$file&amp;t=$title\" target=\"viewer\">$value2</a></br>\n";
}
else if ($target == 'json')
{
$output .= " { \"file\": \"$file\", \"title\": \"$value2\" },\n";
}
else
{
$output .= " <li><a href=\"view_full.php?d=$dir&amp;f=$file&amp;t=$title\">$value2</a></li>\n";
}
}
if ($target == 'json')
{
$output = rtrim($output);
$output = substr($output, 0, -1);
$output .= "\n";
} }
return $output; return $output;
} }
?>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>phaser</title>
<base href="../"></base>
<?php
require('../../build/config.php');
?> if (isset($_GET['f']))
{
$f = $_GET['f'];
?>
<script src="wip/<?php echo $f?>" type="text/javascript"></script>
<?php
}
?>
<style>
body {
font-family: Arial;
font-size: 14px;
}
</style>
</head>
<body>
<div id="phaser-example"></div>
<h2>work in progress examples</h2>
<?php
echo printJSLinks('wip', $files);
?>
</body>
</html>