1

I am reading " Developing Games on the Raspbery Pi" w Lua and Love by Seth Kenlon

I am trying to use my existing raspian stretch OS rather than starting with the OS the book suggests

Lua is already installed and working

now I would like to install the Love library

I have the Love rpm downloaded

How do I install it please?

  • Try apt install alien and then have a look at man alien (manpages.ubuntu.com/manpages/trusty/man1/alien.1p.html). – goldilocks Oct 19 at 14:35
  • @Dave, I read the following post saying that Love is not a library, but LUA scribble C++ functions: stackoverflow.com/questions/38851129/…. LUA 5.1.5 is already preinstalled in buster. I also remember also installed in stretch. But as the post says, you don't even need to install LUA. You just insert callbacks in the Love app and execute it. I am not surprised that you don't need Rpi LUA which is text only, no graphics. But I have not tried it, just guessing, 50% sure! :) – tlfong01 Oct 19 at 14:39
1

Question

How to find LÖVE?


Answer

Rpi4B buster 19sep > GUI Desktop > Preferences > Add / Remove Software > LÖVE 11.1-2


love 1


love 2


imgur love

From imgur with LÖVE

LÖVE Moving Wall Paper


References

(1) LÖVE 11.1 Mysterious Mysteries Documentation

(2) Lua - Wikipedia

(3) LUA Programming Manual 5.0

(4) LUA Reference Manual 5.3.5

(5) Big Dan's LUA Blog

(6) eLUA Project

(7) ESP8266-12 and NodeMCU LUA

(8) ESP8266-12 NodeMCU LUA Blinky Program 1/3

(9) ESP8266-12 NodeMCU LUA Blinky Program 2/3

(10) ESP8266-12 NodeMCU LUA Blinky Program 3/3

(11) Löve game engine - Wikipedia


Appendices

Contents

Appendix A - LÖVE Wiki and Hello World

Appendix B - LÖVE Newbie Start Up Guide

Appendix C - LÖVE Modules

Appendix D - Developing Game on Rpi, with LUA AND LÖVE Book – kenlon 2019

Appendix E - Löve Game Engine - Wikipedia


Appendix A - LÖVE Wiki and Hello World

LÖVE is a framework for making 2D games in the Lua programming language. LÖVE is totally free, and can be used in anything from friendly open-source hobby projects, to evil, closed-source commercial ones.

Hello World

This is the full source for 'Hello world' in LÖVE. Running this code will cause an 800 by 600 window to appear, and display white text on a black background.

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

Appendix B - LÖVE Newbie Start Up Guide

When beginning to write games using LÖVE, the most important parts of the API are the callbacks:

(1) love.load to do one-time setup of game,

(2) love.update to manage game's state frame-to-frame,

(3) love.draw to render game state onto screen.

More interactive games will override additional callbacks in order to handle input from the user, and other aspects of a full-featured game. LÖVE provides default placeholders for these callbacks, which you can override inside your own code by creating your own function with the same name as the callback:

-- Load some default values for our rectangle.

function love.load()
    x, y, w, h = 20, 20, 60, 20
end

-- Increase the size of the rectangle every frame.

function love.update(dt)
    w = w + 1
    h = h + 1
end

-- Draw a coloured rectangle.

function love.draw()
    love.graphics.setColor(0, 0.4, 0.4)
    love.graphics.rectangle("fill", x, y, w, h)
end

Appendix C - LÖVE Modules

(01) love.audio - audio interface for playback/recording sound.

(02) love.data - creating and transforming data.

(03) love.event - manages events, like keypresses.

(04) love.filesystem - interface to user filesystem.

(05) love.font - to work with fonts.

(06) love.graphics - drawing shapes and images, manageing of screen geometry.

(07) love.image - interface to decode encoded image data.

(08) love.joystick - interface to joystick.

(09) love.keyboard - interface to keyboard.

(10) love.math - maths functions.

(11) love.mouse - interface to mouse.

(12) love.physics - simulate 2D rigid body physics.

(13) love.sound - decoding sound files.

(14) love.system - access to user system info.

(15) love.thread - multi-threading.

(16) love.timer - high-resolution timing functions.

(17) love.touch - interface to touch-screen touches.

(18) love.video - decoding and streaming video files.

(19) love.window - interface for the program's window.

/ to continue, ...


Appendix D - Developing Game on Rpi: App Programming with LUA AND LÖVE Book – kenlon 2019

Developing Game on Rpi: App Programming with LUA AND LÖVE Book (Customer Review) – kenlon 2019

About this book

Learn to set up a Pi-based game development environment, and then develop a game with Lua, a popular scripting language used in major game frameworks like Unreal Engine (BioShock Infinite), CryEngine (Far Cry series), Diesel (Payday: The Heist), Silent Storm Engine (Heroes of Might and Magic V) and many others.

More importantly, learn how to dig deeper into programming languages to find and understand new functions, frameworks, and languages to utilize in your games.

