Search found 399 matches

by Kadoba
Tue Dec 16, 2014 5:12 am
Forum: Support and Development
Topic: How to rename dir / move file?
Replies: 20
Views: 11544

Re: How to rename dir / move file?

The thing is, os.execute is like the keys to the kingdom, and when you hand someone those, you can't really say "only come in Mondays and Tuesdays, and don't steal anything while you're in". In this specific case, one thing I could do is: renameFile('oldfile', 'newfile"; format "...
by Kadoba
Mon Dec 15, 2014 8:02 pm
Forum: Support and Development
Topic: How to rename dir / move file?
Replies: 20
Views: 11544

Re: How to rename dir / move file?

In that case, can you explain so I don't make this mistake again?
by Kadoba
Mon Dec 15, 2014 4:54 pm
Forum: Support and Development
Topic: How to rename dir / move file?
Replies: 20
Views: 11544

Re: How to rename dir / move file?

You can use os.execute() but it's a little crude and obviously platform dependent. Here's a quick example. Only tested on Windows and doesn't return any meaningful errors. -- Renames a save directory folder/file. function renameFile( old, new ) local dir = love.filesystem.getSaveDirectory() local co...
by Kadoba
Sat Nov 15, 2014 6:07 am
Forum: Support and Development
Topic: Is roguelike a reasonable task for LOVE?
Replies: 6
Views: 6823

Re: Is roguelike a reasonable task for LOVE?

tile = setmetatable({}, tile_type.stone_floor) Does it mean that if I will look for tile.color it will check the empty {} and then it will look in tile_type.stone_floor? You're only setting the metatable with that line. The magic happens with the metatable's __index. When you try and get a value do...
by Kadoba
Mon Nov 10, 2014 8:22 am
Forum: Support and Development
Topic: Is roguelike a reasonable task for LOVE?
Replies: 6
Views: 6823

Re: Is roguelike a reasonable task for LOVE?

LOVE is perfectly capable of handling roguelikes. In fact there are a few examples in the projects forums. The freezing at the start is likely because the window is being resized right after it was created using love.window.setMode(). You can avoid this by using a [wiki]conf.lua[/wiki] file. Also yo...
by Kadoba
Fri Feb 21, 2014 8:01 pm
Forum: Support and Development
Topic: [Solved] Sprite batch and zooming - stripes between tiles
Replies: 4
Views: 5690

Re: Sprite batch and zooming - black stripes between tiles

This problem is called called texture bleeding. It can happen even without using sprite batches. The most common way around this is to pad each tile with a 1px wide border with the same color as the neighboring pixel. You can also render the viewing area to a texture and scale that instead but it ha...
by Kadoba
Tue Feb 11, 2014 4:14 pm
Forum: Support and Development
Topic: OOP help
Replies: 48
Views: 24357

Re: OOP help

I just really hate the idea of copying someone elses work like that. If you want to create your own OOP implementation for learning or control over your projects that is one thing but I hope you reconsider this. If you program in any capacity please understand you will be using something someone el...
by Kadoba
Sun Feb 09, 2014 1:33 am
Forum: Support and Development
Topic: OOP help
Replies: 48
Views: 24357

Re: OOP help

Now we're getting somewhere. uh... k... I don't see what setting a index equal to the table of which the index is in does, Let's take a step back here. You probably understand now that __index will be checked if the values aren't found in the original table. You shouldn't have any problems understan...
by Kadoba
Sat Feb 08, 2014 1:26 pm
Forum: Support and Development
Topic: OOP help
Replies: 48
Views: 24357

Re: OOP help

You're making this harder than it actually is. OOP is really just about extending a set of functions and data. I mean, this is essentially OOP in Lua: -- OOP Library. Open source license. Send donations to Kadoba. Do not steal. function inherit( parent, child ) child = child or {} for k,v in pairs( ...
by Kadoba
Wed Jan 15, 2014 10:45 pm
Forum: Libraries and Tools
Topic: Simple Tiled Implementation - STI v1.2.3.0
Replies: 914
Views: 729218

Re: Simple Tiled Implementation

You can think of the TMX file as a project file, and the exported JSON/Lua as a program-ready file. I'm not sure if Kadoba was aware that Tiled exported directly to Lua since ATL made use of XML parsing, but STI uses the native Lua spec so hopefully it will load files faster and allow more flexibil...