Page 1 of 4

How to LÖVE - Now with text-based tutorials

Posted: Mon Feb 29, 2016 11:12 pm
by Sheepolution
Go to the tutorials



How to LÖVE is a tutorial series that teaches you how to make a game with LÖVE. All videos/chapters are very short and straight to the point. The video series is on a hold, but I'm still writing new chapters.

Why are you making these tutorials?
Because I've struggled a lot with learning LÖVE and learning programming in general. I've wanted to make a tutorial series for a long time, and I finally decided to actually do it. I'm making the tutorial that I wish would've existed when I started learning LÖVE.
Also a friend challenged me to make a Youtube channel which will get more subscribers than his

How many chapters will you make?
Till I can't think of anything new to explain. I also want to invite people to help me write tutorials on certain subjects, like online play or ECS.

Re: How to LÖVE - A LÖVE tutorial series

Posted: Mon Feb 29, 2016 11:39 pm
by davisdude
Nice! More tutorials are always a good thing, and I like tutorials that are direct.

Re: How to LÖVE - A LÖVE tutorial series

Posted: Tue Mar 01, 2016 1:45 pm
by Ulydev
Haha, good job on that first video! I'm waiting for the Pong tutorial!

Re: How to LÖVE - A LÖVE tutorial series

Posted: Mon Mar 14, 2016 11:17 pm
by Sheepolution
I added a bunch of new episodes. The most notable is the Classes tutorial. I notice a lot of people don't use classes so this might be interesting even if you already have some experience with LÖVE.


Re: How to LÖVE - A LÖVE tutorial series

Posted: Tue Mar 15, 2016 6:40 pm
by AC Vis
I LOVE these. Simple, and they get you right into it - with no rambling. Plus, you're tackling important topics like scope, objects, libraries, classes...without turning them into 30 minute long videos. Awesome job!

Re: How to LÖVE - A LÖVE tutorial series

Posted: Tue Mar 15, 2016 9:21 pm
by airstruck
No offense, but why the use of globals instead of proper encapsulation for modules? People who are new to software dev may not know this is bad design, and people who are new to Lua might not realize there's any alternative. I've noticed this trend in a lot of Love tutorials, not just yours.

Re: How to LÖVE - A LÖVE tutorial series

Posted: Wed Mar 16, 2016 8:20 pm
by Vimm
Suggestion: episode 16+ - 2D platformer

Re: How to LÖVE - A LÖVE tutorial series

Posted: Wed Mar 16, 2016 11:26 pm
by Sheepolution
airstruck wrote:No offense, but why the use of globals instead of proper encapsulation for modules? People who are new to software dev may not know this is bad design, and people who are new to Lua might not realize there's any alternative. I've noticed this trend in a lot of Love tutorials, not just yours.
To be honest, I don't use proper encapsulation myself. Please educate me why I should use it, and if you can convince me I will teach it in my videos.

Also could you show an example? I might be mixing things up here.

Re: How to LÖVE - A LÖVE tutorial series

Posted: Thu Mar 17, 2016 5:02 pm
by airstruck
There are lots of good reasons avoid globals; google for something like why not globals and you'll find someone explaining it better than I probably can. The top result from that search sums it up pretty well, I think. There are a small number of cases where it's worth making an exception, but use of globals should really be the exception rather than the rule.

Personally, I sometimes make an exception for cross-cutting concerns. When something is used in many unrelated parts of the program, a global might make sense; for example a boolean "DEBUG" global. Your "Object" global might fall into this category if you make heavy use of classical OOP throughout your program, but "Rectangle" certainly wouldn't.

In a tutorial for beginners, I wouldn't expect the audience to be able to make this distinction; I'd just avoid globals everywhere at that level.
Sheepolution wrote:could you show an example?
Instead of this:

Code: Select all

-- main.lua
Object = require 'class'

-- rectangle.lua
Rectangle = Object:extend()
You'd have something like this:

Code: Select all

-- rectangle.lua
local Object = require 'class'
local Rectangle = Object:extend()
-- ...
return Rectangle

Re: How to LÖVE - A LÖVE tutorial series

Posted: Thu Mar 17, 2016 5:54 pm
by MadByte
Instead of this:

Code: Select all

-- main.lua
Object = require 'class'

-- rectangle.lua
Rectangle = Object:extend()
You'd have something like this:

Code: Select all

-- rectangle.lua
local Object = require 'class'
local Rectangle = Object:extend()
-- ...
return Rectangle
Basically thats what I do for every module, but why should I add an extra line "local Object=require("class")" to every single class, for every single required module I create. I don't see the mysterious big advantage when doing everything local. All my main.lua files look like this:

Code: Select all


---------------------------------------------------------------------------------------------
-- Air Taxi --
---------------------------------------------------------------------------------------------
love.mouse.setVisible(false)
love.graphics.setBackgroundColor(50, 55, 60)
screenWidth, screenHeight = love.graphics.getDimensions()


-- Lib --
Anim8           = require("source.lib.anim8")
Assets          = require("source.assets")
Bump            = require("source.lib.bump")
Camera          = require("source.lib.camera")
Serialize       = require("source.lib.ser")
Object          = require("source.lib.classic")
Gamestate       = require("source.lib.gamestate")

-- System --
Container       = require("source.system.Container")
StateManager    = require("source.system.StateManager")
Level           = require("source.system.Level")

-- Actor --
Actor           = require("source.actor.Actor")
TaxiStation     = require("source.actor.TaxiStation")
GasStation      = require("source.actor.GasStation")
Wall            = require("source.actor.Wall")
Passenger       = require("source.actor.Passenger")
Taxi            = require("source.actor.Taxi")
Bird            = require("source.actor.Bird")

-- States --
Menu            = require("source.state.Menu")
Game            = require("source.state.Game")
Editor          = require("source.state.Editor")

function love.load()
  Gamestate.switch(Editor)
  Gamestate.registerEvents()
end
Thats it.. no more globals, I personally think this should be fine or is this considered messy?. If I imagine how much more code I would need to write just to have everything local (when using an OOP approach)...:death: :death: