How to Make A Simple HTML5 Game With Enchant.js

Discussion of the official tutorials published on raywenderlich.com. Please only discuss the official tutorials here - for general questions, use the General Discussion forum instead.

How to Make A Simple HTML5 Game With Enchant.js

Postby rwenderlich » Tue Dec 11, 2012 11:00 am

This is the official thread to discuss the following blog post: How to Make A Simple HTML5 Game With Enchant.js
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
User avatar
rwenderlich
Team Member
Site Admin
 
Posts: 2221
Joined: Thu Dec 23, 2010 4:14 pm
Has thanked: 28 times
Been thanked: 359 times

Re: How to Make A Simple HTML5 Game With Enchant.js

Postby Lonan » Tue Dec 11, 2012 7:13 pm

nice tutorial. any plans to do more html5 game tuts? that would be great.
Lonan
Baby Hacker
 
Posts: 9
Joined: Wed Jun 01, 2011 1:01 pm
Has thanked: 0 time
Been thanked: 1 time

Re: How to Make A Simple HTML5 Game With Enchant.js

Postby guts » Wed Dec 12, 2012 5:02 pm

Thank you! I'd love to write more tutorial about html5 games. If there's any specific genre or topic you would like to see, please let me know :)
guts
Baby Hacker
 
Posts: 5
Joined: Thu Sep 06, 2012 7:32 am
Has thanked: 0 time
Been thanked: 3 times

Re: How to Make A Simple HTML5 Game With Enchant.js

Postby RedMak » Wed Dec 12, 2012 8:25 pm

great tutoriel(i don't follow it to the and :) ), but i run your demo at : http://www.raywenderlich.com/penguindive/ on my ipad 3 IOS 5.1 but no sound and ice boulders not appear :(
RedMak
Baby Hacker
 
Posts: 6
Joined: Thu May 03, 2012 11:07 am
Has thanked: 1 time
Been thanked: 0 time

Re: How to Make A Simple HTML5 Game With Enchant.js

Postby guts » Thu Dec 13, 2012 2:57 pm

Thanks! It's a pretty long one, so I understand. Take your time! :)

Unfortunately , audio is not working right now on pretty much most of the mobile html5 games. The enchant.js team has a plan to rewrite the whole audio engine system though. With iOS6 supporting Web Audio, hopefully we can play audio files on mobile HTMl5 games soon!

As for ice boulders not appearing, I'd have to test it with iOS 5.1. Currently I'm testing on iPad2 with iOS6 and it's working fine though. I'll see if I can find someone with iOS 5 device to test it.
guts
Baby Hacker
 
Posts: 5
Joined: Thu Sep 06, 2012 7:32 am
Has thanked: 0 time
Been thanked: 3 times

Re: How to Make A Simple HTML5 Game With Enchant.js

Postby kolpaque » Fri Dec 14, 2012 2:53 am

Will have to check this tutorial out sometime. But for now, just curious, is there any potential in making game using JavaScript, versus Box2D or Chipmunk with Cocos2D? What's the deal?
kolpaque
Uber Haxx0r
 
Posts: 83
Joined: Tue Apr 10, 2012 8:41 pm
Has thanked: 3 times
Been thanked: 0 time

iPhone5 screen

Postby tflawlis » Fri Dec 14, 2012 3:13 pm

Thanks for this tutorial... I have been focused on iOS for a while, so this stretched/awakened those HTML/JS skills. This also shows how easy it is to create a multiplatform app. Thanks for providing me some diversity. Question:

-iPhone5 Screen: How can I test for screensize so I can show a different background sized for the iPhone 5?

Is the short answer: "Check the documentation?" :) If so, I surely understand.

Thanks,
Frank
Last edited by tflawlis on Sat Dec 15, 2012 4:02 pm, edited 2 times in total.
tflawlis
Baby Hacker
 
Posts: 6
Joined: Fri Oct 26, 2012 9:32 pm
Has thanked: 6 times
Been thanked: 2 times

Amazing Tutorial!

Postby cyrilg » Fri Dec 14, 2012 9:21 pm

Thanks a lot for this epic tutorial! I just have a quick question, I have to develop a game for a client in HTML5. Would you recommend enchant.js or cocos2d-html5 ?
Cheers
cyrilg
n00b
 
Posts: 2
Joined: Fri Dec 14, 2012 9:17 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to Make A Simple HTML5 Game With Enchant.js

Postby guts » Sat Dec 15, 2012 4:33 pm

kolpaque wrote:Will have to check this tutorial out sometime. But for now, just curious, is there any potential in making game using JavaScript, versus Box2D or Chipmunk with Cocos2D? What's the deal?


If by potential you mean monetizing, I'd say there is. There are game portals that will buy rights to distribute HTML5 games on their website. For desktop HTML5, there are games that made with box2d with Javascript. However, it's still uncommon in mobile HTML5.

tflawlis wrote:Thanks for this tutorial... I have been focused on iOS for a while, so this stretched/awakened those HTML/JS skills. This also shows how easy it is to create a multiplatform app. Thanks for providing me some diversity. Questions:

1. Sound: So Web Audio is not currently supported on iOS 6.0.1. Are there any other options here?
2. iPhone5 Screen: How can I test for screensize so I can show a different background sized for the iPhone 5?

Is the short answer: "Check the documentation?" :) If so, I surely understand.

Thanks,
Frank

I'm glad you find it useful Frank! I think device will only be more and more powerful and HTML5 should be another fun and exciting platform in the future. It sure is a great time for Javascript developer :)

As for your questions, Web Audio IS supported on iOS 6.0.1, so it'll be easier if you only target iOS. While waiting for enchant.js team to implement their audio engine, you could try Sound Manager 2. We just tried it in our latest game and it works on iOS :)

For iPhone5 Screen, you'll have to rely on screen.availWidth and screen.availHeight.

Hope that helps!

cyrilg wrote:Thanks a lot for this epic tutorial! I just have a quick question, I have to develop a game for a client in HTML5. Would you recommend enchant.js or cocos2d-html5 ?
Cheers

You're welcome!

To answer your question, I'd personally go with enchant.js. I find it much easier to work with. There is no big dependency(just one enchant.js file), and the design is just much cleaner. The mobile support is also better.
The sample project of cocos2d html5 version 2.0 crashed on my iPod Touch after I played with it for a while. They've updated it to 2.1 so they might have fixed this already though.
Last edited by guts on Thu Dec 20, 2012 5:57 pm, edited 1 time in total.
guts
Baby Hacker
 
Posts: 5
Joined: Thu Sep 06, 2012 7:32 am
Has thanked: 0 time
Been thanked: 3 times

Re: How to Make A Simple HTML5 Game With Enchant.js

Postby cyrilg » Wed Dec 19, 2012 4:47 am

I just started playing with enchant.js, It is pretty amazing! One thing I cannot figure out is how to add a child to a sprite. I would have a build a game where you can customize an avatar with different body parts. Do you have any idea how to do it ?
Cheers
cyrilg
n00b
 
Posts: 2
Joined: Fri Dec 14, 2012 9:17 pm
Has thanked: 1 time
Been thanked: 0 time

Next

Return to Official Tutorials

Who is online

Users browsing this forum: Bing [Bot] and 14 guests