A GML based framework built on top of Löve2d
This is basically a love2d abstraction based on the game maker architecture and definitions.
This project requires only Löve2d to run locally:
Löve2D: Go to Löve2d website and follow the instructions for your OS
The project setup is really simple. First of all add core
folder into your project, and in your main.lua
file import it:
-- main.lua
require('core.LGML')({
entry = 'path.to.game.entity',
debug = true
})
In the example above we are passing the option entry
. entry
is the path to your LGML.Game
entity that will contain all you game definition.
See the documentation for more informationa about LGML.Game
and other LGML entities.
Property | Type | Descriptions | Support |
---|---|---|---|
General variables | |||
id | Integer | Instance id on current room | :heavy_check_mark: |
solid | Boolean | Add solid behavior on collision | :heavy_check_mark: |
visible | Boolean | Run draw event from instance | :heavy_check_mark: |
persistent | Boolean | Persist instance attributes on current room | :x: |
depth | Integer | Instance draw depth | :heavy_check_mark: |
alarm | Array | Set of event alarms | :heavy_check_mark: |
object_index | Integer | Index of the instance object | :heavy_check_mark: |
X and Y | |||
x | Float | the x position of the instance | :heavy_check_mark: |
y | Float | the y position of the instance | :heavy_check_mark: |
xprevious | Float | previous x position of the instance | :heavy_check_mark: |
yprevious | Float | previous y position of the instance | :heavy_check_mark: |
xstart | Float | initial x position of the instance | :heavy_check_mark: |
ystart | Float | initial y position of the instance | :heavy_check_mark: |
Sprite variables | |||
sprite_index | Sprite Instance | Sprite to be rendered on object instance | :heavy_check_mark: |
sprite_width | Float | Current sprite_index width | :heavy_check_mark: |
sprite_height | Float | Current sprite_index height | :heavy_check_mark: |
sprite_xoffset | Float | Current sprite_index offset on x axis | :heavy_check_mark: |
sprite_yoffset | Float | Current sprite_index offset on y axis | :heavy_check_mark: |
image_alpha | Float | Current sprite_index opacity | :heavy_check_mark: |
image_angle | Float | Current sprite_index angle | :heavy_check_mark: |
image_blend | undefined | Current sprite_index blend effect | :x: |
image_index | Integer | Current sprite_index frame index | :x: |
image_number | Integer | Current sprite_index number of frames | :x: |
image_speed | Float | Current sprite_index animation velocity | :x: |
image_xscale | Float | Current sprite_index scale on x axis | :heavy_check_mark: |
image_yscale | Float | Current sprite_index scale on y axis | :heavy_check_mark: |
Mask variables | |||
mask_index | undefined | Current mask of the object instance | :x: |
bbox_bottom | undefined | TODO | :x: |
bbox_left | undefined | TODO | :x: |
bbox_right | undefined | TODO | :x: |
bbox_top | undefined | TODO | :x: |
Movement variables | |||
direction | Float | Direction of the object applied on speed | :heavy_check_mark: |
speed | Float | speed of the object towards direction | :heavy_check_mark: |
gravity_direction | Float | Direction of the object applied on gravity | :heavy_check_mark: |
gravity | Float | speed of the object towards gravity_direction | :heavy_check_mark: |
friction | Float | friction applied to hspeed and vspeed of a instance | :heavy_check_mark: (partial) |
hspeed | Float | horizontal speed of the instance | :heavy_check_mark: |
vspeed | Float | vertical speed of the instance | :heavy_check_mark: |
The MIT License (MIT)
Copyright (c) 2020 William Lima
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.