【发布时间】:2017-08-03 00:56:16
【问题描述】:
如何使用 LOVE Physics for Lua 禁用某些物理实体的重力?
blocks.ground.body = love.physics.newBody(world, 0, blocks.ground.y, "dynamic")
blocks.ground.shape = love.physics.newRectangleShape(500, 50)
blocks.ground.fixture = love.physics.newFixture(blocks.ground.body, blocks.ground.shape)
blocks.ground.color = {86,176,0}
这是我当前的身体代码,我还需要它保持“动态”,因为我需要移动它的 X
查看完整代码: code
【问题讨论】:
-
你能发布更多代码吗?比如你如何定义集合。
-
hastebin.com/ofusilozim.lua 我知道这不是最好看的代码,但这是我的第一个 lua 游戏之一,所以我还在学习
-
没关系。它是一种有趣的学习语言。不过,能够查看完整的代码很有用。我建议将该行添加到您的问题中,例如 View Full Code: --> link
-
请在问题中包含一个最小的可执行示例,而不是链接到外部网站。外部链接容易出现比特腐烂,将来可能无法使用。有关详细信息,请参阅 Meta 上的 this discussion。