为什么(几乎)所有在线游戏都是用 ActionScript(Flash)而不是 Java 编写的?

发布于 2024-08-25 04:17:36 字数 608 浏览 6 评论 0原文

我绝对喜欢优秀防守游戏(例如《Gemcraft》、《保护者:夺回王座》),因为它们在智力上非常具有挑战性;这就像下棋,但少一点思考,多一点行动。遗憾的是,没有那么多好的,我想我应该自己创建一个,并通过在线提供它与世界其他地方分享。

我从未使用过 ActionScript,但当涉及到在线游戏时,这是主要选择。我试图以 Java 小程序的形式找到一款像样的 2D 游戏,但没有成功。为什么会这样呢?我可以在 Delphi for Win32 中最轻松地编写游戏,但随后人们需要下载可执行文件,这可能会阻止某些形式下载它,而且它只能在 Windows 上运行。我对 Java 也很熟悉,在过去四年左右的时间里我一直在使用 Java;虽然,我在游戏编程方面没有太多经验。

我是否应该因为所有在线游戏都是用 Flash 编写并将我的防御者游戏创建为 Java 小程序这一事实而被阻止,或者我是否应该考虑学习 ActionScript 和 ActionScript 虚拟机的游戏开发(AS3 看起来非常就像 Java...但是,它对我来说仍然是一项全新的技术,我可能永远不会专业地使用它。)

您能回答一下标题中的问题吗? 为什么使用 Flash,而不是 Java 小程序?难道只是“政治”吗?

I absolutely love good defender games (e.g. Gemcraft, Protector: reclaiming the throne) as they can be intellectually quite challenging; it's like playing chess but a little less thinking and a bit more action. Sadly, there are not that many good ones out there and I thought I would create one myself and share it with the rest of the world by making it available on-line.

I have never worked with ActionScript but when it comes to on-line games, this is the main choice. I have tried to find a decent 2D game in the form of a Java applet but to no avail. Why is this so? I could write the game, most comfortably, in Delphi for Win32 but then people would need to download the executable, which could deter some form downloading it, and also it would only work on Windows. I am also familiar with Java, having worked with Java for the last four years or so; although, I don't have much experience with games programming.

Should I not be deterred by the fact that all on-line games are written for in Flash and create my defender game as a Java applet, or should I consider learning ActionScript and games development for the ActionScript Virtual Machine (AS3 looks very much like Java... but still, it's an entirely new technology to me and I might never use it professionally.)

Could you, please, just answer the the question in the title? Why Flash, not Java applets? Is it only 'politics'?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

大海や 2024-09-01 04:17:36

Flash 更受欢迎,因为其渗透率巨大

Flash 在创建和集成图形资源方面也更加强大(因为 Flash CS* 也是矢量动画编辑器)。
嵌入声音和字体资源、使用位图效果也非常容易,无需使用任何额外的库。

最后但并非最不重要的一点是,有很多网站提供 ActionScript API,以便通过在游戏中添加各种广告来赚钱(例如 MochiMediaKongregate...)

Flash is more popular since its penetration rate is huge.

Flash is also more powerful when it comes to create and integrate graphics assets (since Flash CS* is also a vector animation editor).
It's also very easy to embed sounds and fonts assets, to play with bitmap effects, without using any aditional library.

And last but not least, there's a lot of sites who offers ActionScript APIs in order to earn money with your games by adding various ads in it (such as MochiMedia, Kongregate...)

箹锭⒈辈孓 2024-09-01 04:17:36

Flash 提供了一个完整的图形和声音引擎,可以处理路径和动画上的单独对象(“精灵”)。

在 Java 中,这些功能需要由第三方库提供。然而,Java 确实提供了构建这样一个引擎所必需的基石。

然而,JavaFX 可能会改变这一点。

Flash provides a fully-built graphics and sound engine that will handle separate objects ("sprites") on paths and animation.

In Java those features would need to be provided by third-party library. Java does provides the necessary building stones to build such an engine, however.

JavaFX might change this, however.

离旧人 2024-09-01 04:17:36

我可以提供一些关于 Java 方面的见解:在 Java 历史的早期,Sun 试图将 Java 小程序作为在浏览器中显示动态内容的新方式。由于以下因素的结合,这一尝试注定要失败:

  • Java 的 (JRE) 运行时加载时间过长(并且仍然如此);
  • Java 最初只有 AWT 作为 GUI 工具包,而 AWT 的功能有限且非常丑陋;
  • 在更快的 CPU 和 JIT 编译出现之前,Java 的运行速度要慢得多;
  • Java(许多人认为是故意的)在 IE 中得到了微软的半心半意的支持,因此它没有得到很好的集成并且运行很差。

所有这些都给 Java 带来了(当之无愧的)可怕的声誉,桌面和浏览器 Java 至今还没有从这个声誉中恢复过来。对于大多数人来说,Java 代表着丑陋、缓慢且经常无法运行的应用程序。时至今日,它仍然遭受着这种耻辱。

虽然 Java 和 Flash 都是图灵完备的编程环境,但 Java 更加通用,拥有更多用于各种不同目的的库。 Sun 努力让 Java 环境在平台之间通用,因此浏览器端 Java 包含了许多通常不需要的库。再次,更多的加载时间。

I can provide a little insight on the Java side: Early in the history of Java, Sun tried to push Java applets as the new way to display dynamic content in a browser. This attempt was doomed to failure by the combination of the following factors:

  • Java had (and still has) a lengthy load time for the (JRE) runtime;
  • Java originally had only AWT as a GUI toolkit, and AWT is limited and really ugly;
  • Java used to be a lot slower before the advent of faster CPUs and JIT compiling;
  • Java was (many think intentionally) supported very half-heartedly by Microsoft in IE, so it wasn't well integrated and ran poorly.

All this gave Java (deservedly) a horrible reputation, from which desktop and browser Java have still not recovered. To most people, Java stands for ugly, slow and often not working applications. It still suffers from this stigma today.

While both Java and Flash are Turing complete programmng environments, Java is more universal, with a bigger set of libraries for all kinds of different purposes. Sun strove to have the Java environment be universal among platforms, so browser-side Java includes a lot of libraries that are usually not needed. Again, more load time.

小鸟爱天空丶 2024-09-01 04:17:36

简单回答:几乎所有 PC 上都安装了 Flash 播放器,但 JRE 没有安装。

Simple answer: the flash player is installed in almost all of PCs, but JRE isn't.

你的笑 2024-09-01 04:17:36

Flash 拥有更广泛的安装基础,这可能是唯一的原因。我个人不会在我的机器上安装 Java……当然是 flash。

为什么要为小得多的受众写一些东西?我并不是说这样做是错误的,但这通常是你为了盈利而制作游戏的原因。

想想游戏机的情况,在第二代游戏机中,有可用的硬件附加组件……但除非游戏使用它们,否则它们毫无用处。作为游戏开发者,你有 3 个选择,将其与你的产品打包在一起 - 推高价格,假设他们有 - 较小的受众,或者假设他们没有 - 最大受众,最大利润。结果是硬件从来没有真正卖出多少,因为作为游戏开发者,你必须假设他们没有它。

对我来说,这相当于 Java 与 Flash,如果我必须安装它,我访问它的价格就会上涨……假设他们有最常见的东西,而且你是安全的,最低的进入成本,最大的受众。

但是,如果你有一款很棒的游戏,我可以说服你安装:)

