A few questions about Lua and Love.

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.
Post Reply
hudwol
Prole
Posts: 1
Joined: Fri Nov 27, 2015 3:29 am

A few questions about Lua and Love.

Post by hudwol »

I've never used Lua before but I am fluent in OOP. I'm not of advanced skill in any language, although, I have been able to write small programs in Python, Ruby, and JavaScript simply by knowing the concepts of OOP and adapting to the syntax of a new language.

Until very recently I was on path to become a web developer, but I'm so burnt out with that idea. I don't care to make boring social networks, e-commerce sites, and blogs: I am entertained with the idea of creating my own world, characters, stories, and laws much more.

So I am here to find out a little bit about Lua. I could have asked these questions on Quora, but I'd much rather get the answers from this seemingly vibrant community.

Firstly, I understand that Love is a 2D engine. That is fine by me, but does it support vector based graphics?
Next, does Lua and Love allow you to create entire games with no low-level coding required? Not grasping C/C++/C#/Java is a handicap of mine.
Also, can I create cross-platform games using Love? Browser, Android, iOS?
Lastly, does this Lovely combination support online/multiplayer integration?

Thank you in advance.
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: A few questions about Lua and Love.

Post by zorg »

Hey there, welcome to the forums!

So, short answers to your specific questions:
  • Unless you find a (either lua or c) library for it, or write it yourself, löve doesn't support vector graphics, like loading and using SVG files. (but you can create art assets programatically, if you meant that instead, like create shapes and textures through code)
  • Yes, you don't need to know C++ or C to create a game in löve; you're fine with just lua! :3
  • Löve is cross-platform in that it does run on windows, mac and linux, and whenever 0.10.0 comes out, it will probably include android and iOS ports as well; for browsers, i believe there are/have been some ports in the ports subforum; to my knowledge, none complete.
  • If by this, you mean that can you create multiplayer games, then yes; löve does include luasocket, and Enet, the latter being a somewhat higher-level lib... or you can also use the LUBE lib, that a löver wrote; your choice. (There are a few other relevant libs as well though)
    If you're going for (dedicated-) server - client, not just peer-to-peer, then you can write the server in "plain" lua as well, as long as you correctly simulate the game and handle packets.
Also, i would suggest not sticking to OO solutions with lua (You can, of course, in more than one way too), but try out entity-component-systems.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

Re: A few questions about Lua and Love.

Post by SuperZazu »

zorg wrote: Also, i would suggest not sticking to OO solutions with lua (You can, of course, in more than one way too), but try out entity-component-systems.
Hi! :-)

Your sentence intrigued me. See, I stumbled upon a couple of articles on the subject (which were really more about theory); but I never had a chance to see it "for real". Does ECS mean "no OO" ? Would you happen to have any code example (maybe a little project ?) ?

Good evening (and sorry for the off-topic)
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: A few questions about Lua and Love.

Post by s-ol »

SuperZazu wrote:
zorg wrote: Also, i would suggest not sticking to OO solutions with lua (You can, of course, in more than one way too), but try out entity-component-systems.
Hi! :-)

Your sentence intrigued me. See, I stumbled upon a couple of articles on the subject (which were really more about theory); but I never had a chance to see it "for real". Does ECS mean "no OO" ? Would you happen to have any code example (maybe a little project ?) ?

Good evening (and sorry for the off-topic)
OO and ECS don't exclude each other, OO is a programming paradigm and/or language feature, ECS are a way of handling/simulating "things" specific mostly to video games. An ECS can be implemented using OO, but it doesn't need to, and in Lua you probably won't use a lot of OOP concepts if you use an ECS:

With classical OOP Game programming, you will most likely end up with a class hierarchy something like this somewhere in your project:

Code: Select all

Entity 
   |    \....
 DamageableEntity
   |
 AnimatedCharacterEntity
   |               \-- ZombieNPC
Player
With an ECS this is not the case. Instead you could have "Systems" like an AnimationSystem, a WASDInputSystem, a HealthArmorSystem and an AISystem and Components like an AnimationComponent, PositionVelocityComponent, HealthComponent, ArmorComponent etc. which would be applied to the different Entities:

Entity #1 (Player): affected by AnimationSystem, WASDInputSystem, HealthArmorSystem
Entity #2 (Zombie #1): affected by AnimationSystem, AISystem, HealthArmorSystem
Entity #2 (Zombie #2): affected by AnimationSystem, AISystem, HealthArmorSystem

as you can see, there are no Classes or Types and in most ECS there isn't even going to be a "zombie" type anywhere (ECS work in a duck-typing kind of way usually).

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

Re: A few questions about Lua and Love.

Post by SuperZazu »

Thank you for your answer! :-)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 6 guests