DEV Community

loading...
Cover image for Hello lövely world

Hello lövely world

Talles L
A Brazilian software developer 🇧🇷 that loves to play video-games 🎮, tries it best to be active on GitHub 💻, and sometimes writes here on DEV 📄
・1 min read

Install LÖVE, then:

mkdir my-little-game
cd my-little-game
touch main.lua
# edit main.lua as you please
love .
Enter fullscreen mode Exit fullscreen mode

Hello world:

function love.draw()
    love.graphics.print("Hello World!")
end
Enter fullscreen mode Exit fullscreen mode

With a color:

green = {0, 255, 0}

function love.draw()
    love.graphics.print({green, "Hello World!"})
end
Enter fullscreen mode Exit fullscreen mode

With many colors:

green = {0, 255, 0}
red = {255, 0, 0}
orange = {255, 165, 0}
yellow = {255, 255, 0}
green = {0, 255, 0}
blue = {0, 0, 255}
indigo = {75, 0, 130}
violet = {238, 130, 238}

function love.draw()
    love.graphics.print({red, "R", orange, "A", yellow, "I", green, "N", blue, "B", indigo, "O", violet, "W"})
end
Enter fullscreen mode Exit fullscreen mode

Discussion (0)