Drawing Maps With Images

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
awhite92
Prole
Posts: 21
Joined: Thu Jul 26, 2012 4:25 am

Drawing Maps With Images

Post by awhite92 »

i just threw this together in the last few hours, so its probably overkill/messy. let me know what you think.
and you can use it if you want for anything, although i know there are a few things in the code i don't exactly like, but it works (thus far).

it takes an image, and converts it to a table to be drawn, but all seamlessly. you just provide the textures, and the indexing colors, and the map image. and it draws it for you, and only draws what is visible and not the whole map. it also has blocky map movement (if thats what you call it), use the arrow keys, one block at a time. it can probably be converted to smooth movement, but im to lazy right now lol

have a look at the code if you need help, its documented. but if it doesn't answer your question, feel free to ask :D
btw only the arrow keys do anything. aaanndd its dependent on the conf.lua file, but its not much.

comments/suggestions/anything? thanks.
Attachments
Map Loader.love
for Love 0.8.0
(5.56 KiB) Downloaded 270 times
saved by a scholarship..
redesigned my "avatar"
Öbey
Prole
Posts: 13
Joined: Wed Aug 08, 2012 7:18 am

Re: Drawing Maps With Images

Post by Öbey »

It looks good but it should move continously if you keep the key down
User avatar
awhite92
Prole
Posts: 21
Joined: Thu Jul 26, 2012 4:25 am

Re: Drawing Maps With Images

Post by awhite92 »

Öbey wrote:It looks good but it should move continously if you keep the key down
all that is going to be on the programmers end, whoever user the code would be able to set that up. i will change it to be a smooth scroll instead of block by block
saved by a scholarship..
redesigned my "avatar"
Post Reply

Who is online

Users browsing this forum: No registered users and 96 guests