-
Notifications
You must be signed in to change notification settings - Fork 27
Project
A FUDGE project consist of multiple files of different categories. External resources are prerecorded sounds, images, scripts and so on. Internal Resources are defined in json-files describing Nodes, Components, Graphs, textures, shaders, animations and the like, some of which point to external resources via the filename. Additionally, the FUDGE runtime libraries may be copied to the project in order for it not to become outdated or to run without an internet connection.
At the center of a project there is an HTML-file which ties together the internal resources and the scripts to be used. It also provides for a canvas to render to. In the project folder, there may be more than one of these files representing different setups. The FUDGE editor generates this file on creation of a new project and updates parts of it. However, manual changes can and should be done. A small script gets linked which sets up the graph selected, renders it and adds a simple interactive camera as used in the editor itself. This script can be used as a reference for creators to get started with coding. You may also extend the HTML-file to create virtual user interfaces, since those are usually based on HTML.
The HTML-file may be opened in the FUDGE editor, serving the resources to the creator to wire up the game, or in the browser serving the game to the user for fun. So there is no separate runtime file needed!
The editor also sets up a structure for coding consisting of a folder "Script" with the folders "Source" and "Build" and templates files within them. In Source, a configuration file for the typescript compiler is included. Running the compiler in this folder will create proper output to the Build-folder which is already linked to in the HTML file. Thus, creators can start coding right away.
The class Project
manages the resources. For the internal resources, it loads files in json-format, parses them into simple javascript objects, deserializes those to FUDGE-objects and stores them. While doing so, it also loads the external resources referenced by these internal resources. An exception are the creators scripts, since they also need to be compiled, thus need to be loaded directly.