DEV Community

Cover image for Hello lövely world
Talles L
Talles L

Posted on

Hello lövely world

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

Top comments (0)