lQuery 1.0 alpha

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

lQuery 1.0 alpha

Post by RPG »

lQuery - a framework for writing games on the LOVE engine. I think many people have heard about it, but until that time lQuery often changed and reconstructed. Finally, it is time to release. Of course, this is not the final version, not even a beta, but globally in lQuery nothing will change. The framework has been tested in several games and is quite suitable for use. Until now, I do not have full documentation in English, but in the archive a lot of examples that are intuitive.

Brief description
Entities
lQuery - framework, which manages entities. Entity - any logically or physically object in the game: mouse, sprite, player, timer, menu and so on. All entities are merged into a tree: each entity has parent and some entities have childs. Parent of all entities - logical entity named "screen".
Graphically, this can be represented as follows:
Image
Such a structure makes it easy to quickly switch contexts in your game: objects can hide and show, all child elements will also hide. From our example (image above), if you hide entity "board", then all players also disappear. Hidden entities doesn't display and doesn't handle events.
Events
lQuery has its own event system, similar to JavaScript's events. Forget about love.update, love.draw and so on, just write game logic.
lQuery supports these events:
- click - fires when player clicks on entity
- mouseover - fires when player moves mouse over entity
- mouseout - fires when mouse leaves entity
- mousepress - fires when mouse button is pressed
- mouserelease - fires when mouse button is released
- mousewheel - fires when mouse wheel rotates over entity
- mousemove - fires when mouse moves over entity. Unlike mouseover, this event fires every frame, until mouse leaves entity, and mouseover fires only one time
- keypress - fires when keyboard key pressed
- keyrelease - fires when key released
- keyrepeat - similar to keypressed, but this event repeats frequently while key is pressed
- update - event, that fires when any parameter of entity is changed (for example, when changed "x" coordinate)
Example:

Code: Select all

player:click(function(x,y,button)
--do something here
end)
Animations
This is the key feature of lQuery: you can create smooth transitions for any numberic parameter of entity. lQuery provides very powerful, extensible animation system. Example:

Code: Select all

player:animate({x = 500, y = 300}, {speed = 0.7, queue = "move"})
:animate({r = 255, g = 255, b = 0, a = 127}, 
{queue = "color", speed = 1, easing = "linear", callback = function() print('Animation done!') end})
Helper functions
new
set
move
scale
size
radius
rotate
color
hide
show
toggle
append
animate
delay
stop
bound
draw
draggable
lQuery.addhook
lQuery.fx
Objects
Useful objects with pre-defined boundary functions.
circle
image
border_image
point
Platform-independent
lQuery may works not only with LOVE, but with any LUA engine (for example, Scrupp)

DOWNLOAD lQuery:
https://github.com/downloads/scriptum/l ... pha.tar.gz
In this archive you'll find many examples.

Repository:
https://github.com/scriptum/lQuery

Documentation:
http://lquery.scriptumplus.ru/
Last edited by RPG on Thu Dec 29, 2011 8:51 pm, edited 3 times in total.
User avatar
Trappingnoobs
Citizen
Posts: 95
Joined: Tue Oct 12, 2010 8:52 pm

Re: lQuery 1.0 alpha

Post by Trappingnoobs »

RPG wrote:- mousemove - fairs when mouse moves over entity. Unlike mouseover, this event fairs every frame, until mouse leaves entity, and mouseover fairs only one time
I think you should change it to every time it moves, rather than constantly.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: lQuery 1.0 alpha

Post by RPG »

Can you explain this? I'm not very good in English.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: lQuery 1.0 alpha

Post by thelinx »

I think he wants mousemove to only fire if the mouse has moved since the last frame.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: lQuery 1.0 alpha

Post by RPG »

Okay, I'll think about it.
User avatar
appleide
Party member
Posts: 323
Joined: Fri Jun 27, 2008 2:50 pm

Re: lQuery 1.0 alpha

Post by appleide »

Code: Select all

fairs->fires
:ehem:
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: lQuery 1.0 alpha

Post by Robin »

What is a "boad"?
Help us help you: attach a .love.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: lQuery 1.0 alpha

Post by RPG »

misprints were fixed.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: lQuery 1.0 alpha

Post by Robin »

Still, what is meant by "board"? Keyboard?
Help us help you: attach a .love.
User avatar
RPG
Party member
Posts: 157
Joined: Wed Mar 02, 2011 5:02 am
Location: Russia
Contact:

Re: lQuery 1.0 alpha

Post by RPG »

Robin wrote:Still, what is meant by "board"? Keyboard?
Imagine chess board or monopoly board:)
Post Reply

Who is online

Users browsing this forum: No registered users and 184 guests