Search found 76 matches
- Sat Nov 28, 2009 11:10 am
- Forum: Support and Development
- Topic: 0.6.0: red ball is a white square...
- Replies: 8
- Views: 3944
Re: 0.6.0: red ball is a white square...
Aha... well, does this count as implemented? function fixed_newImageData(file) local i=love.image.newImageData(file) local x,y,nx,ny=i:getWidth(),i:getHeight(),1,1 while nx<x do nx=nx*2 end while ny<y do ny=ny*2 end local f=love.image.newImageData(nx,ny) f:paste(i,0,0,0,0,x,y) return f end
- Sat Nov 28, 2009 9:01 am
- Forum: Support and Development
- Topic: 0.6.0: red ball is a white square...
- Replies: 8
- Views: 3944
0.6.0: red ball is a white square...
Am I doing something wrong? From the docs so far, I would imaging the following would put an image on the screen... ball=love.graphics.newImage('redball.png') function love.draw() love.graphics.draw(ball,200,200) end but all it does is put a white square there instead of my lovely red ball... Is my ...
- Wed Nov 11, 2009 12:36 am
- Forum: Support and Development
- Topic: sprite look to cursor
- Replies: 9
- Views: 8674
oh, the uglyness!
This code is terrible: angle = math.atan2(y2-y1,x2-x1) * 57.2957795 About the only thing that messes up code as much as a goto is using hardcoded numerical constants in situ. They should be named something useful and defined once in a common location. However, in this case you really just need to us...
- Mon Nov 09, 2009 9:45 pm
- Forum: Support and Development
- Topic: checking groups in a 2d array
- Replies: 2
- Views: 3035
Re: checking groups in a 2d array
You don't need to test the whole array, just when a block drops... in this case:
1) you only check the dropped block colour
2) the dropped block must be in the new (potential) shape
This should limit your search significantly.
1) you only check the dropped block colour
2) the dropped block must be in the new (potential) shape
This should limit your search significantly.
- Mon Nov 09, 2009 4:57 pm
- Forum: Support and Development
- Topic: Multiple LOVE files
- Replies: 8
- Views: 7293
Re: Multiple LOVE files
Except for dofile not working together with love.filesystem (though that might be intended?) Ah, I forgot that I already fixed love to work using: -- standard dofile and require lua functions are denied access to the -- filesystem (for security) so make them use the allowed paths local base='code/'...
- Mon Nov 09, 2009 5:45 am
- Forum: Support and Development
- Topic: Multiple LOVE files
- Replies: 8
- Views: 7293
Re: Multiple LOVE files
You could have a system like this:
Code: Select all
loadsection={'data/level1/load.lua','data/level2/load.lua','data/level3/load.lua'}
local level=1
while level>0 do
dofile(loadsection[level]))
-- have fun...
level=select_level() -- however you want this to happen
end
- Wed Nov 04, 2009 3:14 pm
- Forum: Support and Development
- Topic: Question regarding table.insert()
- Replies: 9
- Views: 5087
Re: Question regarding table.insert()
A million possible approaches. It seems a little odd objecting to commas in the .act file when you are happy to scatter c. around... This one gets by without c. or commas but wont run code... charlist={} function addNewCharacter(name) charlist[name]=character:new() for line in love.filesystem.lines(...
- Tue Nov 03, 2009 10:33 pm
- Forum: General
- Topic: LuaJIT 2.0
- Replies: 10
- Views: 16853
Re: LuaJIT 2.0
Mostly for Nvidia cards, though the opensource drivers are always getting better. Other vendors (ATI/AMD,Intel,Matrox,etc) have put out more information and have much more complete hardware support.
- Tue Nov 03, 2009 10:26 pm
- Forum: Support and Development
- Topic: Question regarding table.insert()
- Replies: 9
- Views: 5087
Re: Question regarding table.insert()
Robin : I don't use setfenv much so I may have this wrong, but I think you're leading dear Candall astray... setfenv controls the global variables that a function deals with, and function calls from that function inherit the same collection of globals. If all Candall wants to do in his .act file is...
- Tue Nov 03, 2009 7:03 am
- Forum: Support and Development
- Topic: Question regarding table.insert()
- Replies: 9
- Views: 5087
wrong question...
First a few small but important code fixes: for line in io.lines('textfile') do -- must use a do/end block with for table.insert(t,line) -- make sure t is a table end Now, table.insert just puts data (in the above case strings) into a table. That's all. If your want text in a file to be used as code...