cobblestone 0.3.3

  • Readme
  • Changelog
  • Installing
  • 46

cobblestone #

A Dart game framework inspired by LibGDX.

Cobblestone provides the basic features of game rendering, audio playing, and asset management, allowing the user to build any sort of gameplay without worrying about these lower level features.

More advanced features of the engine include:

  • Texture Atlas support, as created by the LibGDX TexturePacker
  • Tween animations
  • Bitmap Font Rendering
  • Tiled .tmx map loading and rendering
  • Particle systems, as exported by the PixiJS Particle Editor
  • Custom rendering, including framebuffers, glsl shaders, or a fully custom pipeline

License #

Cobblestone is licensed under the MIT License.

Issues and Contributing #

Feel free to report any bugs, or make suggestions for improvements on the Issue Tracker.

Also take a look at the Contribution Guide.

Demos #

Engine demos can be found here or by cloning the repo and running pub serve example.

Other examples can be seen in these Ludum Dare entries. Be warned, most of those use older engine versions and will not compile with the latest updates.

Tutorials and Getting Started #

The Wiki on GitLab hosts tutorials and guides for using the framework.

The Basic Game Tutorial goes over the full process of setting up a project and creating a game.

Full code documentation will be available online once the package is published to pub. In the meantime, documentation can be viewed by cloning the repository and running dartdoc.

Changelog #

0.3.3 #

  • Added enableHDPI variable in BaseGame to configure High DPI support
  • Added pixelRatio property to help with accounting for DPI in rendering
  • Added isInt parameter to setUniform to allow integers and doubles to be distinguished in setting uniforms

0.3.2 #

  • Internal renaming of imported libraries

0.3.1 Minor Typing #

  • Replaced num with int or double where those types were clearly expected
  • Most notably, texture and viewport widths are required to be int

0.3.0 The Great Tilemap Update #

Tilemaps #

  • Added support for loading objects in maps
  • Added support for loading custom properties on objects, maps, layers, tiles, etc.
  • Added support for external tilesets
  • Added support for padding and margins in tilesets
  • Added support for extruded tilesets made using the Phaser Tile Extruder to fix bleeding
  • Now requires tileset or atlas to be passed to loadTilemap

Graphics #

Texture #

  • Changed the split method to support padding and margins

Texture Atlases


  • Renamed from PhysboxBatch
  • Added support for drawing different kinds of MapObjects
  • Added support for different colors per object

Other #


  • Added getLoading and hasLoaded to better support asset dependencies

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  cobblestone: ^0.3.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:cobblestone/cobblestone.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 6, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Fix lib/src/assets/parsers.dart. (-0.50 points)

Analysis of lib/src/assets/parsers.dart reported 1 hint:

line 11 col 17: The value of the field '_literal' isn't used.

Fix lib/src/audio/music.dart. (-0.50 points)

Analysis of lib/src/audio/music.dart reported 1 hint:

line 12 col 26: The value of the field '_context' isn't used.

Format lib/cobblestone.dart.

Run dartfmt to format lib/cobblestone.dart.

Fix additional 27 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/assets/asset_manager.dart (Run dartfmt to format lib/src/assets/asset_manager.dart.)
  • lib/src/assets/texture_atlas.dart (Run dartfmt to format lib/src/assets/texture_atlas.dart.)
  • lib/src/audio/audio_wrapper.dart (Run dartfmt to format lib/src/audio/audio_wrapper.dart.)
  • lib/src/graphics/bitmap_font.dart (Run dartfmt to format lib/src/graphics/bitmap_font.dart.)
  • lib/src/graphics/builtin_shaders.dart (Run dartfmt to format lib/src/graphics/builtin_shaders.dart.)
  • lib/src/graphics/const_data.dart (Run dartfmt to format lib/src/graphics/const_data.dart.)
  • lib/src/graphics/debug_batch.dart (Run dartfmt to format lib/src/graphics/debug_batch.dart.)
  • lib/src/graphics/framebuffer.dart (Run dartfmt to format lib/src/graphics/framebuffer.dart.)
  • lib/src/graphics/gl_program.dart (Run dartfmt to format lib/src/graphics/gl_program.dart.)
  • lib/src/graphics/gl_util.dart (Run dartfmt to format lib/src/graphics/gl_util.dart.)
  • lib/src/graphics/gl_wrapper.dart (Run dartfmt to format lib/src/graphics/gl_wrapper.dart.)
  • lib/src/graphics/point_batch.dart (Run dartfmt to format lib/src/graphics/point_batch.dart.)
  • lib/src/graphics/sprite_batch.dart (Run dartfmt to format lib/src/graphics/sprite_batch.dart.)
  • lib/src/graphics/texture.dart (Run dartfmt to format lib/src/graphics/texture.dart.)
  • lib/src/graphics/vertex_batch.dart (Run dartfmt to format lib/src/graphics/vertex_batch.dart.)
  • lib/src/input/mouse.dart (Run dartfmt to format lib/src/input/mouse.dart.)
  • lib/src/map/properties.dart (Run dartfmt to format lib/src/map/properties.dart.)
  • lib/src/map/tilemap.dart (Run dartfmt to format lib/src/map/tilemap.dart.)
  • lib/src/map/tileset.dart (Run dartfmt to format lib/src/map/tileset.dart.)
  • lib/src/map/xml.dart (Run dartfmt to format lib/src/map/xml.dart.)
  • lib/src/math/camera.dart (Run dartfmt to format lib/src/math/camera.dart.)
  • lib/src/math/scale.dart (Run dartfmt to format lib/src/math/scale.dart.)
  • lib/src/math/transform.dart (Run dartfmt to format lib/src/math/transform.dart.)
  • lib/src/state/base_game.dart (Run dartfmt to format lib/src/state/base_game.dart.)
  • lib/src/state/state.dart (Run dartfmt to format lib/src/state/state.dart.)
  • lib/src/tween/tween.dart (Run dartfmt to format lib/src/tween/tween.dart.)
  • lib/src/tween/tween_manager.dart (Run dartfmt to format lib/src/tween/tween_manager.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (petitparser, xml).

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and cobblestone.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.3.0 <3.0.0
path ^1.6.2 1.6.4
petitparser ^2.4.0 2.4.0 3.0.2
vector_math ^2.0.8 2.0.8
xml ^3.5.0 3.6.1 4.1.0
Transitive dependencies
charcode 1.1.3
collection 1.14.12
convert 2.1.1
meta 1.1.8
typed_data 1.1.6
Dev dependencies
build_runner ^1.6.2
build_web_compilers ^2.3.0
pedantic ^1.8.0