主:LUA尝试调用Box2D_Init为nil值,为什么?
编辑:显然我没有正确安装库? (我的爱情版本是11.4)。也许我应该将问题重命名为如何正确安装此库。但是,也许还有更多关于导致此错误的真相(我一直陷入困境2天,我不知道为什么作者只会将这个错误排除在公开之外
) https://github.com/karai17/simple-tiled-implementation/ Tree/Master/STI
我将其与我的Main.lua相同的目录,其文件结构与Git完全相同
local push = require "push"
local fsm = require 'statemachine'
local sti = require 'sti'
function love.load()
push:setupScreen(common_res[3][1], common_res[3][2], my_w, my_h, {fullscreen = false})
map = sti("untitled.lua")
local layer = map:addCustomLayer("Sprites", 4);
local player
for k, object in pairs(map.objects) do
if object.name == "player" then
player = object
break
end
end
love.physics.setMeter(32);
world = love.physics.newWorld(0,0)
map:box2d_init(world);
EDIT: obviously I didnt install the library correctly? (my version of love is 11.4). perhaps i should rename the question to how do i properly install this library. but maybe there are more truths to be found as to what causes this error(i've been stuck at it for 2 days and i can't figure out why the author would just leave this bug out of the open)
the library in question
https://github.com/karai17/Simple-Tiled-Implementation/tree/master/sti
i have it on the same directory as my main.lua with the exact same file structure as in the git
local push = require "push"
local fsm = require 'statemachine'
local sti = require 'sti'
function love.load()
push:setupScreen(common_res[3][1], common_res[3][2], my_w, my_h, {fullscreen = false})
map = sti("untitled.lua")
local layer = map:addCustomLayer("Sprites", 4);
local player
for k, object in pairs(map.objects) do
if object.name == "player" then
player = object
break
end
end
love.physics.setMeter(32);
world = love.physics.newWorld(0,0)
map:box2d_init(world);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)