Would Cocos2d be the best option for HTML5 canvas games?

Hi,

I’m seriously considering Cocos2d to develop my next games. I have quite a lot of questions, I hope it’s fine.

I’d like to build videoslots games for HTML5 Canvas, using javascript.

Example:

My target is both desktop and mobile browsers, I’m not interested in apps.

Assuming the design is not a problem, from a programming point of view, is it possible to reach the quality seen in the example with Cocos2d?

Could such a game developed with Cocos2d possibly run at 60 fps on relatively old mobile devices? (e.g. iphone 5)

If so, would it require me to do a lot of manual optimization, or does Cocos2d take care of the optimization part?

I’d like to deal with JavaScript only, no C++ or anything else, am I in the right place?

Is JavaScript development in Cocos2d intuitive to a javascript developer or does it suffer from not being the only programming language for Cocos2d? e.g. does it implement certain logic and/or structures that exist in order to have a unified syntax for all the programming languages used for Cocos2d development? ones that could be done in a more straightforward way if JavaScript was the only programming language used for Cocos2d development?

I read in an old topic somewhere that TypeScript is not properly supported in Cocos2d. Is it still the case?

Is there a Layouts solution to help fit elements nicely in multiple resolutions?

Are games that are programmed in JavaScript need to be compiled in any way by Cocos2d? I’m not sure if that’d make sense since JavaScript is not a language you compile, but since Cocos2d is uses more than 1 programming language to target many platforms I’m not sure how it works.

Are there any tools that I need to learn in order to develop in Cocos2d or can I pretty much dive into writing JavaScript?

How does Cocos2d compare to other javascript canvas frameworks like Phaser? I’ve seen a few topics and opinions around but it’d be great to have an up-to-date answer.

Are there frameworks that are better suited to my needs?

Are there any other things I should know about Cocos2d given what I’d like to achieve? Anything I need to take into consideration? Any catches?

How’s the JavaScript community around here?

If you were referring to the video that played before the game as “High quality” then yes you can add prerendered videos without any problem, And the actual game itself is not overly complicated visually.Javascript is a first class language as far as Cocos creator goes, And typescript is going to be a part of for Cocos creator 1.5, Cocos creator(The editor is in English but the documentation is in Chinese) is already in Beta but it’s only released to the Chinese community for now assuming that the official English release is at the end of the month

there is best we were able to get in web with cocos http://playsolitaire.mobi/ a lot of torubles to make pixel perfect game with it.

Cocos2d is a good choice. There are other frameworks that will also work well. Phaser is one of those, and I would also like to mention Pixi, which is an excellent Java script game framework.

Reasons to use Cocos2D

  • Good visual creation tool (Cocos Creator)
  • Fairly small package size
  • Great animation toolset
  • Can be easily ported to a native app for IOS / Android / Win / Mac if you ever decide you want to

Reasons to not use Cocos2D

  • Other frameworks (like Pixi) have a more modern and clean codebase & API
  • If you want to mix in 3D with your 2D game (In this case, consider Unity or maybe Godot)
  • If you need a lot of help getting started, or want to purchase code components (Try Phaser or Unity)

Netent uses Pixi.js for their games. And you should take into account that for mobile and desktop versions of slot games you need different resources. There is a manufacturer of online slot games which use over 100 MB of resources for desktop and less than 15 MB for mobile for the same game.
Without good optimization in code and resources your games won’t work good on old devices…

1 Like

@rmg_nik Interesting. How could you tell Netent uses Pixi.js?

Regarding optimizations - of course, you are completely right.

I don’t know how Netent uses Pixi.js, but after game has been loading there is message “Pixi.js 3.0.8 - ✰ WebGL ✰ http://www.pixijs.com/ :heart::heart::heart:” in a developer console.

If it is not a secret - are you from some company or some startup or maybe an indie developer? Because creating of attractive slot games is very difficult task…

Pixijs is a rendering engine,So Pixi is used for all the graphics except for the opening video,that’s pre rendered

@rmg_nik Oh, I didn’t even think to look at the console, I went through all their source files.

I’m an indie developer, I have some experience in that area so I believe it’ll be doable, but I agree, the task is much more difficult than one might initially think.

Do you come from the slots industry?

@ht78 Yes of course, I wasn’t referring to the video.

Yes, I am from the slots industry) I’ve been creating slots for six years.