update api documentation index and sort
This commit is contained in:
@@ -7,7 +7,6 @@ nav:
|
|||||||
- input.md
|
- input.md
|
||||||
- exporting.md
|
- exporting.md
|
||||||
- dull.md
|
- dull.md
|
||||||
- prosperon.md
|
|
||||||
- ...
|
- ...
|
||||||
- api
|
- Appendix B - api: api
|
||||||
|
|
||||||
5
docs/api/index.md
Normal file
5
docs/api/index.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Appendix B - api
|
||||||
|
|
||||||
|
This is a complete list of accessible functions and parameters that are built into Prosperon. For the most part, developers will concern themselves with the modules, all of which can be imported with `use`.
|
||||||
|
|
||||||
|
Types document particular javascript objects with a specific object in their prototype chain, which can allow access to an underlying C data structure. A lot of these are used only internally by Prosperon, but brave developers can pick around in the module internals to see how they're used and do their own thing if they want!
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
# The Dull Programming Language: Extensions to Javascript
|
# Appendix A - The Dull Programming Language: Extensions to Javascript
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
The language is dubbed "dull". Dull, because it is a less featureful Javascript. Where does it differ?
|
The language is dubbed "dull". Dull, because it is a less featureful Javascript. Where does it differ?
|
||||||
|
|
||||||
|
|||||||
BIN
docs/dull.png
Normal file
BIN
docs/dull.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 219 KiB |
@@ -2,12 +2,10 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Prosperon is based around a Javascript-like language, named "dull", engineered to be the quickest way to make computer games.
|
Prosperon is based around a Javascript-like language, DullJS, termed henceforth "dull", engineered to be the quickest way to make computer games. "Dull" will be explored in more detail, but for all intents and purposes it **is** Javascript, with a handful of ES6 features removed. We've given it its own name to crush from the outset any idea that what you're dealing with a web styled Javascript environment!
|
||||||
|
|
||||||
## The Vision
|
## The Vision
|
||||||
The less lines of code it takes to do something, the less your program does. The less your program does, the faster it is, and the fewer bugs it has.
|
The less lines of code it takes to do something, the less your program does. The less your program does, the faster it is, and the fewer bugs it has. Prosperon is designed to achieve a minimal number of lines of code when creating a game. Prosperon is designed to be the **best** way to make computer games, quickly.
|
||||||
|
|
||||||
Prosperon is designed to achieve a minimal number of lines of code when creating a game. How does it do so?
|
|
||||||
|
|
||||||
1. **Duck typing**
|
1. **Duck typing**
|
||||||
A lot of the API usage is informed from 'duck typing'. If something "looks" like a camera - it can be used like one! If something "looks" like a sprite, it can be used like one! This means that if you create an enemy in the game, you may be able to pass it in to render, while in other more strict languages, you might need to create an intermediate "sprite" object.
|
A lot of the API usage is informed from 'duck typing'. If something "looks" like a camera - it can be used like one! If something "looks" like a sprite, it can be used like one! This means that if you create an enemy in the game, you may be able to pass it in to render, while in other more strict languages, you might need to create an intermediate "sprite" object.
|
||||||
@@ -18,13 +16,12 @@ However, there are fast paths on nearly everything for well defined objects. For
|
|||||||
3. **Uniformity**
|
3. **Uniformity**
|
||||||
Uniformity is prioritized. Javascript allows for a powerful abstraction - the object - which Prosperon makes much use of. It allows for another - the arraybuffer - which makes it simple to plug different parts of the engine into each other.
|
Uniformity is prioritized. Javascript allows for a powerful abstraction - the object - which Prosperon makes much use of. It allows for another - the arraybuffer - which makes it simple to plug different parts of the engine into each other.
|
||||||
|
|
||||||
!!! scholium
|
|
||||||
The object is the lingua franca of the API. For example, json.encode and json.decode converts objects to and from json strings; nota.encode and nota.decode converts objects to and from nota bytes, represented as a javascript arraybuffer. To convert a json string to a nota buffer, one would do:
|
|
||||||
```nota.encode(json.decode(str))```
|
|
||||||
|
|
||||||
4. **AI**
|
4. **AI**
|
||||||
Prosperon is packed with tools to make it easy to work with AI. AI is an incredible productivity boost for programming, but it has a difficult time dealing with game engines like Unity and Unreal. Prosperon can, for example, generate an overview of your game, which you can plug into an AI for context so it will have an easy time helping with what you're stuck on.
|
Prosperon is packed with tools to make it easy to work with AI. AI is an incredible productivity boost for programming, but it has a difficult time dealing with game engines like Unity and Unreal. Prosperon can, for example, generate an overview of your game, which you can plug into an AI for context so it will have an easy time helping with what you're stuck on.
|
||||||
|
|
||||||
|
5. **Interactive**
|
||||||
|
Whenever there is a question of feature, Prosperon chooses the interactive path. Games are interactive. That means you want it to be totally dynamic and fast. Prosperon is designed to favor, for example, generated MIDI music, which you might be able to sync to goblin death animations, over static MP3 files.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Just grab the prosperon build for your platform, drop it in a folder, and run it. Prosperon is a tiny executable - usually less than 2MB - so it's recommended to version it with your project.
|
Just grab the prosperon build for your platform, drop it in a folder, and run it. Prosperon is a tiny executable - usually less than 2MB - so it's recommended to version it with your project.
|
||||||
|
|||||||
@@ -59,4 +59,9 @@ this.delay(_ => {
|
|||||||
**delay** is a function on all actors in prosperon. It executes a given function after a number of seconds. In this case, after 3 seconds, the root actor kills itself, closing the window.
|
**delay** is a function on all actors in prosperon. It executes a given function after a number of seconds. In this case, after 3 seconds, the root actor kills itself, closing the window.
|
||||||
|
|
||||||
## The prosperon global
|
## The prosperon global
|
||||||
There is a single global object defined for you, game wide, called `prosperon`. prosperon has a variety of engine specific settings on it that can be set to influence how the engine behaves. For example, `prosperon.argv` contains a list of the command line arguments given to prosperon; `prosperon.PATH` is an array of paths to resolve resources such as modules and images.
|
The global object called `prosperon` has a variety of engine specific settings on it that can be set to influence how the engine behaves. For example, `prosperon.argv` contains a list of the command line arguments given to prosperon; `prosperon.PATH` is an array of paths to resolve resources such as modules and images. `prosperon` is fully documented in the API section.
|
||||||
|
|
||||||
|
## Getting help
|
||||||
|
The `prosperon` global has a 'doc' function, which can be invoked on any engine object to see a description of it and its members. For example, to learn about `prosperon`, try printing out `prosperon.doc(prosperon)` in your `main.js`.
|
||||||
|
|
||||||
|
Writing documentation for your own modules and game components will be explored in the chapter on actors & modules.
|
||||||
BIN
docs/wizard.png
BIN
docs/wizard.png
Binary file not shown.
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 379 KiB |
Reference in New Issue
Block a user