Page 2 of 3
Re: Two things
Posted: Fri Mar 23, 2012 8:34 pm
by TurtleP
coffee wrote:TurtleP wrote:coffee wrote:
You must have a exactly named "PlayerD.png" in same directory than your main.love. Also try to instead use lowercase just for debugging for now. Can you post your .Love file (zip the files inside directory)?
Yes, would you like to see my Source? Drawing a barrier seems to be a situation for me, I am not sure why though. Included are the images I am going to use.
It wouldn't let me add the .love, here's mediafire link:
http://www.mediafire.com/?vtu692pfhomsvxb
You can't attach because your wav is to big. try convert all songs or evens sounds to .ogg. LOVE play it better and take less space.
no PlayerD.png error after all. you discovered that is PlayerD.PNG right?
error on draw. it should be
love.graphics.draw(Barrier,map[y+map_y][x+map_x], x*40,y*40)
but result is horrible lol. You are scaling 40x!
Yea.. I felt my game would be best as 40x40 since all the sprites look nice. Yea, I did realized it was supposed to be .PNG (which is kinda obnoxious lol) and ok, I'll make it an ogg. Oh .. I see. Fixed that player sprite. Oh and the barriers are not aligned .. hmm
Re: Two things
Posted: Fri Mar 23, 2012 8:49 pm
by coffee
Well, looking better for your code.
First problems:
Your sprites aren't the same size as told in map ( tile_w = 40, tile_h = 40). Player is 28x32 and barrier is 31x32. but since you aren't drawing floor it's ok.
Trying to see what you want to do.
Re: Two things
Posted: Fri Mar 23, 2012 8:55 pm
by TurtleP
coffee wrote:Well, looking better for your code.
First problems:
Your sprites aren't the same size as told in map ( tile_w = 40, tile_h = 40). Player is 28x32 and barrier is 31x32. but since you aren't drawing floor it's ok.
Trying to see what you want to do.
So that's why my barrier is not being drawn as I want? They need to be 40x40?
Re: Two things
Posted: Fri Mar 23, 2012 9:01 pm
by coffee
TurtleP wrote:coffee wrote:Well, looking better for your code.
First problems:
Your sprites aren't the same size as told in map ( tile_w = 40, tile_h = 40). Player is 28x32 and barrier is 31x32. but since you aren't drawing floor it's ok.
Trying to see what you want to do.
So that's why my barrier is not being drawn as I want? They need to be 40x40?
Not the problem for now.
put this in your map
love.graphics.draw( Barrier, (x*tile_w)+map_offset_x, (y*tile_h)+map_offset_y )
so? almost there!
EDITED: now try to use 40x40 size for obstacles
Re: Two things
Posted: Fri Mar 23, 2012 9:05 pm
by TurtleP
One more thing,
Code: Select all
function love.draw()
draw_map()
if leftkey == true then
animation = animation + 1
if animation >= 0 and animation < 2 then
love.graphics.draw(PlayerA, player.act_x, player.act_y)
end
if animation >=2 and animation <4 then
love.graphics.draw(PlayerA2, player.act_x, player.act_y)
end
if animation >=2 then
animation = 0
end
end
end
function love.keypressed(key)
if key == "w" then
if testMap(0, -1) then
player.grid_y = player.grid_y - 40
end
elseif key == "s" then
if testMap(0, 1) then
player.grid_y = player.grid_y + 40
end
elseif key == "a" then
if testMap(-1, 0) then
player.grid_x = player.grid_x - 40
leftkey = true
end
elseif key == "d" then
if testMap(1, 0) then
player.grid_x = player.grid_x + 40
rightkey = true
end
end
The thing says that animation's value is nil, I set it to zero initially.
Re: Two things
Posted: Fri Mar 23, 2012 9:16 pm
by coffee
Your code revised. I took your wav away sorry. leave sound for later...
Your next problem. Your character draw is not accounting with map offset. see what happens if I put map offset to 0/0! all works.
EDITED:
Another "problem". Your map in table is smaller than 20/20 map size. so fill all map...
Re: Two things
Posted: Fri Mar 23, 2012 9:16 pm
by TurtleP
coffee wrote:Your code revised. I took your wav away sorry. leave sound for later...
Your next problem. Your character draw is not accounting with map offset. see what happens if I put map offset to 0/0! all works
Wow. Thanks!
Did you read my animation problem?
Re: Two things
Posted: Fri Mar 23, 2012 9:21 pm
by coffee
TurtleP wrote:coffee wrote:Your code revised. I took your wav away sorry. leave sound for later...
Your next problem. Your character draw is not accounting with map offset. see what happens if I put map offset to 0/0! all works
Wow. Thanks!
Did you read my animation problem?
We are out of "syncro" now. start using my "revised" and add thing there. One advise, take care first of map, then advance for animation later. sorry I "cold" resize to 40/40 your sprites.
Re: Two things
Posted: Fri Mar 23, 2012 9:27 pm
by coffee
back to offset problem. saw the problem? replace hero draw with love.graphics.draw(PlayerD, player.act_x+map_offset_x, player.act_y+map_offset_y)
and put again offset_x and offset_y to 20 (was that the value?). Now hero is synchronized with map so you can draw map at will with offset
Re: Two things
Posted: Fri Mar 23, 2012 9:35 pm
by TurtleP
coffee wrote:TurtleP wrote:coffee wrote:Your code revised. I took your wav away sorry. leave sound for later...
Your next problem. Your character draw is not accounting with map offset. see what happens if I put map offset to 0/0! all works
Wow. Thanks!
Did you read my animation problem?
We are out of "syncro" now. start using my "revised" and add thing there. One advise, take care first of map, then advance for animation later. sorry I "cold" resize to 40/40 your sprites.
I just finished the map and re sizing the player. Now..What?