Advanced Tiled Loader - No longer maintained

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Advanced Tiled Loader

Post by Nixola »

Try this:

Code: Select all

for i, v in ipairs(map) do
for ii, vv in ipairs(v) do
v[ii] = ii + (i-1)*16
end
end

Code: Select all

> map.print = function(self)
>> for i, v in ipairs(self) do
>> print(v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9], v[10], v[11], v[12], v[13], v[14], v[15], v[16])
>> end
>> end
> map:print()
1	2	3	4	5	6	7	8	9	10	11	12	13	14	15	16
17	18	19	20	21	22	23	24	25	26	27	28	29	30	31	32
33	34	35	36	37	38	39	40	41	42	43	44	45	46	47	48
49	50	51	52	53	54	55	56	57	58	59	60	61	62	63	64
65	66	67	68	69	70	71	72	73	74	75	76	77	78	79	80
81	82	83	84	85	86	87	88	89	90	91	92	93	94	95	96
97	98	99	100	101	102	103	104	105	106	107	108	109	110	111	112
113	114	115	116	117	118	119	120	121	122	123	124	125	126	127	128
129	130	131	132	133	134	135	136	137	138	139	140	141	142	143	144
145	146	147	148	149	150	151	152	153	154	155	156	157	158	159	160
161	162	163	164	165	166	167	168	169	170	171	172	173	174	175	176
177	178	179	180	181	182	183	184	185	186	187	188	189	190	191	192
193	194	195	196	197	198	199	200	201	202	203	204	205	206	207	208
209	210	211	212	213	214	215	216	217	218	219	220	221	222	223	224
225	226	227	228	229	230	231	232	233	234	235	236	237	238	239	240
241	242	243	244	245	246	247	248	249	250	251	252	253	254	255	256
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
SimonLarsen
Party member
Posts: 100
Joined: Thu Mar 31, 2011 4:47 pm
Location: Denmark
Contact:

Re: Advanced Tiled Loader

Post by SimonLarsen »

Nixola wrote:Try this:
...
I think you misunderstand. I'm talking about the id's returned by map.tileLayers.layer.tileData(x,y). They are assigned by ATL not me. :nyu:
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Advanced Tiled Loader

Post by Nixola »

:oops:
Try to find the error in the code then, if ATL coder doesn't answer
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
arthur_pessoa
Prole
Posts: 1
Joined: Sat May 12, 2012 5:46 pm
Location: Brazil

Re: Advanced Tiled Loader

Post by arthur_pessoa »

This is awesome! thx!!! This make me so happy i could shit a rainbow right now :awesome: :awesome: :awesome:
“Simple things should be simple,
complex things should be possible.„
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Advanced Tiled Loader

Post by KingRecycle »

I am having a problem with the player sprite not detecting obstacle walls until half of his body touches the tile. This started when I tried to get the player to move smoothly instead of tile by tile.
Attachments
ProjectLearn.love
(5.99 MiB) Downloaded 161 times
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

SimonLarsen wrote:I think you misunderstand. I'm talking about the id's returned by map.tileLayers.layer.tileData(x,y). They are assigned by ATL not me. :nyu:


This was definitely a bug but it should be fixed now.
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Advanced Tiled Loader

Post by KingRecycle »

It seems ATL thinks the sprites body is his right foot instead of his whole body for some reason.
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Advanced Tiled Loader

Post by Kadoba »

KingRecycle wrote:It seems ATL thinks the sprites body is his right foot instead of his whole body for some reason.
I'm having a hard time following your code. How exactly are you doing the collision detection?
User avatar
KingRecycle
Prole
Posts: 44
Joined: Thu May 24, 2012 1:01 am

Re: Advanced Tiled Loader

Post by KingRecycle »

Kadoba wrote:
KingRecycle wrote:It seems ATL thinks the sprites body is his right foot instead of his whole body for some reason.
I'm having a hard time following your code. How exactly are you doing the collision detection?

Well it checks if the next tile has the obstacle property. Takes the tile the player is on and adds to it the direction the player is moving for the next tile.

So if the next tile is an obstacle tile it doesn't let the player move that direction.
User avatar
SimonLarsen
Party member
Posts: 100
Joined: Thu Mar 31, 2011 4:47 pm
Location: Denmark
Contact:

Re: Advanced Tiled Loader

Post by SimonLarsen »

Kadoba wrote:This was definitely a bug but it should be fixed now.
Yeah, just saw the commit. It works now. Thanks a bunch man, the library is great. ^^
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 3 guests