Tile-based tutorials

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Tile-based tutorials

Post by kikito »

I've just finished Part I of the tutorial - both the code and wiki documentation.

I'll start coding Part II (entities) tomorrow.

In the meantime, please feel free to look around and help me fix any typos, unclear sections, etc:
Regards!
When I write def I mean function.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: Tile-based tutorials

Post by Ryne »

kikito wrote:I've just finished Part I of the tutorial - both the code and wiki documentation.

I'll start coding Part II (entities) tomorrow.

In the meantime, please feel free to look around and help me fix any typos, unclear sections, etc:
Regards!
AWESOME!!!

Can't wait to continue!
@rynesaur
User avatar
StoneCrow
Party member
Posts: 199
Joined: Sat Apr 17, 2010 9:31 am
Location: Wales the land of leeks and leaks
Contact:

Re: Tile-based tutorials

Post by StoneCrow »

i have been working through this tutorial
on this page
the draw code doesnt work

it raises error:

Code: Select all

incorrect parameter type: expected userdata
in fuction drawq
and i beleive its being called over the "char" variable


i did hit another error earlier in the tutorial,
but it was easily corrected, simply to do with a change to

Code: Select all

Quads = {}
for i,quadinfo in ipairs(quadInfo) do
  -- info[1] = x, info[2] = y
  Quads[i] = love.graphics.newQuad(info[i][1], info[i][2], TileW, TileH, tilesetW, tilesetH)
end
thats all i can remember from the fix i did, it has been a while since i did that bit
Dull but sincere filler.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Tile-based tutorials

Post by kikito »

Hi StoneCrow, thanks for taking the time to review the tutorial and comment here.
StoneCrow wrote:i have been working through this tutorial on this page the draw code doesnt work. It raises error:

Code: Select all

incorrect parameter type: expected userdata
in fuction drawq
and i beleive its being called over the "char" variable
Thanks for reporting this. I've made some changes in the code on that section.
StoneCrow wrote: i did hit another error earlier in the tutorial,
but it was easily corrected, simply to do with a change to

Code: Select all

Quads = {}
for i,quadinfo in ipairs(quadInfo) do
  -- info[1] = x, info[2] = y
  Quads[i] = love.graphics.newQuad(info[i][1], info[i][2], TileW, TileH, tilesetW, tilesetH)
end
thats all i can remember from the fix i did, it has been a while since i did that bit
I think neither of us where correct then :). The correct code is this one:

Code: Select all

  Quads = {}
  for i,info in ipairs(quadInfo) do
    -- info[1] = x, info[2] = y
    Quads[i] = love.graphics.newQuad(info[1], info[2], TileW, TileH, tilesetW, tilesetH)
  end
I've also updated that.

By the way, you know that you can download the source code from the tutorials from https://github.com/kikito/love-tile-tutorial, right?

I've changed the links on the wiki so the source code link is more visible (they are near the top of each section).
When I write def I mean function.
User avatar
RadagastTheBrown
Prole
Posts: 2
Joined: Wed Jan 05, 2011 8:05 pm

Re: Tile-based tutorials

Post by RadagastTheBrown »

Thank you so much! Part 1 was very fun, easy, and informative. Your exercises section inspired me to draw my very first tileset, which came out ok! I can't wait try part 2!! This is my first time coming into game programming, and I'm competing in the global game jam at the end of the month, where you try to build a game in 48 hours.
Obey the Fargul!
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Tile-based tutorials

Post by kikito »

Thanks, you are very kind!

I hope to be able to start with part 2 this week. I was busy with other stuff before, but now I have no excuse :P

Good luck with the competition!
When I write def I mean function.
User avatar
StoneCrow
Party member
Posts: 199
Joined: Sat Apr 17, 2010 9:31 am
Location: Wales the land of leeks and leaks
Contact:

Re: Tile-based tutorials

Post by StoneCrow »

Hey i worked through the tutorial again, then combined everything into the main file
and now it works fine
thanks for the tutorial,
are you planning on writing a section on scrolling the tiles without getting those black lines appearing inbetween?
Dull but sincere filler.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Tile-based tutorials

Post by TechnoCat »

StoneCrow wrote:scrolling the tiles without getting those black lines appearing inbetween?
When you draw, floor your x and y values.
User avatar
StoneCrow
Party member
Posts: 199
Joined: Sat Apr 17, 2010 9:31 am
Location: Wales the land of leeks and leaks
Contact:

Re: Tile-based tutorials

Post by StoneCrow »

TechnoCat wrote:When you draw, floor your x and y values.
ahh brilliant, thankyou very much
Dull but sincere filler.
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests