我正在制作一个谜题游戏,两个立方体共用同一个控制器,具有碰撞等功能,但没有物理引擎。
但是,我注意到绿色立方体在右侧墙壁上检测出了64像素太接近了,正如照片中所见。
以下是我的代码:
if keyboard_check_pressed(ord("A"))
{
if place_free(x - 64, y)
{
global.x = 64
x -= global.x
}
}
if keyboard_check_pressed(ord("D"))
{
if place_free(x + 64, y)
{
global.x = 64
x += global.x
}
}
else
{
global.x = 0
}
请问您是如何解决这个问题的呢?
评论 (0)