LoginSignup
1
2

More than 5 years have passed since last update.

Dart x simplegamelib でミニゲームを作成してみる

Last updated at Posted at 2015-12-24

僕自身、ミニゲーム用のライブラリでも作ろうかなぁ〜。的な事を考えてた時に出会ったライブラリ。

実際に、作りたいミニゲームって、このくらいの機能で実現できるものではないですか?
そんな方は、simplegamelib を使いましょう。コードも少ないから、全てコントロールできると思いますよ!!

試してみよう

$ git clone https://github.com/daftspaniel/simplegamelibdemos
$ cd simplegamelibdemos
$ pub get
$ pub upgrade
$ pub serve 

Dartiumで開くと、以下のように表示されます。

スクリーンショット 2015-12-24 23.20.09.png

スクリーンショット 2015-12-24 23.20.29.png

コードもみてみましょう。

キャニクターが左から右へ移動するデモ1のコードをみてみましょう。

import 'dart:html';
import 'package:simplegamelib/simplegamelib.dart';

void main() {
  Game game = new Game("My Game", '#surface');
  Sprite player = game.createSprite("images/ninjadude.png",48,48);

  player
    ..position = new Point(0, 10)
    ..movement = Movements.east;
  print('starting game...');

  game.start();
}

超シンプルですね。

ほそく



Kyorohiro Work
http://kyorohiro.strikingly.com/

1
2
1

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
1
2