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 .. hmmcoffee wrote: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.TurtleP wrote: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.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)?
It wouldn't let me add the .love, here's mediafire link:
http://www.mediafire.com/?vtu692pfhomsvxb
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!
Two things
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Two things
Re: Two things
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.
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
So that's why my barrier is not being drawn as I want? They need to be 40x40?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.
Re: Two things
Not the problem for now.TurtleP wrote:So that's why my barrier is not being drawn as I want? They need to be 40x40?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.
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
One more thing,
The thing says that animation's value is nil, I set it to zero initially.
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
Re: Two things
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...
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...
Last edited by coffee on Fri Mar 23, 2012 9:19 pm, edited 2 times in total.
Re: Two things
Wow. Thanks!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
Did you read my animation problem?
Re: Two things
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.TurtleP wrote:Wow. Thanks!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
Did you read my animation problem?
Re: Two things
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
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
I just finished the map and re sizing the player. Now..What?coffee wrote: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.TurtleP wrote:Wow. Thanks!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
Did you read my animation problem?
Who is online
Users browsing this forum: Bing [Bot] and 228 guests