diff --git a/docs/index.md b/docs/index.md index 25e4e6be..55d3c2d5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,66 @@ -Prosperon is built in a code-first fashion. Games in it are written with javascript, mostly up to, but not including, ES6. The nicest way to use it is to heavily abuse inherited properties and closures. +Prosperon is an opinionated Javascript-based runtime for making games, quickly. It is NOT web compatible, and doesn't intend to be. It uses a hefty dosing of ideas from the Misty language, to make an easy and intuitive way to make virtual worlds. -It provides a very high level way of rendering, which it translates to a variety of backends. \ No newline at end of file +With Javascript's C-like syntax, it makes it easy to make classic style games like Pacman or Fantasy Zone, without diving into Unity, Godot or Unreal Engine. + +# Gradual performance +Prosperon makes it easy to make something quickly, and if it runs well, you're golden! But if it's slow, there are a plethora of options to make it faster. Plus, with native C plugins, there is nothing that can't be figured out. + +# API +~~prosperon master +Here are the modules that can be included via 'use'. + +// global syntax level things + + +// core +prosperon +input +json +layout +resources +sound +std +time +search +color +tween +util +io +os + +// rendering +draw2d +render +graphics + +// game components +emitter +sprite +transform + +// math +pmath +vector +geometry + + +~~prosperon dev +convert +debug +diff +nogame +parseq +path +physics +gizmos +log +stats +stdprofile +stdtest +test +textedit +editor +yaml +spline +profile +sim \ No newline at end of file diff --git a/scripts/debug.js b/scripts/debug.js index 75bada3a..dcd97aaa 100644 --- a/scripts/debug.js +++ b/scripts/debug.js @@ -252,5 +252,7 @@ debug.break_var = function(obj,vars) }); } +debug.doc = Symbol() + return debug diff --git a/scripts/doc.js b/scripts/doc.js new file mode 100644 index 00000000..75c52f6f --- /dev/null +++ b/scripts/doc.js @@ -0,0 +1,3 @@ +var ret = {} +ret.sym = Symbol() +return ret diff --git a/scripts/engine.js b/scripts/engine.js index 3a715f27..ba83cfc9 100644 --- a/scripts/engine.js +++ b/scripts/engine.js @@ -497,5 +497,6 @@ var search = use('search') actor[UNDERLINGS] = new Set() + globalThis.mixin("color"); globalThis.mixin("std") diff --git a/scripts/sound.js b/scripts/sound.js index 47204275..d8d2a49a 100644 --- a/scripts/sound.js +++ b/scripts/sound.js @@ -3,9 +3,13 @@ var tween = use('tween') var io = use('io') var res = use('resources') +var doc = use('doc') + soloud.init(); var audio = {}; +audio[doc.sym] = `Audio docs.` + var pcms = {}; audio.pcm = function pcm(file) @@ -23,6 +27,7 @@ audio.play = function play(file) { if (!pcm) return; return soloud.play(pcm); }; +audio.play[doc.sym] = `Given a file path, plays a sound. Returns a sound object.` audio.cry = function cry(file) { var voice = audio.play(file); @@ -32,6 +37,8 @@ audio.cry = function cry(file) { voice = undefined; } }; +audio.cry[doc.sym] = +`Given a file path, plays a sound. Invoke the returned object to stop it.` var song; @@ -65,5 +72,6 @@ audio.music = function music(file, fade = 0.5) { song = temp; song.loop = true; }; +audio.music[doc.sym] = `Play the given music file, with an optional cross fade. The song will loop. When this is invoked again, the previous music is replaced.` return audio;