You’ll start by learning your way around the Raspberry Pi. Then you’ll quickly dive into learning game development with an industry-standard and scalable language.

After reading this book, you'll have the ability to write your own games on a Raspberry Pi, and deliver those games to Linux, Mac, Windows, iOS, and Android. And you’ll learn how to publish your games to popular marketplaces for those desktop and mobile platforms.

Whether you're new to programming or whether you've already published to markets like Itch.io or Steam, this book showcases compelling reasons to use the Raspberry Pi for game development. Use Developing Games on the Raspberry Pi as your guide to ensure that your game plays on computers both old and new, desktop or mobile.

What You'll Learn

Confidently write programs in Lua and the LOVE game engine on the Raspberry Pi

Research and learn new libraries, methods, and frameworks for more advanced programming

Write, package, and sell apps for mobile platforms

Deliver your games on multiple platforms

Who This Book Is For

Software engineers, teachers, hobbyists, and development professionals looking to up-skill and develop games for mobile platforms, this book eases them into a parallel universe of lightweight, POSIX, ARM-based development.

Editorial Reviews From the Back Cover

Learn to set up a Pi-based game development environment, and then develop a game with Lua, a popular scripting language used in major game frameworks like Unreal Engine (BioShock Infinite), CryEngine (Far Cry series), Diesel (Payday: The Heist), Silent Storm Engine (Heroes of Might and Magic V) and many others. More importantly, learn how to dig deeper into programming languages to find and understand new functions, frameworks, and languages to utilize in your games.

You’ll start by learning your way around the Raspberry Pi. Then you’ll quickly dive into learning game development with an industry-standard and scalable language. After reading this book, you'll have the ability to write your own games on a Raspberry Pi, and deliver those games to Linux, Mac, Windows, iOS, and Android. And you’ll learn how to publish your games to popular marketplaces for those desktop and mobile platforms.

Whether you're new to programming or whether you've already published to markets like Itch.io or Steam, this book showcases compelling reasons to use the Raspberry Pi for game development. Use Developing Games on the Raspberry Pias your guide to ensure that your game plays on computers both old and new, desktop or mobile.

About the Author

Seth Kenlon is a teacher, artist, D&D dungeon master, free software and free culture advocate, and UNIX geek. He has worked in the VFX (The Hobbit, Deadpool, Valerian) and computing industry (IBM, Red Hat), often at the same time. He is one of the maintainers of the Slackware-based multimedia production project.

Amazon Customer Review: 1 out of 5 stars - 2019sep20

Dissapointing so far.

Just started reading chapter 2 and I am pretty disappointed with the mistakes I am finding in the text and printed code samples so far.

Question for the author: Seth Kenlon, have you read the printed release? There are issues with the text incorrectly referencing the printed screenshot (Figure 2-5 and Figure 2-6 - pages 26-27).

Also, some of the code samples printed in the book don't match what is discussed in the paragraphs (e.g. code listing at the top of page 40 has the line printed: love.graphics.draw(computer.img,cw*0.5,30,0,0.2,0.2), the "cw" was never described in the previous paragraphs leading up to this. "cw" was referencing the canvas width however, on page 29 the text states for the reader to use "view_w" for canvas width.

When we are instructed to run the code on page 40 it does not work. I had to refer to the github page only to discover the many errors which ended up in the printed code samples.

Apress needs to have an errata page for this book. I hope I don't run into more issues and I read on. If it gets worse, I'll be sending the book back for a refund. Not good quality control APRESS. What does this say about the author and the Technical Reviewer?


Appendix E - Löve Game Engine - Wikipedia

website: love2d.org

LÖVE (or Love2D) is an open-source cross-platform engine for developing 2D computer games. Designed in C++, it uses Lua as a programming language.

The API provided by the engine gives access to the video and sound functions of the host machine through the libraries SDL and OpenGL, or since version 0.10 also OpenGL ES 2 and 3.

Fonts can be rendered by the engine FreeType.

A version of the engine called piLöve, has been specifically ported to Raspberry Pi.

It also provides a basic "sandbox" management of the files in order to avoid giving access to all its disk to the executed games.

Features

support of Open GL pixel shaders GLSL,

support touch screen,

support UTF-8,

supports image formats PNG, JPEG, GIF, TGA and BMP

possibility to use the physics engine in 2D Box2D

luasocket library for network communications TCP/UDP,

lua-enet library, another network library implementing Enet, a reliable protocol based on UDP

native management of tiles created by the Tiled.


End of answer

  • Facepalm... I did check apt search love | grep lua before I tried all that hullabaloo with the RPM and source repo, and got a few things, but not the game dev library. Tried again to confirm to myself just now, same thing. Then I tried w/ grep -i (case insensitive) and lo, it caught "2D game development framework based on Lua and OpenGL". >_< Good for the OP anyway. – goldilocks Oct 20 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.