Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/perigrin/perl-games-rot


https://github.com/perigrin/perl-games-rot

Last synced: 22 days ago
JSON representation

Awesome Lists containing this project

README

        

# Games::ROT

A Perl library inspired by [ROT.js](https://ondras.github.io/rot.js/hp/) the ROuglelike Toolkit for JavaScript/TypeScript.

## Synopsis

```perl
#!/usr/bin/env perl
use strict;
use lib qw(lib);
use Feature::Compat::Class;

use Games::ROT;

class Engine {
my $WIDTH = 800;
my $HEIGHT = 500;

field $display = Games::ROT->new(
width => $WIDTH,
height => $HEIGHT,
);

method render() {
my $x = $WIDTH / 2;
my $y = $HEIGHT / 2;

$display->draw($x, $y, 'Hello World', '#fff', '#000');
}
}

my $engine = Engine->new();
$engine->render();
```