【问题标题】:Use image_xscale to slow down speed GameMaker Studio使用 image_xscale 减慢速度 GameMaker Studio
【发布时间】:2015-06-24 11:45:13
【问题描述】:

使用每次物体与某个物体碰撞时都会增加的 image_xscale,如何使用增加的 image_xscale 使其速度下降?一个例子是 agar.io,当圆圈变大时,圆圈会变慢。我将为此使用什么使用 image_xscale 的方程?

我尝试过这样的事情:

speed = image_xscale * -speed

但这不起作用。有什么想法吗?

【问题讨论】:

    标签: game-maker


    【解决方案1】:

    你可以使用类似的东西:

    speed = start_speed - image_xscale * k;
    

    start_speed 是您的正常速度,没有减速。

    k 是定义减速因素的值。

    您也可以添加max() 来定义可能的最小速度(因为速度不能等于0):

    speed = max(1, start_speed - image_xscale * k);
    speed = max(1, 10 - image_xscale * 0.5);
    

    【讨论】:

      猜你喜欢
      • 2019-08-31
      • 1970-01-01
      • 2014-09-20
      • 2017-09-18
      • 2013-04-16
      • 2011-10-04
      • 2012-02-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多