0

这实际上不必只在 JavaScript 中,而是在可以制作游戏的所有语言中。我只是不明白。我只是不明白这样的事情:

B.Gd = function () {
    var a = this.na,
        b = this.Hb(),
        c = this.ba || 1,
        d = c / a,
        e;
    if (this.b) {
        this.xb && this.xb.contains(b) && (e = Ka(this.xb.size()) / Ka(b.size())) && 1.6 > e && 0.5 < e ? b = this.xb : 1 != this.He && 0 != this.g.length && (this instanceof C || b.expand(12, 12, 12, 12));
        this.xb = b;
        var f = b.size();
        e = f.e()
            .scale(c)
            .ceil();
        if (this.b.width != e.width || this.b.height != e.height) this.b.width = e.width, this.b.height = e.height, this.Lb = 1;
        var g = this.C.e();
        this.m[D] && (g = this.m[D]);
        0 != e.width ? g.scale(f.width * d / e.width) : g.scale(1 / a);
        a = E(this);
        this.Vb = (a.left - b.left) * c;
        this.Wb = (a.top - b.top) * c;
        b = this.f()
            .e();
        a = this.Y;
        b.width *= a.x;
        b.height *= a.y;
        b = b.scale(c);
        c = this.d.e();
        this.m[F] && (c = this.m[F]);
        c.x *= d;
        c.y *= d;
        c.x -= b.width + this.Vb;
        c.y -= b.height + this.Wb;
        Oa(this.b, 100 * ((this.Vb + b.width) / e.width), 100 * ((this.Wb + b.height) / e.height), k);
        !this.T[F] && (!this.T[D] && !this.T[Pa]) && (d = -(this.J %= 360), s(this.m[Pa]) && (d = -this.m[Pa]), Qa(this.b, Ra(new Sa, 0.1)
            .translate(c.x, c.y)
            .scale(g.x, g.y)
            .rotate(d)));
        this.Lb && (d = this.b.getContext("2d"), c = this.ba || 1, d.clearRect(0,
        0, e.width, e.height), d.save(), d.translate(this.Vb, this.Wb), d.scale(c, c), e = this.f(), g = this.Y, d.translate(e.width * g.x, e.height * g.y), this.q.Zc.call(this, d), d.restore(), this.Lb = 0)
    }
};

最终会变成一场游戏。当我查看诸如以下游戏的源代码时,我总是感到惊讶:“http://www.limejs.com/static/zlizer/index.html”这是我从(http ://www.limejs.com/static/zlizer/zlizer.js)。我只想知道,有人能理解吗?谁能向我解释人们是如何写这种东西的?如果我要制作游戏,我将不知道如何开始。或者结束。

对于那些真正制作了需要数学的游戏的人来说,这更像是一个问题。

你们是怎么做到的?这太神奇了,看起来太难了。我不打算制作游戏,这只是我想知道的一个问题,我想要某种答案。

4

1 回答 1

3

这段代码可能没有那么复杂。我会假设代码已经过混淆处理。作者不想让你看。

于 2013-01-01T03:18:12.457 回答