dartgame 1.0.1
dartgame: ^1.0.1 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) {
while ((event = window.pollEvent()) is dartgame.Event) {
switch (event!.type) {
case dartgame.EventType.quit:
running = false;
break;
}
}
window.blit(surface, 0, 0, 640, 480, 0, 0, 256, 256);
window.flip();
clock.tick(0);
}
window.destroy();
surface.destroy();
}