Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Applet vs Canvas - Java vs JavaScript

Hi im going to be creating my first java game soon and I was just wondering wether it would be best for me to code it all in .js and render it onto a canvas in a html document or to code it all in java and make an applet and then compile it and place the applet onto the page?

5 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hi Luke Ward,

I could be wrong about this, but I think Java applets are generally falling out of favor. Most developers I talk to seem to be much more interested in producing games with canvas and JavaScript.

Andrew Chalkley and Jim Hoskins are pretty awesome at JavaScript, so they may be able to point you to some decent resources for this. :)

Thanks Nick I think I will just invest in impacts and see where it goes from there :)

Andrew Chalkley
STAFF
Andrew Chalkley
Treehouse Guest Teacher

The most popular game I know written in Java is Minecraft, but I think that's the exception not the rule.

Playing games on the net in the 90s games and apps, like chats, were primarily Java. Then the Web Community transitioned to Flash, and now to JavaScript and HTML5.

I know Randy Hoyt has been learning HTML5/JS games recently, I think he did one in LimeJS.

Several game engines have been ported to JavaScript too now.

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

You should definitely write it in JavaScript. I would recommend using a framework or library of some kind. Here's a great post comparing three different frameworks:

I'll be doing a workshop at Treehouse on using LimeJS, but all three of these are good. I probably wouldn't start with Impact just because it's not free; I'd probably build a simple game on a free one first just to get a feel for what it's like. Then you'll have a better idea of what you want out of a framework. There are new frameworks coming out all the time. Here are two that I'm really excited about:

I have been looking at Limejs and would love to see the sorts of things you can do with it so ill probably have a go with it and see what I can do thanks for your help :)