![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
lua
i-mfox
最重要的是在于你自己有没有觉悟和恒心
展开
-
Lua 中实现 OO 的一种方案
-- @作者: baidwwylocal _Class = {}--保存父类local function __Call(t, ... )--免".new" return t.new(...)endlocal function _Create(self,ct,...)--构造函数 for i,v in ipairs(ct.super) do _Create(self转载 2015-04-25 17:27:25 · 750 阅读 · 0 评论 -
碰撞检测算法:点和矩形碰撞、矩形碰撞
以下代码Lua可直接调试.点与矩形碰撞-- 点与矩形碰撞function testPoint(x0,y0,w0,h0,x1,y1) return x1 >= x0 and x1 <= x0 + w0 and y1>=y0 and y1 < y0 + h0end矩形碰撞-- 矩形碰撞function testRect(x0,y0,w0,h0,x1,y1,w1,h1) return转载 2016-04-15 16:57:04 · 3305 阅读 · 0 评论 -
LOVE2D中实现一个简单的摇杆
转自:http://blog.csdn.net/jkevin2016/article/details/52885137local local_class = class() --这里用到云风的CLASS代码local gr=love.graphicslocal function getDistance (pointO,pointA ) distance = math.pow((po转载 2017-05-23 18:15:08 · 512 阅读 · 0 评论 -
LOVE2D android竖屏的问题
function love.load() --非原创,这里使用shader进行翻转local code = [[ mat4 rotatev = mat4( vec4(-0.000000, 1.000000, 0.000000, 0.000000), vec4(-1.000000, -0.000000, 0.000000, 0.000000), vec4(0.0转载 2017-05-11 13:51:05 · 690 阅读 · 0 评论