Flash has a much wider install base, that can be the only reason. I personally don't install Java on my machines....flash, of course.

Why write something for a far smaller audience? I'm not saying it's wrong to, but that's usually the reason when you're making games for a profit.

Think of this equivalent with consoles, with the second generation playstation there were hardware add-ons available...but they were useless unless the games used them. You had 3 options as a game developer, package it with your product - driving the price up, assume they have it - smaller audience, or assume they don't - maximum audience, maximum profit. The result is the hardware never really sold much because as a game developer you had to assume they didn't have it.

For me, that equates that to Java vs Flash, if I have to install it, the price for me accessing it goes up...assuming they have the most common thing and you're safe, minimum cost of entry, maximum audience.

However, if you have a great game, I could be convinced to install :)

神妖 2024-09-01 04:17:36

Flash 通常在游戏所需的绘图、动画和视频功能方面表现更好,因为这就是它最初设计的目的。此外,Java 语言的严格面向对象性质并不适合游戏常见的那种临时快速开发环境。

更重要的是,从作者的角度来看,Flash 是迄今为止最常用的浏览器插件。 Java只是在桌面上没有渗透力。小程序历来因其不稳定和性能差(尤其是启动缓慢)而受到鄙视;虽然这种情况有所改善,但 Sun 仍在继续破坏用户对其令人讨厌的捆绑更新程序的接受度。这是一家勇敢的公司,现在为桌面 Java 开发了很多东西。

我应该考虑学习 ActionScript 和 ActionScript 虚拟机的游戏开发

JavaScript/ActionScript 绝对值得学习。 (它们几乎是相同的语言,共享标准化的公共核心。)然后您可以将 Flash 脚本知识应用到浏览器脚本中。您甚至可以考虑用 JavaScript/HTML 本身实现游戏!

AS3 看起来非常像 Java...

因为它是一种类似 C 的语言,是的。然而,概念和实践有很大不同;如果你尝试像 Java 一样编写 JS/AS,你将会遇到困难。

Flash typically performs better at the kind of drawing, animation and video features that games require, since that's what it was originally designed for. In addition, the strict-OO nature of the Java language does not lend itself well to the kind of ad-hoc rapid development environment that is common for games.

More importantly from an author's point of views, Flash is by far the more commonly-deployed browser plugin. Java just doesn't have the penetration on the desktop. Applets were historically despised for their instability and poor performance (particularly slow startup); whilst that has improved somewhat, Sun are continuing to undermine what user acceptance they have left with their obnoxious bundling updater. It is a brave company that develops anything much for desktop Java these days.

should I consider learning ActionScript and games development for the ActionScript Virtual Machine

It's definitely worth learning JavaScript/ActionScript. (They're almost the same language, sharing a standardised common core.) Then you can apply your Flash scripting knowledge to browser scripting. You can even consider implementing games in JavaScript/HTML itself!

AS3 looks very much like Java...

In as much as it's a C-like-language, yes. However the concepts and practice are very different; you'll have difficulty if you try to write JS/AS like Java.

小忆控 2024-09-01 04:17:36

许多 Flash 开发人员都是跨界制作游戏的设计师。他们在编程工具之前使用闪存作为设计工具。

另外,现在用 Flash 编写网络游戏似乎是一个先例,所以我想人们不想偏离“规范”

A lot of flash developers are designers who have crossed over into making games. They used flash as a design tool before a programming tool.

Plus it seems to be something of a precedent now for online games to be written in flash so I guess people do not want to deviate from "the norm"

合约呢 2024-09-01 04:17:36

未来的Flash CS5可以直接创建iPhone应用程序,因此您将同时为2个平台创建游戏。

Future Flash CS5 could creates iPhone applications directly, so you'll be creating games for 2 platform at the same time.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文