Search found 478 matches

by Azhukar
Wed Oct 18, 2017 12:23 am
Forum: Support and Development
Topic: BUMP collision help
Replies: 1
Views: 1637

Re: BUMP collision help

There's a detailed explanation on how to do this exact thing on the projects github page https://github.com/kikito/bump.lua#moving-an-item-in-the-world-with-collision-resolution It's a function you pass to world:move, the function arguments are the 2 colliding entities. In the example filter you pos...
by Azhukar
Wed Oct 18, 2017 12:08 am
Forum: Libraries and Tools
Topic: toboolean function
Replies: 22
Views: 15806

Re: a small (and robust) toboolean function

Code: Select all

boolean = not not myvariable
by Azhukar
Wed Oct 18, 2017 12:06 am
Forum: General
Topic: How to separate concerns?
Replies: 7
Views: 5127

Re: How to separate concerns?

It's also a keyword. See the manual: https://www.lua.org/manual/5.1/manual.html#2.1 The following keywords are reserved and cannot be used as names: and break do else elseif end false for function if in local nil not or repeat return then true until while 'require' is not a reserved keyword.
by Azhukar
Mon Oct 16, 2017 1:08 pm
Forum: Support and Development
Topic: Lighters pause in midpoints
Replies: 10
Views: 8750

Re: Lighters pause in midpoints

I've changed the indentation to make your file more readable. It seems the code you posted does not behave as you describe, you probably posted a different version. I recommend you read a guide on how to properly format your code to be readable and maintainable. Here's a start http://lua-users.org/w...
by Azhukar
Sat Oct 14, 2017 11:47 pm
Forum: General
Topic: logic to an rpg character speaking speech?
Replies: 5
Views: 3856

Re: logic to an rpg character speaking speech?

Here's a string dripping function: local function dripText(text,charactersPerSecond,startTime) local currentTime = love.timer.getTime() if (currentTime <= startTime) then return "" end return text:sub(1,math.min(math.floor((currentTime-startTime)*charactersPerSecond),text:len())) end local...
by Azhukar
Sat Oct 14, 2017 10:20 am
Forum: General
Topic: logic to an rpg character speaking speech?
Replies: 5
Views: 3856

Re: logic to an rpg character speaking speech?

Here's a shaky text function: local function shakyText(updatesPerSecond,maxDistance,repeats,opacity,text,x,y,...) love.graphics.print(text,x,y,...) local r,g,b,a = love.graphics.getColor() love.graphics.setColor(r,g,b,a*opacity) love.math.setRandomSeed(math.floor(love.timer.getTime()*updatesPerSecon...
by Azhukar
Thu Mar 16, 2017 7:31 pm
Forum: Libraries and Tools
Topic: Simple image atlas maker for SpriteBatch
Replies: 5
Views: 4402

Re: Simple image atlas maker for SpriteBatch

Any reason why the attached example image has quads that don't have at least a 1px padding? The padding is the same color as the border pixels of the actual image, which is the whole point of the padding - to prevent or rather hide bleeding when scaled/rotated. Since the example is just single colo...
by Azhukar
Thu Mar 16, 2017 5:56 pm
Forum: Libraries and Tools
Topic: Simple image atlas maker for SpriteBatch
Replies: 5
Views: 4402

Re: Simple image atlas maker for SpriteBatch

Does it use any kind of sorting algorithm to maximize space usage on the atlas? If so what approach did you use? It sorts all images as rectangles from largest surface area to smallest and adds them to the atlas in that order always next to an already added rectangle. The first free rectangle side ...
by Azhukar
Thu Mar 16, 2017 2:45 pm
Forum: Libraries and Tools
Topic: Simple image atlas maker for SpriteBatch
Replies: 5
Views: 4402

Simple image atlas maker for SpriteBatch

Pass it a table with imageData, it will return a table with quads corresponding do the imagaData received and an image of the atlas to use in SpriteBatches. The table keys used in the quads table will be identical to those used in the passed imageData table. Images are automatically padded to preven...
by Azhukar
Tue Mar 14, 2017 2:13 am
Forum: Support and Development
Topic: Flash when drawing arc
Replies: 2
Views: 1952

Re: Flash when drawing arc

Code: Select all

love.graphics.arc("line","open", v.body:getX(), v.body:getY(), v.shape:getRadius() + 2, 0, v.arcSize )