Jump to content

how to debug with the "complete version" of Phaser and not the "min" one


pat
 Share

Recommended Posts

hello all,

 

I download phaser from Github and I am looking the tutorial in

phaser/tutorials/02 Making your first game/part9.html

 

In this html file, I have the line

<script type="text/javascript" src="js/phaser.min.js"></script>

So I am using the min version of Phaser in

phaser/tutorials/02 Making your first game/js/phaser.min.js

 

It works well, but I want to use complete version of Phaser.

I want to trace the program and understand it.

How I can do that ??

 

Thanks a lot and happy new year

 

Link to comment
Share on other sites

You could just change phaser.min.js for phaser.js - however for proper debugging I would use the approach we take in the Examples suite. Have a look in the _site folder in the html files, you'll see we include ALL of the phaser source files in order. This makes for extremely easy line-number / file specific debugging.

Link to comment
Share on other sites

From the github zip file, copy the phaser-master/build/phaser.js file in the same folder where phaser.min.js is located on your web server(here js/)

Then, change your script tag in your html code to :

<script type="text/javascript" src="js/phaser.js"></script>

it should work

Link to comment
Share on other sites

Thanks a lot,

 

 

So you can have 3 versions of the code

 

A) original one with

<script type="text/javascript" src="js/phaser.min.js"></script>

B) you copy phaser.js from phaser/build/phaser.js into phaser/tutorials/02 Making your first game/js/

and you change

<script type="text/javascript" src="js/phaser.min.js"></script>

to

<script type="text/javascript" src="js/phaser.js"></script>

C) the best one

You could just change phaser.min.js for phaser.js - however for proper debugging I would use the approach we take in the Examples suite. Have a look in the _site folder in the html files, you'll see we include ALL of the phaser source files in order. This makes for extremely easy line-number / file specific debugging.

you remove

<script type="text/javascript" src="js/phaser.min.js"></script>

or

<script type="text/javascript" src="js/phaser.js"></script>

and you put

 
 <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/core/Polygon.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/AbstractFilter.js"></script>    <script src="../../src/pixi/filters/FilterBlock.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/PixiShader.js"></script>    <script src="../../src/pixi/renderers/webgl/PrimitiveShader.js"></script>    <script src="../../src/pixi/renderers/webgl/StripShader.js"></script>    <script src="../../src/pixi/renderers/webgl/WebGLBatch.js"></script>    <script src="../../src/pixi/renderers/webgl/WebGLFilterManager.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/Filter.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/Gamepad.js"></script>    <script src="../../src/input/SinglePad.js"></script>    <script src="../../src/input/GamepadButton.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/BitmapData.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/time/Timer.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>
Link to comment
Share on other sites

Nice summary pat :) All I would say is that if you pick option C be sure to update this list each time we publish a new release of Phaser, because we sometimes add new source files or rename or remove old ones. You'll see this in 1.1.4 for example next week.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...