Difference between revisions of "Love Game Engine"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Making a Game)
(Tutorials)
(41 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
[https://love2d.org/ love2d.org]
 
[https://love2d.org/ love2d.org]
 +
 +
The above site is not available in college so you can also download from here:
 +
 +
[https://studentthomrothac-my.sharepoint.com/:u:/g/personal/wayne_jones_thomroth_ac_uk/EVylUfU8ybdCjm093wbqYRUBUxOFCIm7SVijmSUaQ2D10w?e=ilJwMf Love 64 Bit Zip]
 +
 +
[https://studentthomrothac-my.sharepoint.com/:u:/g/personal/wayne_jones_thomroth_ac_uk/EV1G6fItGaxHstj1W_GdGCYBCK0RR2PxYX8x1In-BQbnlA?e=IWpDkf Love 32 Bit Zip]
 +
 +
You should be able to extract these zip files into your compiled storage folder.
 +
 +
==Love for Android==
 +
You can even get 'Love for Android' from the Google Play store. This will install the Love engine, you will then need to have a text editor in order to create the code:
 +
 +
<youtube> https://www.youtube.com/watch?v=TAZo-pin4nE </youtube>
 +
 +
[https://www.youtube.com/watch?v=TAZo-pin4nE Setup Love for Android]
  
 
=Getting Started=
 
=Getting Started=
The Love game engine uses Lua, so make sure you catch up and learn the language.  
+
The Love game engine uses Lua, so make sure you catch up and learn the language. The link below is to the Lua wiki section, it covers all of the basics of Lua:
  
The link below is to the Lua wiki section, it covers all of the basics of Lua:
+
[[Lua | Lua Wiki Page]]
 
 
[[Lua | Lua]]
 
  
 
==Making a Game==
 
==Making a Game==
Line 23: Line 36:
 
     -- use to set up your game
 
     -- use to set up your game
 
end
 
end
 +
 
function love.update(dt)
 
function love.update(dt)
 
     -- dt is the elapsed time since last call
 
     -- dt is the elapsed time since last call
 
end
 
end
 +
 
function love.draw()
 
function love.draw()
 
     love.graphics.print("Hello World", 400, 300)
 
     love.graphics.print("Hello World", 400, 300)
Line 31: Line 46:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
You can obviously add more functions, classes, variables to make your own game. But the key sections are 'love.load()' and 'love.draw()'.
+
You can obviously add more functions, classes, variables to make your own game. But the key sections are 'love.load()', 'love.update(dt)', and 'love.draw()'.
  
 
==Running Games==
 
==Running Games==
Line 47: Line 62:
  
 
=Tutorials=
 
=Tutorials=
Here is the link for the tutorial on the Love wiki site:
+
==TRC==
 +
[[Love - Drawing shapes]]
 +
 
 +
[[Love - Drawing an Image]]
 +
 
 +
[[Love - Moving an object]]
 +
 
 +
[[Love - Animation]]
 +
 
 +
[[Love - Creating a Map]]
 +
 
 +
[[Love - Using a TMX Map]]
 +
 
 +
[[Love - Lemmings Movement]]
 +
 
 +
[[Love - Bomberman Concept]]
 +
 
 +
[[Love - GUI]]
 +
 
 +
==External==
 +
===Love Main Site===
 +
Here is the link for the Love Wiki:
 +
 
 +
[https://love2d.org/wiki/Main_Page Love Wiki Site]
 +
 
 +
Here is the link for just the tutorials on the Love wiki site:
  
 
[https://love2d.org/w/index.php?title=Special:Ask&offset=0&limit=50&q=%5B%5BCategory%3ATutorials%5D%5D+OR+%5B%5BTutorial%3A%2B%5D%5D&p=mainlabel%3DTitle%2Fformat%3Dbroadtable&po=%3F%3DTitle%23%0A%3FLOVE+Version%0A%3FDescription%0A Love tutorials]
 
[https://love2d.org/w/index.php?title=Special:Ask&offset=0&limit=50&q=%5B%5BCategory%3ATutorials%5D%5D+OR+%5B%5BTutorial%3A%2B%5D%5D&p=mainlabel%3DTitle%2Fformat%3Dbroadtable&po=%3F%3DTitle%23%0A%3FLOVE+Version%0A%3FDescription%0A Love tutorials]
 +
 +
===Love Github Documentation===
 +
[https://love2d-community.github.io/love-api/ API Documentation]
 +
 +
[http://love2d-community.github.io/LOVE-Example-Browser/ Browser for Example Code]
 +
 +
[https://love2d-community.github.io/love2d-book Getting Started Book]
 +
 +
===Awesome Love2d===
 +
[https://github.com/love2d-community/awesome-love2d Awesome Love2d]
 +
 +
===Learn 2 Love===
 +
[https://rvagamejams.com/learn2love/ Learn 2 Love]
 +
 +
===Lua Breakout/Arkanoid===
 +
[https://github.com/noooway/love2d_arkanoid_tutorial/wiki Breakout/Arkanoid]
 +
 +
===Simple Game Tutorials===
 +
[https://simplegametutorials.github.io/ Simple Game Tutorials]
 +
 +
===Harvard CS50===
 +
[https://cs50.harvard.edu/games/2019/spring/ Games Development Course]
 +
 +
YouTube playlist for this course:
 +
[https://www.youtube.com/playlist?list=PLhQjrBD2T383Vx9-4vJYFsJbvZ_D17Qzh Harvard CS50 Games Development Tutorials]
 +
 +
GitHub for this course:
 +
[https://github.com/games50 GitHub for these tutorials]
 +
 +
===Using Tiled in Love===
 +
[http://lua.space/gamedev/using-tiled-maps-in-love Using Tiled in Love]
 +
 +
==You Tube==
 +
===You Tube playlists:===
 +
 +
[https://www.youtube.com/playlist?list=PLz-rYTT-2nItPbZaj8pt10h49HofbWVQT Game Development in Love2D [Beginner Series!]]
 +
 +
[https://www.youtube.com/playlist?list=PL5gRzHmN4Dg0Q9J9mMQwzVSbRnj2zWcUH Lets make a platformer in love2d]
 +
 +
[https://www.youtube.com/playlist?list=PLS9MbmO_ssyBAc9wBC85_WG9aT88KGxH8 Game Development for Complete Beginners Tutorial Series (Using Lua and Love2d)]
 +
 +
[https://www.youtube.com/playlist?list=PLM5EvDHhpyTcThnWfeP1459KelemQOBdG  How to (make games with) LÖVE]
 +
 +
===You Tube Videos:===
 +
 +
[https://www.youtube.com/watch?v=u6GWjojPQiM Simple coin collection game]
 +
 +
[https://www.youtube.com/watch?v=yKk-rODDD8Y&t=39s Love Tiled Maps]
 +
 +
[https://www.youtube.com/watch?v=3k4CMAaNCuk Mario type platformer]
 +
 +
[https://www.youtube.com/watch?v=2EZxOJmBY6M Love Game in 8 Minutes]

Revision as of 14:19, 18 December 2020

Download

Go to the main site for the Love engine:

love2d.org

The above site is not available in college so you can also download from here:

Love 64 Bit Zip

Love 32 Bit Zip

You should be able to extract these zip files into your compiled storage folder.

Love for Android

You can even get 'Love for Android' from the Google Play store. This will install the Love engine, you will then need to have a text editor in order to create the code:

Setup Love for Android

Getting Started

The Love game engine uses Lua, so make sure you catch up and learn the language. The link below is to the Lua wiki section, it covers all of the basics of Lua:

Lua Wiki Page

Making a Game

To make a minimal game:

  1. Create a folder for your game
  2. Open up your favorite text editor. Sublime Text is a pretty good one for all operating systems, and it has Lua support built in.
  3. Create a new file in the folder you just created, and name it main.lua.
  4. Put the following code in the 'main.lua' file, and save it:
function love.load()
    -- use to set up your game
end

function love.update(dt)
    -- dt is the elapsed time since last call
end

function love.draw()
    love.graphics.print("Hello World", 400, 300)
end

You can obviously add more functions, classes, variables to make your own game. But the key sections are 'love.load()', 'love.update(dt)', and 'love.draw()'.

Running Games

Within Windows software such as ZeroBrane Studio, Sublime Text 2, Notepad++, and SciTE allow you to launch the game from within their code editors.

Otherwise, the easiest way to run the game is to drag the folder onto either love.exe or a shortcut to love.exe. Remember to drag the folder containing main.lua, and not main.lua itself.

You can create a shortcut to do this; simply make a shortcut to love.exe, right-click on it and select 'Send to Destop' to create a shortcut:

Love shortcut.gif

On Windows, there is a special command-line option which will attach a console to the window, allowing you to see the result of print calls. So right click your shortcut, choose 'properties', and edit the target to include '--console' eg:

"C:\Program Files\LOVE\love.exe" --console

Tutorials

TRC

Love - Drawing shapes

Love - Drawing an Image

Love - Moving an object

Love - Animation

Love - Creating a Map

Love - Using a TMX Map

Love - Lemmings Movement

Love - Bomberman Concept

Love - GUI

External

Love Main Site

Here is the link for the Love Wiki:

Love Wiki Site

Here is the link for just the tutorials on the Love wiki site:

Love tutorials

Love Github Documentation

API Documentation

Browser for Example Code

Getting Started Book

Awesome Love2d

Awesome Love2d

Learn 2 Love

Learn 2 Love

Lua Breakout/Arkanoid

Breakout/Arkanoid

Simple Game Tutorials

Simple Game Tutorials

Harvard CS50

Games Development Course

YouTube playlist for this course: Harvard CS50 Games Development Tutorials

GitHub for this course: GitHub for these tutorials

Using Tiled in Love

Using Tiled in Love

You Tube

You Tube playlists:

Game Development in Love2D [Beginner Series!]

Lets make a platformer in love2d

Game Development for Complete Beginners Tutorial Series (Using Lua and Love2d)

How to (make games with) LÖVE

You Tube Videos:

Simple coin collection game

Love Tiled Maps

Mario type platformer

Love Game in 8 Minutes