Search found 16 matches
- Fri Aug 24, 2012 7:18 am
- Forum: Support and Development
- Topic: Lua associative arrays
- Replies: 2
- Views: 2475
Lua associative arrays
I have this code. local colors = { red = { r = 255,g = 0,b = 0 }, green = { r = 0,g = 128,b = 0 }, blue = { r = 0,g = 0,b = 255}, } Why can't I access this using indices? Am I doing something wrong? colors[1].r I could access it through indices using this declaration local colors = { { r = 255,g = 0...
- Fri Aug 24, 2012 6:41 am
- Forum: Support and Development
- Topic: Move object every X seconds
- Replies: 7
- Views: 5117
Re: Move object every X seconds
Hmm.. Well, I don't know what the code behind Rectangle:new() But, actually, if this is supposed to return a new rectangle each frame, then that's too bad , cause it'll end up eating memory quickly. Create this rectangle once, then act on his parameters to update it. Unless the point of your game i...
- Tue Aug 21, 2012 7:51 am
- Forum: Support and Development
- Topic: Move object every X seconds
- Replies: 7
- Views: 5117
Re: Move object every X seconds
Thanks. This is what I came up with. local currentSquare timeRemaining = 0.0 TimePerSquare = 0.75 function love.update(dt) if timeRemaining == 0.0 then currentSquare = Rectangle:new(math.random(0, love.graphics.getWidth() - 25),math.random(0,love.graphics.getHeight()-25),25,25) timeRemaining = TimeP...
- Tue Aug 21, 2012 4:09 am
- Forum: Support and Development
- Topic: Move object every X seconds
- Replies: 7
- Views: 5117
Move object every X seconds
function love.update(dt) -- Move currentSquare every X seconds currentSquare = Rectangle:new(math.random(0, love.graphics.getWidth() - 25),math.random(0,love.graphics.getHeight()-25),25,25) end I don't know how often an update is called every second. On XNA it is called 60 times per second. I want ...
- Mon Aug 20, 2012 7:02 pm
- Forum: General
- Topic: Love 2D Windows IDE - W.I.P
- Replies: 24
- Views: 17035
Re: Love 2D Windows IDE - W.I.P
Helloir, The program has been made from existing component fctb for c#, for realtime syntax highlighting(without bug or lag). Intellisense and another functions has been made from scratch and in collaboration with some help of c# community. If you would open-source this project or maybe place it in...
- Tue Aug 14, 2012 11:32 am
- Forum: Libraries and Tools
- Topic: Physics Editor - What do you think about?
- Replies: 4
- Views: 4431
Re: Physics Editor - What do you think about?
Hi Schbaltz,
I saw your video on youtube and commented there before I saw this post. Really awesome tool, perhaps you could put it in a repository.
I saw your video on youtube and commented there before I saw this post. Really awesome tool, perhaps you could put it in a repository.
- Mon Aug 13, 2012 6:21 pm
- Forum: Support and Development
- Topic: Attaching multiple shapes to fixture and setting an image
- Replies: 10
- Views: 7048
Re: Attaching multiple shapes to fixture and setting an imag
Thanks Boolsheet . I have updated my exporter template which generates these polygons. Now I have the exact body I needed. I am now using these polygons: love.physics.newPolygonShape( 12.00, -40.50 , 15.00, -30.50 , 9.00, -32.50 , 9.00, -38.50 , 10.00, -40.50 ), love.physics.newPolygonShape( -32.00,...
- Mon Aug 13, 2012 11:51 am
- Forum: Support and Development
- Topic: Attaching multiple shapes to fixture and setting an image
- Replies: 10
- Views: 7048
Re: Attaching multiple shapes to fixture and setting an imag
Hi Boolsheet, thanks for the reply. I multiplied every Y point to -1 and it worked.
Last, could you help me center the image to the body. Here is my .love file.
Last, could you help me center the image to the body. Here is my .love file.
- Mon Aug 13, 2012 2:12 am
- Forum: Support and Development
- Topic: Attaching multiple shapes to fixture and setting an image
- Replies: 10
- Views: 7048
Re: Attaching multiple shapes to fixture and setting an imag
Thanks Robin and Boolsheet . I tried to draw my polygon and my image using Boolsheet 's code. Here is what it looks like. Seems that the polygon is inverted . How do I fix the polygon so that it snaps into the image? I just want to draw the polygons along with the image for debugging purposes. If I ...
- Sun Aug 12, 2012 5:40 pm
- Forum: Support and Development
- Topic: Attaching multiple shapes to fixture and setting an image
- Replies: 10
- Views: 7048
Re: Attaching multiple shapes to fixture and setting an imag
Thanks Omar, I updated the code to: objects.pig.fixtures ={} for i=1, table.getn(objects.pig.shapes) do objects.pig.fixtures[i] = love.physics.newFixture(objects.pig.body, objects.pig.shapes[i],2) objects.pig.fixtures[i]:setRestitution(0.9) --let the ball bounce end Now, how do I see my pig? When dr...