Just Getting Started???

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Tyler821
Prole
Posts: 7
Joined: Thu Nov 07, 2013 10:29 pm

Just Getting Started???

Post 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:
User avatar
BozoDel
Party member
Posts: 164
Joined: Fri Nov 01, 2013 10:28 pm

Re: Just Getting Started???

Post 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.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Just Getting Started???

Post 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
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Tyler821
Prole
Posts: 7
Joined: Thu Nov 07, 2013 10:29 pm

Re: Just Getting Started???

Post 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
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Just Getting Started???

Post 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.
Help us help you: attach a .love.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Just Getting Started???

Post 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?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Just Getting Started???

Post 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.
Tyler821
Prole
Posts: 7
Joined: Thu Nov 07, 2013 10:29 pm

Re: Just Getting Started???

Post 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. :|
User avatar
DaedalusYoung
Party member
Posts: 413
Joined: Sun Jul 14, 2013 8:04 pm

Re: Just Getting Started???

Post by DaedalusYoung »

The font file extension is probably ttf, not tff.
Tyler821
Prole
Posts: 7
Joined: Thu Nov 07, 2013 10:29 pm

Re: Just Getting Started???

Post 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.
Post Reply

Who is online

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