Change adoc to markdown.
This commit is contained in:
parent
82f26f0d8c
commit
521566c5b9
|
@ -1,89 +1,92 @@
|
|||
= Yugine Editor
|
||||
# Yugine Editor
|
||||
|
||||
The main editor view is made up of objects. Each object can have a
|
||||
number of components attached to it. When an object is selected, its
|
||||
name, position, and list of components are listed.
|
||||
|
||||
.Basic controls
|
||||
* Ctrl-Z Undo
|
||||
* Ctrl-Shift-Z Redo
|
||||
* Ctrl-A Select all
|
||||
* Ctrl-S Save
|
||||
* Ctrl-N New
|
||||
* Ctrl-O Open level
|
||||
* Ctrl-X Cut
|
||||
* Ctrl-C Copy
|
||||
* Ctrl-V Paste
|
||||
* Alt-O Add level to current level
|
||||
* Alt-A or Alt-P Add a prefab
|
||||
* Ctrl-I Objects on the level
|
||||
* Ctrl-E Asset viewer. When on a component like a sprite, serves to select that sprite's texture
|
||||
* Ctrl-[ Downsize grid
|
||||
* Ctrl-] Upsize grid
|
||||
* Backtick REPL
|
||||
* Ctrl-[1-9] to set camera positions
|
||||
* [1-9] to recall camera positions
|
||||
* 0 Set camera to home view
|
||||
* ESC quit
|
||||
* Alt-1 Normal view
|
||||
* Alt-2 Wireframe view
|
||||
* Shift-Middle Set editor cursor to mouse position (Cursor affects how objects rotate)
|
||||
* Shift-Ctrl-Middle Set cursor to object selection
|
||||
* Shift-Right Remove cursor
|
||||
## Basic controls
|
||||
|Ctrl-Z|Undo|
|
||||
|Ctrl-Shift-Z|Redo|
|
||||
|Ctrl-A|Select all|
|
||||
|Ctrl-S|Save|
|
||||
|Ctrl-N|New|
|
||||
|Ctrl-O|Open level|
|
||||
|Ctrl-X|Cut|
|
||||
|Ctrl-C|Copy|
|
||||
|Ctrl-V|Paste|
|
||||
|Alt-O|Add level to current level|
|
||||
|Alt-A|or Alt-P Add a prefab|
|
||||
|Ctrl-I|Objects on the level|
|
||||
|Ctrl-E|Asset viewer. When on a component like a sprite, serves to select that sprite's texture|
|
||||
|Ctrl-[|Downsize grid|
|
||||
|Ctrl-]|Upsize grid|
|
||||
|Backtick|REPL|
|
||||
|Ctrl-[1-9]|to set camera positions|
|
||||
|[1-9]|to recall camera positions|
|
||||
|0|Set camera to home view|
|
||||
|ESC|quit|
|
||||
|Alt-1|Normal view|
|
||||
|Alt-2|Wireframe view|
|
||||
|Shift-Middle|Set editor cursor to mouse position (Cursor affects how objects rotate)|
|
||||
|Shift-Ctrl-Middle|Set cursor to object selection|
|
||||
|Shift-Right|Remove cursor|
|
||||
|
||||
.Editor Mode select
|
||||
* Alt-F1 Basic mode
|
||||
* Alt-F2 Brush mode
|
||||
## Editor Mode select
|
||||
|
||||
|Alt-F1|Basic mode|
|
||||
|Alt-F2|Brush mode|
|
||||
- Clicking will place what is on clipboard
|
||||
|
||||
.Object controls
|
||||
* G Translate
|
||||
* Alt-G Snap objects to cursor
|
||||
* S Scale
|
||||
* R Rotate
|
||||
* Ctrl-P Save object changes to prefab
|
||||
* Ctrl-shift-P Save object changes as a unique prefab ("Parent")
|
||||
* Ctrl-shift-T Save object changes to a side prefab ("Type")
|
||||
* Ctrl-J Bake name to expose to level script
|
||||
* Alt-J Remove baked name
|
||||
* Ctrl-Y Show obj chain
|
||||
* Alt-Y Start prototype explorer
|
||||
* Ctrl-U Revert object or component to match prototype
|
||||
* Alt-U Make object unique. If a level, allows setting of internal object position and rotation.
|
||||
* Ctrl-shift-G Save group as a level
|
||||
* Arrows Translate 1 px
|
||||
* Shift-Arrows Translate 10 px
|
||||
* Tab Select component
|
||||
* F Zoom to object(s)
|
||||
* Ctrl-F Focus on a selected sublevel. Edit and save it in place.
|
||||
* Ctrl-Shift-F Go up one level in the editing chain.
|
||||
* M Flip horizontally
|
||||
* Ctrl-M Flip vertically
|
||||
* Ctrl-D Duplicate
|
||||
* H Hide
|
||||
* Ctrl-H Unhide all
|
||||
* T Lock
|
||||
* Alt-T Unlock all
|
||||
* Q Toggle component help
|
||||
* Ctrl-Shift-Alt-Click Set object center
|
||||
## Object controls
|
||||
|
||||
.Mouse controls
|
||||
* Left Select
|
||||
* Middle Quick grab
|
||||
* Right Unselect
|
||||
|G|Translate|
|
||||
|Alt-G|Snap objects to cursor|
|
||||
|S|Scale|
|
||||
|R|Rotate|
|
||||
|Ctrl-P|Save object changes to prefab|
|
||||
|Ctrl-shift-P|Save object changes as a unique prefab ("Parent")|
|
||||
|Ctrl-shift-T|Save object changes to a side prefab ("Type")|
|
||||
|Ctrl-J|Bake name to expose to level script|
|
||||
|Alt-J|Remove baked name|
|
||||
|Ctrl-Y|Show obj chain|
|
||||
|Alt-Y|Start prototype explorer|
|
||||
|Ctrl-U|Revert object or component to match prototype|
|
||||
|Alt-U|Make object unique. If a level, allows setting of internal object position and rotation.|
|
||||
|Ctrl-shift-G|Save group as a level|
|
||||
|Arrows|Translate 1 px|
|
||||
|Shift-Arrows|Translate 10 px|
|
||||
|Tab|Select component|
|
||||
|F|Zoom to object(s)|
|
||||
|Ctrl-F|Focus on a selected sublevel. Edit and save it in place.|
|
||||
|Ctrl-Shift-F|Go up one level in the editing chain.|
|
||||
|M|Flip horizontally|
|
||||
|Ctrl-M|Flip vertically|
|
||||
|Ctrl-D|Duplicate|
|
||||
|H|Hide|
|
||||
|Ctrl-H|Unhide all|
|
||||
|T|Lock|
|
||||
|Alt-T|Unlock all|
|
||||
|Q|Toggle component help|
|
||||
|Ctrl-Shift-Alt-Click|Set object center|
|
||||
|
||||
.Level controls
|
||||
* Ctrl-L Open level script
|
||||
## Mouse controls
|
||||
|
||||
.Game controls
|
||||
* F1 Debug draw
|
||||
* F2 Config menu
|
||||
* F3 Show bounding boxes
|
||||
* F4 Show gizmos
|
||||
* F5 Start
|
||||
* F6 Pause
|
||||
* F7 Stop
|
||||
* F10 Toggle slow motion
|
||||
|Left|Select|
|
||||
|Middle|Quick grab|
|
||||
|Right|Unselect|
|
||||
|
||||
## Level controls
|
||||
|Ctrl-L|Open level script|
|
||||
|
||||
## Game controls
|
||||
|F1|Debug draw|
|
||||
|F2|Config menu|
|
||||
|F3|Show bounding boxes|
|
||||
|F4|Show gizmos|
|
||||
|F5|Start|
|
||||
|F6|Pause|
|
||||
|F7|Stop|
|
||||
|F10|Toggle slow motion|
|
||||
|
||||
== Components
|
||||
Components all have their own set of controls. Many act similar to
|
||||
|
@ -93,19 +96,19 @@ expected to object grabbing; same with scaling, rotation, and so on.
|
|||
If a component uses an asset, the asset viewer will serve to pick new
|
||||
assets for it.
|
||||
|
||||
.Spline controls
|
||||
* Ctrl-click Add a point
|
||||
* Shift-click remove a point
|
||||
* +,- Increase or decrease spline segments
|
||||
* Ctrl-+,- Increase or decrease spline degrees. Put this to 1 for the spline to go point to point
|
||||
* Alt-B,V Increase or decrease spline thickness
|
||||
## Spline controls
|
||||
|Ctrl-click|Add a point|
|
||||
|Shift-click|remove a point|
|
||||
|+,-|Increase or decrease spline segments|
|
||||
|Ctrl-+,-|Increase or decrease spline degrees. Put this to 1 for the spline to go point to point|
|
||||
|Alt-B,V|Increase or decrease spline thickness|
|
||||
|
||||
.Collider controls
|
||||
* Alt-S Toggle sensor
|
||||
|Alt-S|Toggle sensor|
|
||||
|
||||
== Yugine Programming
|
||||
## Yugine Programming
|
||||
|
||||
.Object functions
|
||||
### Object functions
|
||||
|
||||
* start(): Called when the object is created, before the first update is ran
|
||||
* update(dt): Called once per frame
|
||||
|
@ -116,7 +119,7 @@ assets for it.
|
|||
- hit.velocity: Velocity of impact
|
||||
- hit.normal: Normal of impact
|
||||
|
||||
.Colliders
|
||||
### Colliders
|
||||
Colliders visually look different based on their status. Objects can
|
||||
be in one of three states
|
||||
|
||||
|
@ -132,7 +135,7 @@ do not let objects through.
|
|||
|
||||
|
||||
|
||||
.Input
|
||||
### Input
|
||||
Input works by adding functions to an object, and then "controlling"
|
||||
them. The format for a function is "input_[key]_[action]". [Action]
|
||||
can be any of
|
||||
|
@ -144,7 +147,7 @@ can be any of
|
|||
For example, "input_p_pressed()" will be called when p is pressed, and not again
|
||||
until it is released and pressed again.
|
||||
|
||||
.Your game
|
||||
### Your game
|
||||
|
||||
When the engine runs, it executes config.js, and then game.js. A
|
||||
window should be created in config.js, and custom code for prototypes
|
||||
|
@ -152,7 +155,7 @@ should be executed.
|
|||
|
||||
game.js is the place to open your first level.
|
||||
|
||||
.Levels
|
||||
### Levels
|
||||
|
||||
A level is a collection of objects. A level has a script associated
|
||||
with it. The script is ran when the level is loaded.
|
186
docs/game.md
186
docs/game.md
|
@ -1,4 +1,4 @@
|
|||
= Yugine
|
||||
# Yugine
|
||||
|
||||
The yugine essentially is made of a sequence of levels. Levels can be
|
||||
nested, they can be streamed in, or loaded one at a time. Levels are
|
||||
|
@ -10,29 +10,26 @@ loading functions call the script file, as well as the level file. The
|
|||
level file can be considered to be a container of objects that the
|
||||
associated script file can access.
|
||||
|
||||
.Game start
|
||||
* Game start
|
||||
1. Engine scripts
|
||||
2. config.js
|
||||
3. game.lvl & game.js
|
||||
|
||||
* Engine scripts
|
||||
* config.js
|
||||
* game.lvl & game.js
|
||||
* Editor
|
||||
1. Engine scripts
|
||||
2. config.js
|
||||
3. editor.js
|
||||
|
||||
.Editor
|
||||
|
||||
* Engine scripts
|
||||
* config.js
|
||||
* editor.js
|
||||
|
||||
.Editor play
|
||||
|
||||
* F5 debug.lvl
|
||||
** Used for custom debug level testing. If doesn't exist, game.lvl is loaded.
|
||||
* Editor play
|
||||
* F5 debug.lvl. Used for custom debug level testing. If doesn't exist, game.lvl is loaded.
|
||||
* F6 game.lvl
|
||||
* F7 Currently edited level
|
||||
|
||||
While playing ...
|
||||
|
||||
* F7 Stop
|
||||
|
||||
== Level model
|
||||
## Level model
|
||||
The game world is made up of objects. Levels are collections of
|
||||
objects. The topmost level is called "World". Objects are spawned into
|
||||
a specific level. If none are explicitly given, objects are spawned
|
||||
|
@ -43,110 +40,99 @@ World.level1.enemy1.sprite.path = "brick.png";
|
|||
|
||||
To set the image of enemy1 in level 1's sprite.
|
||||
|
||||
.Level functions
|
||||
,===
|
||||
name, description
|
||||
### Level functions
|
||||
|name| description|
|
||||
|---|---|
|
||||
|levels| a list of all levels loaded in this one|
|
||||
|objects| a list of all objects belonging to this level (objects + levels)|
|
||||
|object_count| objects.length()|
|
||||
|spawn(type)| creates an object from the supplied type in the level|
|
||||
|create()| creates an empty level inside of this one|
|
||||
|loadfile(file)| loads file as a level inside of this one; returns it. Mainly for editor|
|
||||
|loadlevel(file)| loads file as a level and does running required for gameplay|
|
||||
|load(level_json)| clears this level and spawns all objects specified in the level_json|
|
||||
|clear()| kills all objects in this level|
|
||||
|kill()| cleans up the level and kills it|
|
||||
|
||||
levels, a list of all levels loaded in this one
|
||||
objects, a list of all objects belonging to this level (objects + levels)
|
||||
object_count, objects.length()
|
||||
spawn(type), creates an object from the supplied type in the level
|
||||
create(), creates an empty level inside of this one
|
||||
loadfile(file), loads file as a level inside of this one; returns it. Mainly for editor
|
||||
loadlevel(file), loads file as a level and does running required for gameplay
|
||||
load(level_json), clears this level and spawns all objects specified in the level_json
|
||||
clear(), kills all objects in this level
|
||||
kill(), cleans up the level and kills it
|
||||
|
||||
,===
|
||||
|
||||
.Objects
|
||||
## Objects
|
||||
Objects are things that exist in the game world.
|
||||
|
||||
,===
|
||||
name, description
|
||||
level, the level this object belongs to
|
||||
pos, the global position
|
||||
relpos, the position relative to its level
|
||||
angle, the global angle
|
||||
relangle, angle relative to its level
|
||||
velocity, velocity of the object
|
||||
angularvelocity, angular velocity of the object
|
||||
alive, true if the object is valid
|
||||
varname, the variable name of the object (used for friendly naming)
|
||||
friction, physics attribnute
|
||||
elasticity, physics attribute
|
||||
flipx, true if the object is flipped on its x axis
|
||||
flipy, true if the object is mirrored on its y axis
|
||||
body, the internal gameobject id of the object
|
||||
controlled, true if the object is controlled by something
|
||||
phys, set to dynamic; kinematic; or static; explained below
|
||||
moi, the moment of inertia of the object
|
||||
mass, mass of the object
|
||||
visible, true if the object is visible. Set to false to disable all visible features belonging to it
|
||||
in_air(), true if the object is not on the ground
|
||||
on_ground(), !in_air()
|
||||
layer, collision layer for the physics engine
|
||||
draw_layer, draw order. higher numbers draw on top of lower ones
|
||||
scale, change to make the object larger or smaller
|
||||
from, the object this object was created from
|
||||
boundingbox, the boundingbox of this object in world dimensions
|
||||
push(vec), push this object each frame with vec velocity
|
||||
width, the boundingbox defined width
|
||||
height, the boundingbox defined height
|
||||
kill, destroy the object
|
||||
stop, ???
|
||||
world2this(pos), return the pos in world coordinates to relative this object
|
||||
this2world(pos), return the pos in this coordinates relative to the world
|
||||
make(props, level), instantiate an object based on this, with additional props, in level
|
||||
,===
|
||||
|name| description|
|
||||
|---|---|
|
||||
|level| the level this object belongs to
|
||||
|pos| the global position|
|
||||
|relpos| the position relative to its level
|
||||
angle| the global angle|
|
||||
|relangle| angle relative to its level|
|
||||
|velocity| velocity of the object|
|
||||
|angularvelocity| angular velocity of the object|
|
||||
|alive| true if the object is valid|
|
||||
|varname| the variable name of the object (used for friendly naming)|
|
||||
|friction| physics attribnute|
|
||||
|elasticity| physics attribute|
|
||||
|flipx| true if the object is flipped on its x axis|
|
||||
|flipy| true if the object is mirrored on its y axis|
|
||||
|body| the internal gameobject id of the object|
|
||||
|controlled| true if the object is controlled by something|
|
||||
|phys| set to dynamic; kinematic; or static; explained below|
|
||||
|moi| the moment of inertia of the object|
|
||||
|mass| mass of the object|
|
||||
|visible| true if the object is visible. Set to false to disable all visible features belonging to it|
|
||||
|in_air()| true if the object is not on the ground|
|
||||
|on_ground()| !in_air()|
|
||||
|layer| collision layer for the physics engine|
|
||||
|draw_layer| draw order. higher numbers draw on top of lower ones|
|
||||
|scale| change to make the object larger or smaller|
|
||||
|from| the object this object was created from|
|
||||
|boundingbox| the boundingbox of this object in world dimensions|
|
||||
|push(vec)| push this object each frame with vec velocity|
|
||||
|width| the boundingbox defined width|
|
||||
|height| the boundingbox defined height|
|
||||
|kill| destroy the object|
|
||||
|stop| ???|
|
||||
|world2this(pos)| return the pos in world coordinates to relative this object|
|
||||
|this2world(pos)| return the pos in this coordinates relative to the world|
|
||||
|make(props, level)| instantiate an object based on this, with additional props, in level|
|
||||
|
||||
.Editor related object features
|
||||
,===
|
||||
gizmo, path to an image to draw in editor mode
|
||||
,===
|
||||
## Editor related object features
|
||||
|
||||
.Functions for object control
|
||||
,===
|
||||
clone(name; ext), create a copy of this object and extend it with ext; does not spawn
|
||||
instadup(), create an exact duplicate of this object in the World
|
||||
revert(), remove everything that makes the object unique; make it exactly like what it was spawned from
|
||||
,===
|
||||
|gizmo| path to an image to draw in editor mode|
|
||||
|
||||
.Physics
|
||||
## Functions for object control
|
||||
|
||||
|clone(name; ext)| create a copy of this object and extend it with ext; does not spawn|
|
||||
|instadup()| create an exact duplicate of this object in the World|
|
||||
|revert()| remove everything that makes the object unique; make it exactly like what it was spawned from|
|
||||
|
||||
## Physics
|
||||
All objects belong to the physics engine, but may be totally ignored by it.
|
||||
|
||||
,===
|
||||
static, does not and will not move
|
||||
dynamic, moves under the auspices of the physics engine
|
||||
kinematic, moves under the auspices of the player or other control mechanism
|
||||
,===
|
||||
|static| does not and will not move|
|
||||
|dynamic| moves under the auspices of the physics engine|
|
||||
|kinematic| moves under the auspices of the player or other control mechanism|
|
||||
|
||||
Physics properties work as such
|
||||
,===
|
||||
mass, affects how much a given force will move an object
|
||||
elasticity, affects momentum loss on collisions; multiplicative between two objects for each collision; 1 for no loss; 0 for total stoppage; >1 for a chaotic increasing entropy simulation
|
||||
friction, affects momentum loss when rubbing against another surface; multiplicative between the two objects
|
||||
,===
|
||||
|
||||
.Textures & images
|
||||
|mass| affects how much a given force will move an object|
|
||||
|elasticity| affects momentum loss on collisions; multiplicative between two objects for each collision; 1 for no loss; 0 for total stoppage; >1 for a chaotic increasing entropy simulation|
|
||||
|friction| affects momentum loss when rubbing against another surface; multiplicative between the two objects|
|
||||
|
||||
## Textures & images
|
||||
A sprite is a display of a specific texture in the game world. The
|
||||
underlying texture has values associated with it, like how it should
|
||||
be rendered: is it a sprite, is it a texture, does it have mipmaps,
|
||||
etc. Textures are all file based, and are only accessed through the
|
||||
explicit path to their associated image file.
|
||||
|
||||
.Finding & Addressing Objects
|
||||
## Finding & Addressing Objects
|
||||
|
||||
|
||||
.Editor & Debugging
|
||||
## Editor & Debugging
|
||||
Although intertwined, debugging functions and the editor are separate entities.
|
||||
|
||||
..Debugging
|
||||
### Debugging
|
||||
Debugging functions are mapped to the F buttons, and are always available during gameplay in a debug build. Pressing the F button toggles the feature; pressing it with ALT shows a legend for that feature; pressing it with CTRL shows additional info
|
||||
|
||||
,===
|
||||
F1, Draw physics info
|
||||
F3, Draw bounding boxes
|
||||
F12, Drawing gui debugging info
|
||||
,===
|
||||
|F1| Draw physics info|
|
||||
|F3| Draw bounding boxes|
|
||||
|F12| Drawing gui debugging info|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
.Yugine video playing
|
||||
# Yugine video playing
|
||||
|
||||
Yugine plays the open source MPEG-TS muxer, using MPEG1 video and MP2 audio.
|
||||
|
Loading…
Reference in a new issue