Project Templates
When creating a new project, you can choose from several starter templates. Templates are stored in the foundation/.projectTemplates directory. Please not that you cannot simply copy / paste templates from this directory as they are incomplete. To use a template, you pass its name as an argument to the create project script:
node script/createProject MyProject templateName
Benchmark Template
The benchmark project is an easy way to test foundation's performance on your systems. When the project is launched, use the f12 key to open chrome developer tools. In the console, you'll see output letting you know how many Nodeheads are on screen. You can also activate Chrome's FPS meter from here. To add more Nodeheads to the screen (25 at a time), simply click anywhere in the game window. The table below shows some sample numbers for reference:
| Platform | Target Type | Foundation | Processor | RAM | Graphics | Nodeheads @ 60fps |
|---|---|---|---|---|---|---|
| Windows 10 | Desktop (NW.js) | 0.7.1 | Core i3 4030u 1.9Ghz | 4GB | Intel | Approx. 2,700 |
| Windows 10 | Browser (Chrome) | 0.7.1 | Core i3 4030u 1.9Ghz | 4GB | Intel | Approx. 2,700 |
| Windows 10 | Desktop (NW.js) | 0.7.1 | Core i7 6700HQ 2.6Ghz | 16GB | Geforce 960m | Approx. 4,800 |
| Windows 10 | Browser (Chrome) | 0.7.1 | Core i7 6700HQ 2.6Ghz | 16GB | Geforce 960m | Approx. 4,800 |
| Android 5.1.1 | Mobile (Cordova) | 0.8.0 | Quad-core 1.2 GHz Cortex-A7 | 1GB | Adreno 305 | Approx. 200 |
The Nodehead graphic being drawn on screen is a Tile (the simpler and more lightweight of 2 drawable types). The 4 versions (color variations) are contained in one texture and each tile is 50x50px.
To create a new project from the benchmark template, open a terminal / console in the foundation/tools directory and run:
node scripts/createProject MyProject benchmark
Particles Template
The particles project demonstrates use of Foundation's simple particle generator in various configurations. Three examples are shown on screen and all particle systems are using the same texture (a while circle). Open up the project's game.ts file to see how each generator is configured.
To create a new project from the particles template, open a terminal / console in the foundation/tools directory and run:
node scripts/createProject MyProject particles
Default Project
The default project template is used if no template is specified when creating a new project. The set-up here is fairly simple: There's a game loop running to show a grey background. Exciting!s
To create a new project from the default template, open a terminal / console in the foundation/tools directory and run:
node scripts/createProject MyProject