【问题标题】:How to create isometry imitation in 2d Racing game?如何在 2d 赛车游戏中创建等距模拟?
【发布时间】:2010-07-12 12:09:49
【问题描述】:

如何将 2d 赛车游戏修改为等距? Flash + ActionScript3

ScreeShot

游戏完全是二维的。汽车按应有的方式移动,当它在地面行驶时,一切都很好。 我添加了一个灰色坡道。现在汽车应该像箭头所示那样移动,产生 3d(等距)的错觉。

斜坡分为 3 个扇区

-第一个,向右的扇区(汽车当前所在的位置);

-第二个,向左的扇区;

-第三,扇区在顶部;

另外,我需要汽车,在高速时从坡道跳出来。我指的是旧的 scholl 游戏 Rock'n'Roll Racing(Sega 的暴雪游戏)

所以问题是

1) 在坡道上行驶时,我应该如何改变汽车的角度和速度(velocityX 和velocityY)

2) 如何开始跳出坡道?例如在摇滚赛车中?或者暴雪本质上是如何做到的?(也许是建议)

谢谢。

【问题讨论】:

    标签: flash 2d actionscript-3 isometric


    【解决方案1】:

    最好的方法是在 3D 中计算游戏,然后简单地将其投影到等轴测图中。

    const angle:Number = Math.PI/3;//you may want to tweak this one
    const xVec:Point = Point.polar(-Math.PI/2 + angle, 1);
    const yVec:Point = Point.polar(-Math.PI/2 - angle, 1);
    const zVec:Point = new Point(0, -1);
    

    将 3D 转换为 2D:

    function transform(x:Number, y:Number, z:Number):Point {
         return new Point(x*xVec.x + y*yVec.x + z*zVec.x, x*xVec.y + y*yVec.y + z*zVec.y);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-25
      相关资源
      最近更新 更多