DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Web Gaming Technologies: Angry Birds' Cross-compiled Java Versus Native JavaScript

Web Gaming Technologies: Angry Birds' Cross-compiled Java Versus Native JavaScript

Axel Rauschmayer user avatar by
Axel Rauschmayer
·
May. 23, 11 · Java Zone · Interview
Like (0)
Save
Tweet
24.39K Views

Join the DZone community and get the full member experience.

Join For Free

After it became clear that Angry Birds was basically a true webapp with only a little Flash to overcome the limitations of web-based audio [1], more information came to light regarding the technology it is based on [2].

Cross-compiled Java

Following the naming school of “fun with double-entendres”, the technology is called “ForPlay”. Quoting the website:
ForPlay is a cross-platform game abstraction library for writing games that compile to:
  • Desktop Java
  • HTML5 Browsers
  • Android
  • Flash
[...] ForPlay is free and open source, and we hope you will make kick ass games with it!
That is, you write your game in Java and then can cross-compile it to Desktop Java, a webapp (via Google’s GWT), Android, or Flash. Quite impressive, even though some platform-specific code is always necessary. Creator Ray Cromwell gives a few more details:
The game is built on an abstraction (ForPlay) that allows it to use the optimal path for each browser. If WebGL is present, it uses that in order to achieve the highest framerates. If not, it falls back to 2d canvas, which is accelerated by the GPU on browsers these days, but not always guaranteed to be *fully* accelerated.

It is written in Java, developed and debugged as a Java desktop app, and then cross-compiled at the end step via GWT. Many things in the native version have been converted to more web friendly data formats, for example, data that was in XML or LUA format was converted to JSON.

Two of the ForPlay creators held a talk on the technology at Google I/O. Summary:
Kick-ass Game Programming with Google Web Toolkit

GWT does more than make awesome Enterprise Apps, it's a great tool for games too. Learn to write 2D and 3D games using HTML5 and GWT, leverage and port existing game libraries and physics engines, share game code between GWT and Android, publish to the Chrome Web Store, and of course, see demos of really neat GWT games in action.

A video [3] is online.

Native JavaScript

If Java is not your cup of ... tea, then Google will also help you: There was a talk on “pure” HTML5 game development at Google I/O. Summary:
Super Browser 2 Turbo HD Remix: Introduction to HTML5 Game Development

HTML5 provides the foundation for rich and interactive experiences. Which is great, but we really want to build and play games! Learn the basics of building an HTML5 game and explore the related technologies. We'll write a simple game and give you the tools and techniques to create your own worlds and fun.

Video [4] and slides [5] are online.

Related reading

  1. Why the Angry Birds webapp needs Flash
  2. FunctionSource: HTML5 Audio Issues; Why Some Flash Snuck Into Angry Birds [original source of this article]
  3. YouTube - Google I/O 2011: Kick-Ass Game Programming with Google Web Toolkit
  4. YouTube - Google I/O 2011: Super Browser 2 Turbo HD Remix: Introduction to HTML5 Game Development
  5. Super Browser 2 Turbo HD Remix: Introduction to HTML5 Game Development [slides]

 

From http://www.2ality.com/2011/05/web-game-tech.html

Java (programming language) IT JavaScript HTML Google Web Toolkit Google (verb)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How To Use Cluster Mesh for Multi-Region Kubernetes Pod Communication
  • Privacy and the 7 Laws of Identity
  • Slowness in Java Application Due To Increased FullGC Events: G1GC
  • Build a Seamless GitOps Pipeline with Flux

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo