Difference between revisions of "Lovetoys"

(Example source updated)
(Updated link to Richard Lords intro to ECS)
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{#set:Name=Lovetoys}}
+
'''Lovetoys''' is an Entity Component System framework for game development with lua. Originally written for the LÖVE 2D game engine it is now compatible with pretty much any game that uses lua! It is loosely based on [https://www.richardlord.net/blog/ecs/what-is-an-entity-framework.html Richard Lords Introduction] to ECS's. If you don't have any idea what this entity component stuff is all about, click that link and give it a read! It's totally worth it!
{{#set:LOVE Version=0.8.0}}
 
{{#set:Description= A neat Entity Component System for Lua and some nice manager for collisions and events}}
 
  
'''Lovetoys''' is a small bundle of helper classes and libraries consisting of 3 packages. <br/>
+
Lovetoys is a full-featured game development framework, not only providing the core parts like Entity, Component and System classes but also containing a Publish-Subscribe messaging system as well as a Scene Graph, enabling you to build even complex games easily and in a structured way.
The most important one is the Entity Component System which is based on [http://www.richardlord.net/blog/what-is-an-entity-framework Richard Lords Introduction] to ECS's. <br/>
 
If you don't have any idea what this entity component stuff is all about, click that link and give it a read! It's totally worth it!
 
  
A simple example for implementation:
+
Though we have not reached version 1.0 yet, the software is tested, used in multiple games and definitely stable. If you find any bugs please create an issue and report them. Or just create a pull request :).
  
<source lang="lua">
+
Grab it on [https://github.com/Lovetoys/lovetoys Github] and give it a try!
require(lovetoys/engine)
 
  
function love.load()
+
If you want to see a proper way of implementation and some examples, have a look at our [https://github.com/Lovetoys/examples Example-project] or our [https://github.com/Lovetoys/Lovetoys-games Games].
 
 
    -- Creation of a new world
 
    love.physics.setMeter(64)
 
    world = love.physics.newWorld(0, 9.81*80, true)
 
    -- Enabling the collision functions
 
    world:setCallbacks(beginContact, endContact)
 
 
 
    love.graphics.setMode(1000, 600, false, true, 0)
 
 
 
    -- A new instance of an engine is beeing created
 
    engine = Engine()
 
    -- A new instance of an eventmanager is beeing created
 
    eventmanager = EventManager()
 
    -- A new instance of a collisionmanager is beeing created
 
    collisionmanager = CollisionManager()
 
 
 
    -- The collisionmanager is beeing registered as a listener for the
 
    -- "BeginContact" event.
 
    eventmanager:addListener("BeginContact", {collisionmanager, collisionmanager.fireEvent})
 
 
 
    -- Logic (update) systems are beeing added to the engine
 
    engine:addSystem(ExampleSystem(), "logic", 1)
 
 
 
    -- Drawing systems are beeing added to the engine
 
    engine:addSystem(ExampleDrawSystem(), "draw")
 
end
 
 
 
 
 
function love.update(dt)
 
    -- Engine update function
 
    engine:update(dt)
 
end
 
 
 
function love.draw()
 
    -- Engine draw function
 
    engine:draw()
 
end
 
--Collision function
 
function beginContact(a, b, coll)
 
    -- Dynamic creation of a new instance of BeginContact and firing it to the Eventmanager
 
    stack:current().eventmanager:fireEvent(BeginContact(a, b, coll))
 
end
 
 
 
</source>
 
<br/>
 
<br/>
 
Grab it or give it a look on [https://github.com/Nukesor/lua-lovetoys Github].
 
 
 
If you want to see a proper way of implementation or some nice examples for events and collisions, have a look at our [https://github.com/Nukesor/lua-lovetoys/tree/master/example Example-project] or our [https://github.com/raffomania/MAVE Game].
 
  
  
 +
{{#set:Name=ECS Lovetoys}}
 +
{{#set:LOVE Version=Any}}
 +
{{#set:Description= It's a full-featured Entity-Component-System framework for making games with LUA. The original and only.}}
 +
{{#set:Keyword=ECS}}
 
[[Category:Libraries]]
 
[[Category:Libraries]]
 +
== Other Languages ==
 +
{{i18n|Lovetoys}}

Latest revision as of 17:10, 30 November 2022

Lovetoys is an Entity Component System framework for game development with lua. Originally written for the LÖVE 2D game engine it is now compatible with pretty much any game that uses lua! It is loosely based on Richard Lords Introduction to ECS's. If you don't have any idea what this entity component stuff is all about, click that link and give it a read! It's totally worth it!

Lovetoys is a full-featured game development framework, not only providing the core parts like Entity, Component and System classes but also containing a Publish-Subscribe messaging system as well as a Scene Graph, enabling you to build even complex games easily and in a structured way.

Though we have not reached version 1.0 yet, the software is tested, used in multiple games and definitely stable. If you find any bugs please create an issue and report them. Or just create a pull request :).

Grab it on Github and give it a try!

If you want to see a proper way of implementation and some examples, have a look at our Example-project or our Games.

Other Languages