Uncategorized

love notes

Asked 
Active today
Viewed 34 times
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?

2 Answers

1

I’ll outline a couple of approaches but can’t promise either of them will work.

The .rpm I looked at contains a single executable1love-0.7.2, which does link to liblua, but not a version available in buster:

    > ldd love-0.7.2
    linux-vdso.so.1 (0x7edbb000)
    /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0x76e33000)
    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x76ce5000)
    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76cb8000)
    libopenal.so.1 => not found
    libfreetype.so.6 => /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0x76c15000)
    libGL.so.1 => not found
    libIL.so.1 => not found
    liblua5.1.so.5 => not found
    libmodplug.so.1 => not found
    libmpg123.so.0 => not found
    libSDL-1.2.so.0 => not found
    libvorbisfile.so.3 => not found
    libphysfs.so.1 => not found
    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76ace000)
    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76a4c000)
    /lib/ld-linux-armhf.so.3 (0x76f28000)

The “not found” stuff might be resolvable by searching apt packages, but there are some version mismatches. Installing close versions and symlinks have a long shot at working, but I suspect the openGL stuff will not be so easy.

You can try to build it from the source.

git clone --depth=1 https://github.com/love2d/love.git

There are directions on the github page; the first one failed for me:

> platform/unix/automagic

But with more patience you may be able to work out the problems…there are what look to be current wiki, forum, and IRC links on the github page.


  1. You can unpack rpms fairly easily: rpm2cpio love-0_7_2-0.7.2-3.5.armv7hl.rpm | cpio -idv, see https://unix.stackexchange.com/questions/61283/yum-install-in-user-home-for-non-admins/61295#61295

0

Question

How to find LÖVE?

/ to continue, …


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

/ to continue, …


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

/ to continue, …


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,

touch screen support,

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.

/ to continue, …


End of answer

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: