dartgame 1.0.2 copy "dartgame: ^1.0.2" to clipboard
dartgame: ^1.0.2 copied to clipboard

A pygame inspired library.

example/example.dart

import 'package:dartgame/dartgame.dart' as dartgame;

void main(List<String> arguments) {
  final window = dartgame.Window("Hello world", 640, 480);
  final surface = dartgame.Surface.fromFile("lib/test.bmp");
  final clock = dartgame.Clock();

  bool running = true;
  dartgame.Event? event;

  while (running) {
    clock.tick(60);

    while ((event = window.pollEvent()) is dartgame.Event) {
      switch (event!.type) {
        case dartgame.EventType.quit:
          running = false;
          break;

        default:
          break;
      }
    }

    window.blit(surface, 0, 0);

    window.flip();
  }
}
2
likes
140
points
12
downloads

Publisher

unverified uploader

Weekly Downloads

A pygame inspired library.

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

ffi, sdl2

More

Packages that depend on dartgame