scene-compiler.rst 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. .. include:: ../_header.rst
  2. The scene compiler
  3. ------------------
  4. .. toctree::
  5. scene-compiler-executing-compiler
  6. scene-compiler-user-code
  7. scene-compiler-general-settings
  8. scene-compiler-scene-settings
  9. Traditionally, a game engine has its file format to create scenes and part of its API is focused on the integration with a scene editor.
  10. Phaser_ is not a traditional game engine, it is a framework, and is not attached to any particular tool. To create a Phaser_ game you only need a simple text editor.
  11. Of course, Phaser_ provides API to interact with some widely used, third-party formats like texture atlas, tilemap, bitmap fonts, etc... But there is not a complete scene format where all the elements could be integrated.
  12. For the |SceneEditor|_, we use a custom scene-file format, but instead of creating a custom library to parse and create the Phaser_ scenes on the fly, we created a compiler.
  13. The |SceneCompiler|_ takes as input the custom scene files (based on JSON) and generates well-written Phaser_ code. In other words, the |SceneCompiler|_ writes the Phaser_ code for you.
  14. This has some advantages:
  15. * Your game doesn't need to load an extra, third-party library.
  16. * You have full comprehension of how the scene objects are created.
  17. * A modern JavaScript editor can process the scene code and integrates it with the content assist tools.
  18. * You can customize certain aspects of the generated code and/or insert your code.