Showcase your libraries, tools and other projects that help your fellow love users.
Kuromeku
Party member
Posts: 166 Joined: Sun Jul 20, 2008 5:45 pm
Post
by Kuromeku » Sat Sep 06, 2008 4:47 am
So I'm going to be adding some useful little libraries here, free to use obviously. Please keep checking this page because I will add more libraries to it and then eventually compile it into one big library (kudoLib).
Name: Timer Library.
Version: 1.01.
Download: http://kudomiku.com/projects/love/kudol ... _timer.lua .
Functions:
Code: Select all
kudolib.timer:new(delay, repeats, callback);
kudolib.timer.class:run();
kudolib.timer.class:pause();
kudolib.timer.class:reset();
Example:
Code: Select all
myScore = 0;
myTimer = kudolib.timer:new(5, 0, function()
myScore = myScore + 1;
-- Check to see if we've reached the maximum score.
if (myScore == 10) then myTimer:pause(); end;
end);
Instructions:
Call the following function in LÖVE's update callback.
Name: Vector Library.
Version: 1.0.
Download: http://kudomiku.com/projects/love/kudol ... vector.lua .
Functions:
Code: Select all
kudolib.vector:new(x, y);
kudolib.vector.class:length();
kudolib.vector.class:dotProduct(vector);
kudolib.vector.class:distance(vector);
kudolib.vector.class:angle();
kudolib.vector.class:rotateAround(vector, angle);
kudolib.vector.class:normalize();
kudolib.vector.class.__add(a, b);
kudolib.vector.class.__unm(a);
kudolib.vector.class.__sub(a, b);
kudolib.vector.class.__mul(a, b);
kudolib.vector.class.__div(a, b);
kudolib.vector.class.__eq(a, b);
kudolib.vector.class.__tostring(a);
Example:
Code: Select all
myVector1 = kudolib.vector:new(512, 512);
myVector2 = kudolib.vector:new(128, 128);
-- Add the vectors together and normalise the result.
myVector3 = (myVector1 + myVector 2):normalize();
-- Print the new normalised vector.
print(myVector3);
Last edited by
Kuromeku on Wed Sep 10, 2008 7:38 am, edited 2 times in total.
SnakeFace
Prole
Posts: 28 Joined: Tue Aug 19, 2008 2:45 pm
Post
by SnakeFace » Sat Sep 06, 2008 6:04 am
Do you mind if I make my own games libraries based off of the timer one?
Lovely quotes
somewhere within the jungle of administrative doom - rude
Kuromeku
Party member
Posts: 166 Joined: Sun Jul 20, 2008 5:45 pm
Post
by Kuromeku » Sat Sep 06, 2008 6:22 am
What do you mean? I only want my name credited somewhere that's all.
-- Based off kudoLib.
or
-- Thanks to kudoLib and Kudomiku.
or some shit.
And I just updated the timer library. I forgot something so now it should work.
rude
Administrator
Posts: 1052 Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway
Post
by rude » Sun Sep 07, 2008 11:40 pm
^-^)/ Nice! What kind of libraries do you plan to make?
Kuromeku
Party member
Posts: 166 Joined: Sun Jul 20, 2008 5:45 pm
Post
by Kuromeku » Mon Sep 08, 2008 4:45 am
Whatever anybody wants really, or what I deem useful!
Any ideas Rude?
conman420
Prole
Posts: 33 Joined: Sun Aug 31, 2008 8:46 pm
Post
by conman420 » Mon Sep 08, 2008 5:13 pm
A vector library?
Like getting angles between 2 points etc.
I know it can be done without a library but it would be nice to have for convenience.
Kuromeku
Party member
Posts: 166 Joined: Sun Jul 20, 2008 5:45 pm
Post
by Kuromeku » Wed Sep 10, 2008 7:31 am
Basic Vector library added. Will add more advanced functions later.
Nexion
Prole
Posts: 46 Joined: Fri Sep 05, 2008 1:40 pm
Post
by Nexion » Wed Sep 10, 2008 1:48 pm
Where do we add the libraries in, and I can't remember the Lua line to include a file.
Kaze
Party member
Posts: 189 Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland
Post
by Kaze » Wed Sep 10, 2008 3:42 pm
Nexion wrote: Where do we add the libraries in, and I can't remember the Lua line to include a file.
Put the libraries in your game folder/zip.
love.filesystem.include is the function to include a file. love.filesystem.include("kudolib_timer.lua") etc
SnakeFace
Prole
Posts: 28 Joined: Tue Aug 19, 2008 2:45 pm
Post
by SnakeFace » Wed Sep 17, 2008 7:36 pm
An extensive rounding library would be nice.
Lovely quotes
somewhere within the jungle of administrative doom - rude
Users browsing this forum: No registered users and 1 guest