LoginSignup
11
7

More than 5 years have passed since last update.

JavaScript でゲームを作りたい

Posted at

ゲームを作りたい

JavaScript も書けるようになってきた気がするので、いっちょゲームでも作ってみるかー

ライブラリの選定

ゲームエンジンと呼ばれるライブラリがたくさんあるので、ゲーム作るなら、どれかを選ばなければいけない。

特にスターが多いやつ

phaser 21345, 2D, HTML5, Canvas and WebGL
pixi.js 18614, 2D, HTML5, WebGL
Babylon.js 6555, 3D, WebGL
whs.js 4775, 3D, based on Three.js
PhysicsJS 3161,

上記の中でTop5

'melonJS',
'pixi.js',
'engine',
'Babylon.js',
'phaser',

上記三つ全てに含まれているエンジン

[ 'pixi.js',
  'phaser',
  'melonJS',
  'kiwi.js',
  'Crafty',
  'stage.js',
  'engine',
  'qiciengine' ]

いきなり 3D は難しそうだし、2D の有名どころの phaser, pixi.js あたりをあたってみようかな。特に以下の Phaser の紹介文(さっきの二つ目のリンク)がぐっときた。

Phaser.js will probably be your first option to start with the Games Development as it's very easy to use, they provide a lot of examples and doesn't require a lot of codebase to create your first game.

phaser と Pixi.js は仲が良いらしい

Phaser uses and contributes towards the excellent Pixi.js library for rendering

Phaser について調べる

バージョンが二つある?

Ver.3 系列と、コミュニティ版(CE版、Ver2ベース) とがあるらしい。両方とも MIT なオープンソース。主要開発陣が photonstorm というところらしいのだが、開発リソースを Ver3 につぎ込むので、 Ver2 系列のメンテをコミュニティに寄せたらしい。

Phaser v2 was built and maintained by Photon Storm and turned over to the community (as Phaser CE) in November 2016. Phaser v3 is in active development.

要は最新版を使うのであれば、 Ver 3+ のある、photonstorm/phaser を使えばよいということ。

Hello world

photonstorm/phaser のREADME に最初のアプリの作り方が書いてある。50行くらいのHTMLが公式のgist にある。

開発環境

  • 専用IDEとかいらないっぽい
  • TypeScript の定義ファイルがある。

Qiita

https://qiita.com/tags/phaser

投稿は頻繁とはいいがたい

11
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
7