shadow-box-model: 2D Bit array, with binary image collission detection

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

For discretized 2d collision detection, a binary array is a nice world model.


[Skip to Readme]

Properties

Versions 0.1.0
Change log ChangeLog.md
Dependencies base (>=4 && <5), bitwise [details]
License BSD-3-Clause
Author Scott Murphy <scottmurphy09@gmail.com>
Maintainer Scott Murphy <scottmurphy09@gmail.com>
Category Bits, Images, UI
Source repo head: git clone https://github.com/plow-technologies/shadow-box-model.git
Uploaded by scottmurphy09 at 2016-05-13T07:38:25Z

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for shadow-box-model-0.1.0

[back to package description]

shadow-box-model

shadow box is a tool for 2d collission detection on rectangular grids.

Installation

shadow-box-model can be installed with cabal install or cabal install --ghcjs

Usage

>>> either (fail) (putStrLn. showWorld) $ addModelToWorld 7 7 (shadowRect 3 3) (emptyWorld 10 10)
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  X  X  X 
 _  _  _  _  _  _  _  X  X  X 
 _  _  _  _  _  _  _  X  X  X 

>>> let (Right world1) = addModelToWorld 7 7 (shadowRect 3 3) (emptyWorld 10 10)

>>> let (Right world2) = addModelToWorld 1 1 (shadowRect 3 3) world1


>>> putStrLn . showWorld $ world2
 _  _  _  _  _  _  _  _  _  _ 
 _  X  X  X  _  _  _  _  _  _ 
 _  X  X  X  _  _  _  _  _  _ 
 _  X  X  X  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  _  _  _ 
 _  _  _  _  _  _  _  X  X  X 
 _  _  _  _  _  _  _  X  X  X 
 _  _  _  _  _  _  _  X  X  X 

Also, the tests show nice use cases

How to run tests

cabal configure --enable-tests && cabal build && cabal test