Page 1 of 2

Just Getting Started???

Posted: Thu Nov 07, 2013 10:31 pm
by Tyler821
Hi. I'm new to Love, but not to Lua. I've used Lua in many other scenarios, but I have to develop a videogame about taking over the world. The Love format is confusing me with the love.draw, etc. So, how would I start..? :nyu:

Re: Just Getting Started???

Posted: Thu Nov 07, 2013 10:51 pm
by BozoDel
Hi there! I'm more of a noob than you are, but I've collected a few interesting links on how to get started.

This one is very noob oriented, but it shows you how to handle some graphics:
https://github.com/kikito/love-tile-tutorial/wiki

This one deals with movement, and a bit of physics/collision:
http://www.headchant.com/2010/11/27/lov ... -must-die/
http://www.headchant.com/2010/12/31/lov ... 2-pew-pew/
(might be a bit buggy tho)

And here are some links I haven't totally checked out myself yet:
http://gamedev.tutsplus.com/articles/ho ... ve-love2d/
http://www.explodingrabbit.com/forum/en ... al-01.669/

Hope it helps! Tell me later what worked out for you.

Re: Just Getting Started???

Posted: Thu Nov 07, 2013 10:54 pm
by Nixola
What about [wiki]Getting Started[/wiki]? :awesome:
There's a link to some Tutorials at the end of that page, and a specific one you should read to better understand how LÖVE works. If there's something specific you don't get about them, feel free to ask! If you've read them already but still you don't get it, what aren't you getting exactly?
love.draw is a user defined function that gets called about 60 times a second (in optimal conditions), once a frame. It's the function where you should put all of the code that's supposed to draw something in the window.

EDIT: If you can understand it, take a look at [wiki]love.run[/wiki] to see how LÖVE works

Ninja'd by BozoDel

Re: Just Getting Started???

Posted: Fri Nov 08, 2013 12:25 am
by Tyler821
Nixola wrote:
I'm getting the hang of it now, but now I came across another problem: require() is being a complete biotch.

So, I have a file called main.lua and mainmenu.lua in the main directory, and I have a libs folder with Love Frames and a font.

I tried using

Code: Select all

require("libs.loveframes");
but it keeps saying that "global libs does not exist." (By the way, I use semicolons because I also code in Java and I don't like change; I haven't come across an error due to it yet.)

Is there a problem with it? The game is called uDominate (since you have to take over the world). So mhere are the filepaths:
  • main.lua uDominate/main.lua
  • mainmenu.lua: uDominate/mainmenu.lua
  • Love Frames: uDominate/libs/loveframes
  • Font: uDominate/libs/titleFont.ttf
If someone could post the proper require() thing for loveframes and the font, I'd really appreciate it. :D

Re: Just Getting Started???

Posted: Fri Nov 08, 2013 10:11 am
by Robin
If you could upload a .love of your game, we could take a look at it. See the wiki on how to make a .love.

Re: Just Getting Started???

Posted: Fri Nov 08, 2013 1:15 pm
by Nixola
About the semicolons, I think they're just ignored in Lua; the require error seems to be weird, are you sure that's the line that throws it?

Re: Just Getting Started???

Posted: Fri Nov 08, 2013 1:18 pm
by Roland_Yonaba
BozoDel wrote:Hi there! I'm more of a noob than you are, but I've collected a few interesting links on how to get started
Just in addition to that, checkout BlackBulletIV's tutorials, especially the Lua for programmers series.

Re: Just Getting Started???

Posted: Fri Nov 08, 2013 9:33 pm
by Tyler821
I fixed the require error. Apparently, parentheses shouldn't be in it. :\

New problem though. I tried making a new font, but it says the font file doesn't exist. It's in the same directory.

I used:

Code: Select all

titleFont = love.graphics.newFont("titleFont.tff",50);
titleFont.tff is in the same directory as my lua file. The error is: "graphics.lua.1252: Could not open file titleFont.tff. Does not exist."
I'm pretty sure it exists. :|

Re: Just Getting Started???

Posted: Fri Nov 08, 2013 9:47 pm
by DaedalusYoung
The font file extension is probably ttf, not tff.

Re: Just Getting Started???

Posted: Fri Nov 08, 2013 9:53 pm
by Tyler821
DaedalusYoung wrote:The font file extension is probably ttf, not tff.
-facepalm- Thanks. :ehem:

Wait a second, now I'm getting another error! D:<

So on my main.lua, I have a line that says:

Code: Select all

require"mainmenu.lua"
I get an error saying that mainmenu.lua doesn't exist. (And this time I made sure I didn't misspell a file extension.)
main.lua and mainmenu.lua are both in the main directory.

Btw, I don't see the need to upload my .love file yet. When I get major errors I definitely will.