【问题标题】:MACROS in gamemaker function throwing error游戏制作者功能中的 MACROS 抛出错误
【发布时间】:2021-03-26 09:27:24
【问题描述】:

此代码 var within_rangex = is_within(x,o_player.x,PLAYER_REACH);

抛出错误

得到';' (;) 预期的 ','

我不知道为什么,使用幻数时不会抛出错误。

编辑: 定义 PLAYER_REACH 的脚本。

// This Script Contains Code To Create enums And macros

function enums(){
    enum states{
        normal,
        jumping
    }
    
    #macro TILE_REFRESH_RATE    10; // How Often Will A Tile Update Accure
    #macro PLAYER_REACH         64; // How Far Can The Player Reach
}

【问题讨论】:

  • 您需要向我们展示PLAYER_REACH 的定义方式/位置。

标签: function macros game-maker-studio-2 game-maker-language


【解决方案1】:

我找到了。在 MACROS 中不能使用分号。永远忘记这一点。

这是固定代码。

// This Script Contains Code To Create enums And macros

function enums(){
    enum states{
        normal,
        jumping
    }
    
    #macro TILE_REFRESH_RATE    10; // How Often Will A Tile Update Accure
    #macro PLAYER_REACH         64; // How Far Can The Player Reach
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-28
    • 1970-01-01
    • 1970-01-01
    • 2020-02-10
    • 1970-01-01
    相关资源
    最近更新 更多