码迷,mamicode.com
首页 > 其他好文 > 详细

最近发现一个有意思的lua游戏引擎,名字叫love2d

时间:2016-02-14 15:22:25      阅读:332      评论:0      收藏:0      [点我收藏+]

标签:

Hi there! LÖVE is an *awesome* framework you can use to make 2D games in Lua. It‘s free, open-source, and works on Windows, Mac OS X, Linux, Android and iOS.

Open Source

LÖVE is licensed under the liberal zlib/libpng license. This means that:

  • It costs nothing.
  • You can use it freely for commercial purposes with no limitations.

The source can be found on Bitbucket.

Community

If you get stuck, many friendly people are ready to help you at the forums. Be warned, however, that it sometimes gets too friendly.

People also post their games and projects on the forums, so it‘s a nice way of exploring what LÖVE can do. Or at least what people choose to use it for.

There is also an IRC channel: #love@irc.oftc.net.

Examples

It’s pretty easy to get started with LÖVE, just check out these code snippets.

Drawing text
function love.draw()
    love.graphics.print("Hello World!", 400, 300)
end
Drawing an image
function love.load()
  whale = love.graphics.newImage("whale.png")
end
function love.draw()
  love.graphics.draw(whale, 300, 200)
end
Playing a sound
function love.load()
    sound = love.audio.newSource("music.ogg")
    love.audio.play(sound)
end

 

Check out some more tutorials on the wiki.

最近发现一个有意思的lua游戏引擎,名字叫love2d

标签:

原文地址:http://www.cnblogs.com/leezj/p/5189003.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!