├── .gitignore ├── src ├── rl.js ├── mixins.js └── console.js ├── .jshintrc ├── docs ├── assets │ ├── css │ │ ├── logo.png │ │ └── external-small.png │ ├── favicon.png │ ├── img │ │ └── spinner.gif │ ├── index.html │ ├── js │ │ ├── yui-prettify.js │ │ ├── api-filter.js │ │ └── api-search.js │ └── vendor │ │ └── prettify │ │ └── prettify-min.css ├── files │ └── index.html ├── classes │ └── index.html ├── modules │ └── index.html └── api.js ├── manual ├── assets │ ├── fonts │ │ ├── DejaVuSansMono.eot │ │ ├── DejaVuSansMono.ttf │ │ └── DejaVuSansMono.woff │ ├── less │ │ ├── bootstrap │ │ │ ├── mixins │ │ │ │ ├── center-block.less │ │ │ │ ├── size.less │ │ │ │ ├── opacity.less │ │ │ │ ├── background-variant.less │ │ │ │ ├── text-emphasis.less │ │ │ │ ├── text-overflow.less │ │ │ │ ├── tab-focus.less │ │ │ │ ├── resize.less │ │ │ │ ├── labels.less │ │ │ │ ├── progress-bar.less │ │ │ │ ├── reset-filter.less │ │ │ │ ├── nav-divider.less │ │ │ │ ├── alerts.less │ │ │ │ ├── nav-vertical-align.less │ │ │ │ ├── responsive-visibility.less │ │ │ │ ├── pagination.less │ │ │ │ ├── border-radius.less │ │ │ │ ├── panels.less │ │ │ │ ├── list-group.less │ │ │ │ ├── hide-text.less │ │ │ │ ├── clearfix.less │ │ │ │ ├── table-row.less │ │ │ │ ├── image.less │ │ │ │ ├── buttons.less │ │ │ │ ├── forms.less │ │ │ │ └── grid-framework.less │ │ │ ├── wells.less │ │ │ ├── responsive-embed.less │ │ │ ├── component-animations.less │ │ │ ├── breadcrumbs.less │ │ │ ├── close.less │ │ │ ├── thumbnails.less │ │ │ ├── utilities.less │ │ │ ├── media.less │ │ │ ├── pager.less │ │ │ ├── jumbotron.less │ │ │ ├── mixins.less │ │ │ ├── badges.less │ │ │ ├── labels.less │ │ │ ├── bootstrap.less │ │ │ ├── code.less │ │ │ ├── grid.less │ │ │ ├── alerts.less │ │ │ ├── print.less │ │ │ ├── pagination.less │ │ │ ├── progress-bars.less │ │ │ ├── tooltip.less │ │ │ └── scaffolding.less │ │ └── main.less │ └── js │ │ ├── bootstrap │ │ ├── .jshintrc │ │ ├── .jscsrc │ │ ├── transition.js │ │ └── alert.js │ │ └── main.js ├── index │ ├── array-2d │ │ └── js │ │ │ ├── create.js │ │ │ ├── get-adjacent.js │ │ │ ├── filter.js │ │ │ ├── get-within-square-radius.js │ │ │ ├── manipulate-coord-values.js │ │ │ ├── get-line-through.js │ │ │ ├── get-nearest.js │ │ │ └── init.js │ ├── tile │ │ └── js │ │ │ └── defining-types.js │ ├── entity │ │ └── js │ │ │ ├── basic-combat.js │ │ │ └── pushable.js │ ├── input │ │ └── js │ │ │ └── triggered-actions.js │ ├── game │ │ └── js │ │ │ └── basic.js │ ├── tile.html │ ├── input.html │ ├── game.html │ ├── valid-targets.html │ └── entity.html └── js │ └── make-basic-game.js ├── manual-src ├── assets │ ├── fonts │ │ ├── DejaVuSansMono.eot │ │ ├── DejaVuSansMono.ttf │ │ └── DejaVuSansMono.woff │ ├── less │ │ ├── bootstrap │ │ │ ├── mixins │ │ │ │ ├── center-block.less │ │ │ │ ├── size.less │ │ │ │ ├── opacity.less │ │ │ │ ├── background-variant.less │ │ │ │ ├── text-emphasis.less │ │ │ │ ├── text-overflow.less │ │ │ │ ├── tab-focus.less │ │ │ │ ├── labels.less │ │ │ │ ├── resize.less │ │ │ │ ├── progress-bar.less │ │ │ │ ├── reset-filter.less │ │ │ │ ├── nav-divider.less │ │ │ │ ├── alerts.less │ │ │ │ ├── nav-vertical-align.less │ │ │ │ ├── responsive-visibility.less │ │ │ │ ├── pagination.less │ │ │ │ ├── border-radius.less │ │ │ │ ├── panels.less │ │ │ │ ├── list-group.less │ │ │ │ ├── hide-text.less │ │ │ │ ├── clearfix.less │ │ │ │ ├── table-row.less │ │ │ │ ├── image.less │ │ │ │ ├── buttons.less │ │ │ │ ├── forms.less │ │ │ │ └── grid-framework.less │ │ │ ├── wells.less │ │ │ ├── responsive-embed.less │ │ │ ├── component-animations.less │ │ │ ├── breadcrumbs.less │ │ │ ├── close.less │ │ │ ├── thumbnails.less │ │ │ ├── utilities.less │ │ │ ├── media.less │ │ │ ├── pager.less │ │ │ ├── jumbotron.less │ │ │ ├── mixins.less │ │ │ ├── badges.less │ │ │ ├── labels.less │ │ │ ├── bootstrap.less │ │ │ ├── code.less │ │ │ ├── grid.less │ │ │ ├── alerts.less │ │ │ ├── print.less │ │ │ ├── pagination.less │ │ │ ├── progress-bars.less │ │ │ └── tooltip.less │ │ └── main.less │ └── js │ │ ├── bootstrap │ │ ├── .jshintrc │ │ ├── .jscsrc │ │ ├── transition.js │ │ └── alert.js │ │ └── main.js ├── src │ ├── index.md │ ├── index │ │ ├── game.md │ │ ├── input.md │ │ ├── tile.md │ │ ├── entity.md │ │ ├── array-2d.md │ │ ├── overview.md │ │ ├── valid-targets.md │ │ ├── tile │ │ │ ├── defining-types.md │ │ │ └── js │ │ │ │ └── defining-types.js │ │ ├── array-2d │ │ │ ├── create.md │ │ │ ├── filter.md │ │ │ ├── js │ │ │ │ ├── create.js │ │ │ │ ├── get-adjacent.js │ │ │ │ ├── filter.js │ │ │ │ ├── get-within-square-radius.js │ │ │ │ ├── manipulate-coord-values.js │ │ │ │ ├── get-line-through.js │ │ │ │ ├── get-nearest.js │ │ │ │ └── init.js │ │ │ ├── get-nearest.md │ │ │ ├── get-adjacent.md │ │ │ ├── get-line-through.md │ │ │ ├── get-within-square-radius.md │ │ │ └── manipulate-coord-values.md │ │ ├── input │ │ │ ├── triggered-actions.md │ │ │ └── js │ │ │ │ └── triggered-actions.js │ │ ├── game │ │ │ ├── basic.md │ │ │ └── js │ │ │ │ └── basic.js │ │ ├── entity │ │ │ ├── js │ │ │ │ ├── basic-combat.js │ │ │ │ └── pushable.js │ │ │ ├── pushable.md │ │ │ ├── basic-combat.md │ │ │ └── basic-movement.md │ │ └── valid-targets │ │ │ └── filtering-and-selection.md │ └── js │ │ └── make-basic-game.js └── tpl │ ├── nav.dust │ ├── breadcrumb.dust │ ├── footer.dust │ └── page-class.dust ├── index.html ├── readme.md ├── package.json ├── LICENSE └── Gruntfile.js /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ -------------------------------------------------------------------------------- /src/rl.js: -------------------------------------------------------------------------------- 1 | // define RL lib global variable 2 | window.RL = {}; -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "laxbreak": true, 3 | "node": true, 4 | "unused": true 5 | } -------------------------------------------------------------------------------- /docs/assets/css/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/docs/assets/css/logo.png -------------------------------------------------------------------------------- /docs/assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/docs/assets/favicon.png -------------------------------------------------------------------------------- /docs/assets/img/spinner.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/docs/assets/img/spinner.gif -------------------------------------------------------------------------------- /docs/assets/css/external-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/docs/assets/css/external-small.png -------------------------------------------------------------------------------- /manual/assets/fonts/DejaVuSansMono.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/manual/assets/fonts/DejaVuSansMono.eot -------------------------------------------------------------------------------- /manual/assets/fonts/DejaVuSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/manual/assets/fonts/DejaVuSansMono.ttf -------------------------------------------------------------------------------- /manual/assets/fonts/DejaVuSansMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/manual/assets/fonts/DejaVuSansMono.woff -------------------------------------------------------------------------------- /manual-src/assets/fonts/DejaVuSansMono.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/manual-src/assets/fonts/DejaVuSansMono.eot -------------------------------------------------------------------------------- /manual-src/assets/fonts/DejaVuSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/manual-src/assets/fonts/DejaVuSansMono.ttf -------------------------------------------------------------------------------- /manual-src/assets/fonts/DejaVuSansMono.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unstoppablecarl/js-roguelike-skeleton/HEAD/manual-src/assets/fonts/DejaVuSansMono.woff -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /manual-src/src/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Roguelike JS Skeleton 3 | template: page-index.dust 4 | nav_sort: 1 5 | nav_groups: 6 | - primary 7 | - footer 8 | --- 9 | 10 | -------------------------------------------------------------------------------- /manual-src/src/index/game.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Game 3 | template: page-class.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | docs_class: Game 7 | related_methods: 8 | - Game 9 | --- -------------------------------------------------------------------------------- /manual-src/src/index/input.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Input 3 | template: page-class.dust 4 | nav_sort: 5 5 | nav_groups: primary 6 | docs_class: Input 7 | related_methods: 8 | - Input 9 | --- -------------------------------------------------------------------------------- /manual-src/src/index/tile.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Tile 3 | template: page-class.dust 4 | nav_sort: 6 5 | nav_groups: primary 6 | docs_class: Tile 7 | related_methods: 8 | - Tile 9 | --- -------------------------------------------------------------------------------- /manual-src/src/index/entity.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Entity 3 | template: page-class.dust 4 | nav_sort: 2 5 | nav_groups: primary 6 | docs_class: Entity 7 | related_methods: 8 | - Entity 9 | --- -------------------------------------------------------------------------------- /manual-src/src/index/array-2d.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Array2d 3 | template: page-class.dust 4 | nav_sort: 4 5 | nav_groups: primary 6 | docs_class: Array2d 7 | related_methods: 8 | - Array2d 9 | --- -------------------------------------------------------------------------------- /manual-src/src/index/overview.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Overview 3 | template: page-class.dust 4 | nav_sort: 5 5 | nav_groups: primary 6 | draft: true 7 | --- 8 | 9 | ## The `Game` object 10 | 11 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # JS Roguelike Skeleton 2 | 3 | A simple JS roguelike micro-framework for developers new to programming and or JS. 4 | 5 | ## [More Info](http://unstoppablecarl.github.io/js-roguelike-skeleton/) 6 | 7 | 8 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: @color; 7 | // color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: @color; 7 | // color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /manual-src/src/index/valid-targets.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Valid Targets 3 | template: page-class.dust 4 | nav_sort: 3 5 | nav_groups: primary 6 | docs_class: ValidTargets 7 | related_methods: 8 | - ValidTargets 9 | - ValidTargetsFinder 10 | --- -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /docs/files/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/assets/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/classes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/modules/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Redirector 5 | 6 | 7 | 8 | Click here to redirect 9 | 10 | 11 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /manual-src/tpl/nav.dust: -------------------------------------------------------------------------------- 1 |
  • 2 | {#file} 3 | {title} 4 | {:else} 5 | {name} 6 | {/file} 7 | {#children} 8 | 11 | {:else} 12 | {/children} 13 |
  • -------------------------------------------------------------------------------- /manual-src/tpl/breadcrumb.dust: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /manual-src/assets/js/bootstrap/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "asi" : true, 3 | "browser" : true, 4 | "eqeqeq" : false, 5 | "eqnull" : true, 6 | "es3" : true, 7 | "expr" : true, 8 | "jquery" : true, 9 | "latedef" : true, 10 | "laxbreak" : true, 11 | "nonbsp" : true, 12 | "strict" : true, 13 | "undef" : true, 14 | "unused" : true 15 | } 16 | -------------------------------------------------------------------------------- /manual/assets/js/bootstrap/.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "asi" : true, 3 | "browser" : true, 4 | "eqeqeq" : false, 5 | "eqnull" : true, 6 | "es3" : true, 7 | "expr" : true, 8 | "jquery" : true, 9 | "latedef" : true, 10 | "laxbreak" : true, 11 | "nonbsp" : true, 12 | "strict" : true, 13 | "undef" : true, 14 | "unused" : true 15 | } 16 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /manual-src/src/index/tile/defining-types.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Defining Types 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Tile 9 | 10 | lib_scripts: 11 | - ../../../src/rl.js 12 | - ../../../src/util.js 13 | - ../../../src/mixins.js 14 | - ../../../src/tile.js 15 | 16 | scripts: 17 | - js/defining-types.js 18 | --- 19 | 20 | See js/defining-types.js for example code. -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/create.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Creating 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Array2d 9 | 10 | lib_scripts: 11 | - ../../../src/rl.js 12 | - ../../../src/array-2d.js 13 | - ../../../src/renderer.js 14 | - ../../../src/renderer-layer.js 15 | - ../../../src/util.js 16 | 17 | scripts: 18 | - js/init.js 19 | - js/create.js 20 | --- 21 | 22 |
    23 | -------------------------------------------------------------------------------- /manual-src/src/index/input/triggered-actions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Triggered Actions 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Input 9 | 10 | lib_scripts: 11 | - ../../../src/rl.js 12 | - ../../../src/input.js 13 | 14 | scripts: 15 | - js/triggered-actions.js 16 | 17 | example_content: "Press a bound key and see the actions triggered. Bound Keys: W, A, S, D, ARROW_KEYS, SPACE, H, J, K, L" 18 | 19 | --- 20 | 21 |
    -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/filter.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Filter 3 | template: page-method.dust 4 | nav_sort: 6 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Array2d 9 | - Array2d.filter 10 | 11 | lib_scripts: 12 | - ../../../src/rl.js 13 | - ../../../src/array-2d.js 14 | - ../../../src/renderer.js 15 | - ../../../src/renderer-layer.js 16 | - ../../../src/util.js 17 | 18 | scripts: 19 | - js/init.js 20 | - js/filter.js 21 | --- 22 | 23 |
    24 | -------------------------------------------------------------------------------- /manual/index/array-2d/js/create.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#........#', 5 | '#........#', 6 | '#........#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | renderer.draw(); -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/create.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#........#', 5 | '#........#', 6 | '#........#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | renderer.draw(); -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/get-nearest.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Get Nearest 3 | template: page-method.dust 4 | nav_sort: 4 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Array2d 9 | - Array2d.getNearest 10 | 11 | lib_scripts: 12 | - ../../../src/rl.js 13 | - ../../../src/array-2d.js 14 | - ../../../src/renderer.js 15 | - ../../../src/renderer-layer.js 16 | - ../../../src/util.js 17 | 18 | scripts: 19 | - js/init.js 20 | - js/get-nearest.js 21 | --- 22 | 23 |
    24 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/get-adjacent.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Get Adjacent 3 | template: page-method.dust 4 | nav_sort: 3 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Array2d 9 | - Array2d.getAdjacent 10 | 11 | lib_scripts: 12 | - ../../../src/rl.js 13 | - ../../../src/array-2d.js 14 | - ../../../src/renderer.js 15 | - ../../../src/renderer-layer.js 16 | - ../../../src/util.js 17 | 18 | scripts: 19 | - js/init.js 20 | - js/get-adjacent.js 21 | --- 22 | 23 |
    24 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/get-line-through.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Get Line Through 3 | template: page-method.dust 4 | nav_sort: 7 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Array2d 9 | - Array2d.getLineThrough 10 | 11 | lib_scripts: 12 | - ../../../src/rl.js 13 | - ../../../src/array-2d.js 14 | - ../../../src/renderer.js 15 | - ../../../src/renderer-layer.js 16 | - ../../../src/util.js 17 | 18 | scripts: 19 | - js/init.js 20 | - js/get-line-through.js 21 | --- 22 | 23 |
    24 | -------------------------------------------------------------------------------- /docs/assets/js/yui-prettify.js: -------------------------------------------------------------------------------- 1 | YUI().use('node', function(Y) { 2 | var code = Y.all('.prettyprint.linenums'); 3 | if (code.size()) { 4 | code.each(function(c) { 5 | var lis = c.all('ol li'), 6 | l = 1; 7 | lis.each(function(n) { 8 | n.prepend(''); 9 | l++; 10 | }); 11 | }); 12 | var h = location.hash; 13 | location.hash = ''; 14 | h = h.replace('LINE_', 'LINENUM_'); 15 | location.hash = h; 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/get-within-square-radius.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Get Within Square Radius 3 | template: page-method.dust 4 | nav_sort: 5 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Array2d 9 | - Array2d.getWithinSquareRadius 10 | 11 | lib_scripts: 12 | - ../../../src/rl.js 13 | - ../../../src/array-2d.js 14 | - ../../../src/renderer.js 15 | - ../../../src/renderer-layer.js 16 | - ../../../src/util.js 17 | 18 | scripts: 19 | - js/init.js 20 | - js/get-within-square-radius.js 21 | --- 22 | 23 |
    24 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /manual/assets/js/main.js: -------------------------------------------------------------------------------- 1 | $('[data-toggle="collapse"]').each(function(){ 2 | var $btn = $(this), 3 | target = $btn.data('target'), 4 | $target = $(target), 5 | isCollapsed = !$target.hasClass('in'); 6 | 7 | var show = function(){ 8 | $btn.text('Show'); 9 | }; 10 | 11 | var hide = function(){ 12 | $btn.text('Hide'); 13 | }; 14 | 15 | $target.on('hide.bs.collapse', show); 16 | $target.on('show.bs.collapse', hide); 17 | 18 | if(isCollapsed){ 19 | show(); 20 | } else { 21 | hide(); 22 | } 23 | }); 24 | 25 | -------------------------------------------------------------------------------- /manual-src/assets/js/main.js: -------------------------------------------------------------------------------- 1 | $('[data-toggle="collapse"]').each(function(){ 2 | var $btn = $(this), 3 | target = $btn.data('target'), 4 | $target = $(target), 5 | isCollapsed = !$target.hasClass('in'); 6 | 7 | var show = function(){ 8 | $btn.text('Show'); 9 | }; 10 | 11 | var hide = function(){ 12 | $btn.text('Hide'); 13 | }; 14 | 15 | $target.on('hide.bs.collapse', show); 16 | $target.on('show.bs.collapse', hide); 17 | 18 | if(isCollapsed){ 19 | show(); 20 | } else { 21 | hide(); 22 | } 23 | }); 24 | 25 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/manipulate-coord-values.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Manipulate Coord Values 3 | template: page-method.dust 4 | nav_sort: 2 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Array2d 9 | - Array2d.get 10 | - Array2d.set 11 | - Array2d.remove 12 | 13 | lib_scripts: 14 | - ../../../src/rl.js 15 | - ../../../src/array-2d.js 16 | - ../../../src/renderer.js 17 | - ../../../src/renderer-layer.js 18 | - ../../../src/util.js 19 | 20 | scripts: 21 | - js/init.js 22 | - js/manipulate-coord-values.js 23 | --- 24 | 25 |
    26 | -------------------------------------------------------------------------------- /manual-src/tpl/footer.dust: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | Examples are designed to be simple and easily editable once Downloaded. 4 |
    5 |
    6 |
    7 |

    8 | Roguelike JS Skeleton 9 | | 10 | Manual Home 11 | | 12 | Github 13 | | 14 | Download Zip 15 |

    16 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /docs/assets/vendor/prettify/prettify-min.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /manual/index/array-2d/js/get-adjacent.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#...X....#', 5 | '#........#', 6 | '#........#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var adjacentTiles = array2d.getAdjacent(4, 2); 17 | for (var i = 0; i < adjacentTiles.length; i++) { 18 | adjacentTiles[i].bgColor = '#555'; 19 | } 20 | 21 | // draw to show changes 22 | renderer.draw(); 23 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/get-adjacent.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#...X....#', 5 | '#........#', 6 | '#........#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var adjacentTiles = array2d.getAdjacent(4, 2); 17 | for (var i = 0; i < adjacentTiles.length; i++) { 18 | adjacentTiles[i].bgColor = '#555'; 19 | } 20 | 21 | // draw to show changes 22 | renderer.draw(); 23 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object { 16 | position: absolute; 17 | top: 0; 18 | left: 0; 19 | bottom: 0; 20 | height: 100%; 21 | width: 100%; 22 | border: 0; 23 | } 24 | 25 | // Modifier class for 16:9 aspect ratio 26 | &.embed-responsive-16by9 { 27 | padding-bottom: 56.25%; 28 | } 29 | 30 | // Modifier class for 4:3 aspect ratio 31 | &.embed-responsive-4by3 { 32 | padding-bottom: 75%; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object { 16 | position: absolute; 17 | top: 0; 18 | left: 0; 19 | bottom: 0; 20 | height: 100%; 21 | width: 100%; 22 | border: 0; 23 | } 24 | 25 | // Modifier class for 16:9 aspect ratio 26 | &.embed-responsive-16by9 { 27 | padding-bottom: 56.25%; 28 | } 29 | 30 | // Modifier class for 4:3 aspect ratio 31 | &.embed-responsive-4by3 { 32 | padding-bottom: 75%; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /manual/index/array-2d/js/filter.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#.a...c.c#', 4 | '#.c.b.b..#', 5 | '#...ac.c.#', 6 | '#b.c..a..#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var tiles = array2d.filter(function(val, x, y){ 17 | return val && val.char === 'c'; 18 | }); 19 | 20 | for (var i = 0; i < tiles.length; i++) { 21 | tiles[i].bgColor = '#555'; 22 | } 23 | 24 | // draw to show changes 25 | renderer.draw(); 26 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/filter.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#.a...c.c#', 4 | '#.c.b.b..#', 5 | '#...ac.c.#', 6 | '#b.c..a..#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var tiles = array2d.filter(function(val, x, y){ 17 | return val && val.char === 'c'; 18 | }); 19 | 20 | for (var i = 0; i < tiles.length; i++) { 21 | tiles[i].bgColor = '#555'; 22 | } 23 | 24 | // draw to show changes 25 | renderer.draw(); 26 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition(height .35s ease); 31 | } 32 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition(height .35s ease); 31 | } 32 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | border-top: 1px solid #333333; 13 | 14 | > li { 15 | display: inline-block; 16 | 17 | + li:before { 18 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 19 | padding: 0 5px; 20 | color: @breadcrumb-color; 21 | } 22 | } 23 | 24 | > .active { 25 | color: @breadcrumb-active-color; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | border-top: 1px solid #333333; 13 | 14 | > li { 15 | display: inline-block; 16 | 17 | + li:before { 18 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 19 | padding: 0 5px; 20 | color: @breadcrumb-color; 21 | } 22 | } 23 | 24 | > .active { 25 | color: @breadcrumb-active-color; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /manual/index/array-2d/js/get-within-square-radius.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#.....c.c#', 4 | '#.c......#', 5 | '#...Xc.c.#', 6 | '#..c.....#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var tiles = array2d.getWithinSquareRadius(4, 3, 2, function(val, x, y){ 17 | return val && val.char === 'c'; 18 | }); 19 | 20 | for (var i = 0; i < tiles.length; i++) { 21 | tiles[i].bgColor = '#555'; 22 | } 23 | 24 | // draw to show changes 25 | renderer.draw(); 26 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/get-within-square-radius.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#.....c.c#', 4 | '#.c......#', 5 | '#...Xc.c.#', 6 | '#..c.....#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var tiles = array2d.getWithinSquareRadius(4, 3, 2, function(val, x, y){ 17 | return val && val.char === 'c'; 18 | }); 19 | 20 | for (var i = 0; i < tiles.length; i++) { 21 | tiles[i].bgColor = '#555'; 22 | } 23 | 24 | // draw to show changes 25 | renderer.draw(); 26 | -------------------------------------------------------------------------------- /manual/index/array-2d/js/manipulate-coord-values.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#.Z......#', 5 | '#........#', 6 | '#........#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | array2d.remove(2, 2); 17 | 18 | var aTile = array2d.get(4, 2); // {char: '.', bgColor: '#222', color: '#808080'} 19 | aTile.char = 'a'; 20 | aTile.bgColor = '#444'; 21 | 22 | array2d.set(5, 4, { 23 | char: 'x', 24 | color: 'red' 25 | }); 26 | 27 | // draw to show changes 28 | renderer.draw(); -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/manipulate-coord-values.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#.Z......#', 5 | '#........#', 6 | '#........#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | array2d.remove(2, 2); 17 | 18 | var aTile = array2d.get(4, 2); // {char: '.', bgColor: '#222', color: '#808080'} 19 | aTile.char = 'a'; 20 | aTile.bgColor = '#444'; 21 | 22 | array2d.set(5, 4, { 23 | char: 'x', 24 | color: 'red' 25 | }); 26 | 27 | // draw to show changes 28 | renderer.draw(); -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /docs/api.js: -------------------------------------------------------------------------------- 1 | YUI.add("yuidoc-meta", function(Y) { 2 | Y.YUIDoc = { meta: { 3 | "classes": [ 4 | "Array2d", 5 | "Console", 6 | "Entity", 7 | "Entity.Types", 8 | "FovROT", 9 | "Game", 10 | "Input", 11 | "LightingROT", 12 | "Map", 13 | "Mixins", 14 | "Mouse", 15 | "MultiObjectManager", 16 | "ObjectManager", 17 | "PerformableAction", 18 | "PerformableActionInterface", 19 | "Player", 20 | "Renderer", 21 | "RendererLayer", 22 | "RendererLayer.Types", 23 | "ResolvableAction", 24 | "ResolvableActionInterface", 25 | "Tile", 26 | "Tile.Types", 27 | "TileDraw", 28 | "TileDrawData", 29 | "Util", 30 | "ValidTargets", 31 | "ValidTargetsFinder" 32 | ], 33 | "modules": [], 34 | "allModules": [] 35 | } }; 36 | }); -------------------------------------------------------------------------------- /manual/index/array-2d/js/get-line-through.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#........#', 5 | '#....b...#', 6 | '#.a......#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var a = { 17 | x: 2, 18 | y: 4 19 | }; 20 | var b = { 21 | x: 5, 22 | y: 3 23 | }; 24 | 25 | var tiles = array2d.getLineThrough(a.x, a.y, b.x, b.y, function(val, x, y){ 26 | // stop at wall 27 | return val && val.char === '#'; 28 | }); 29 | 30 | for (var i = 0; i < tiles.length; i++) { 31 | tiles[i].bgColor = '#555'; 32 | } 33 | 34 | // draw to show changes 35 | renderer.draw(); 36 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/get-line-through.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#........#', 4 | '#........#', 5 | '#....b...#', 6 | '#.a......#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | var a = { 17 | x: 2, 18 | y: 4 19 | }; 20 | var b = { 21 | x: 5, 22 | y: 3 23 | }; 24 | 25 | var tiles = array2d.getLineThrough(a.x, a.y, b.x, b.y, function(val, x, y){ 26 | // stop at wall 27 | return val && val.char === '#'; 28 | }); 29 | 30 | for (var i = 0; i < tiles.length; i++) { 31 | tiles[i].bgColor = '#555'; 32 | } 33 | 34 | // draw to show changes 35 | renderer.draw(); 36 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /manual-src/src/index/game/basic.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Basic Example 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Game 9 | 10 | vendor_scripts: 11 | - ../../assets/js/rot.js 12 | 13 | lib_scripts: 14 | - ../../../src/rl.js 15 | - ../../../src/util.js 16 | - ../../../src/mixins.js 17 | - ../../../src/array-2d.js 18 | - ../../../src/map.js 19 | - ../../../src/entity.js 20 | - ../../../src/input.js 21 | - ../../../src/mouse.js 22 | - ../../../src/player.js 23 | - ../../../src/renderer.js 24 | - ../../../src/renderer-layer.js 25 | - ../../../src/tile.js 26 | - ../../../src/console.js 27 | - ../../../src/fov-rot.js 28 | - ../../../src/lighting-rot.js 29 | - ../../../src/object-manager.js 30 | - ../../../src/multi-object-manager.js 31 | - ../../../src/game.js 32 | 33 | scripts: 34 | - js/basic.js 35 | 36 | --- 37 | 38 |
    39 |
    -------------------------------------------------------------------------------- /manual/index/tile/js/defining-types.js: -------------------------------------------------------------------------------- 1 | /* 2 | Types of tiles are defined by adding objects to the RL.Tile.Types object. 3 | Each type has a typeName and is accessed like this RL.Tile.Types[typeName]; 4 | When creating a new Tile() object the second param is the typeName ( var tile = new RL.Tile(game, type, x, y) ). 5 | Methods on a tile type object are added to tile object instances of that type replacing methods with the same name 6 | See tile.js to review the types available by default. 7 | */ 8 | 9 | RL.Tile.Types.pit = { 10 | name: 'Pit', 11 | char: 'O', 12 | color: '#333', 13 | bgColor: '#000', 14 | passable: true, 15 | blocksLos: false, 16 | // when an entity enters this tile it is instantly killed 17 | onEntityEnter: function(entity){ 18 | entity.dead = true; 19 | } 20 | }; 21 | 22 | var game = null; // left null for simplicity of example. normally an instance of RL.Game 23 | var x = 0; 24 | var y = 0; 25 | var pitTile = new RL.Tile(game, 'pit', x, y); -------------------------------------------------------------------------------- /manual-src/src/index/tile/js/defining-types.js: -------------------------------------------------------------------------------- 1 | /* 2 | Types of tiles are defined by adding objects to the RL.Tile.Types object. 3 | Each type has a typeName and is accessed like this RL.Tile.Types[typeName]; 4 | When creating a new Tile() object the second param is the typeName ( var tile = new RL.Tile(game, type, x, y) ). 5 | Methods on a tile type object are added to tile object instances of that type replacing methods with the same name 6 | See tile.js to review the types available by default. 7 | */ 8 | 9 | RL.Tile.Types.pit = { 10 | name: 'Pit', 11 | char: 'O', 12 | color: '#333', 13 | bgColor: '#000', 14 | passable: true, 15 | blocksLos: false, 16 | // when an entity enters this tile it is instantly killed 17 | onEntityEnter: function(entity){ 18 | entity.dead = true; 19 | } 20 | }; 21 | 22 | var game = null; // left null for simplicity of example. normally an instance of RL.Game 23 | var x = 0; 24 | var y = 0; 25 | var pitTile = new RL.Tile(game, 'pit', x, y); -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rl-js-skeleton", 3 | "version": "0.2.0", 4 | "description": "A roguelike micro-framework for JS beginners. Designed to give a well designed and organized starting point for developers new to programming and or JS. It does NOT provide map generation tools, other libraries like rot.js can be used to serve that purpose.", 5 | "scripts": { 6 | "docs": "./node_modules/yuidocjs/lib/cli.js" 7 | }, 8 | "author": "Carl Olsen", 9 | "license": "MIT", 10 | "dependencies": { 11 | }, 12 | "devDependencies": { 13 | "dust": "^0.3.0", 14 | "dustjs-helpers": "^1.3.0", 15 | "dustjs-linkedin": "^2.4.2", 16 | "grunt": "^0.4.5", 17 | "grunt-contrib-watch": "^0.6.1", 18 | "grunt-contrib-yuidoc": "^0.5.2", 19 | "metalsmith": "^0.11.0", 20 | "metalsmith-assets": "0.0.1", 21 | "metalsmith-less": "^1.0.1", 22 | "metalsmith-markdown": "^0.2.1", 23 | "metalsmith-navigation": "^0.0.8", 24 | "metalsmith-drafts": "0.0.1", 25 | "metalsmith-templates": "^0.5.2", 26 | "yuidocjs": "^0.3.50" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /manual/index/entity/js/basic-combat.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | RL.Entity.Types.zombie = { 5 | name: 'Zombie', 6 | char: 'z', 7 | color: 'red', 8 | bgColor: false, 9 | bump: function(entity){ 10 | // if bumping entity is the player 11 | if(entity === this.game.player){ 12 | // @TODO combat logic here 13 | this.game.console.log('You killed Zombie'); 14 | this.dead = true; 15 | return true; 16 | } 17 | return false; 18 | } 19 | }; 20 | 21 | var mapData = [ 22 | '##########', 23 | '#....Z...#', 24 | '#........#', 25 | '#...Z..Z.#', 26 | '#Z...Z...#', 27 | '##########', 28 | ]; 29 | 30 | var entityCharToType = { 31 | 'Z': 'zombie' 32 | }; 33 | 34 | var settings = { 35 | mapData: mapData, 36 | }; 37 | var game = makeBasicGame(settings); 38 | 39 | game.entityManager.loadFromArrayString(mapData, entityCharToType); 40 | 41 | game.start(); 42 | 43 | }()); -------------------------------------------------------------------------------- /manual-src/src/index/entity/js/basic-combat.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | RL.Entity.Types.zombie = { 5 | name: 'Zombie', 6 | char: 'z', 7 | color: 'red', 8 | bgColor: false, 9 | bump: function(entity){ 10 | // if bumping entity is the player 11 | if(entity === this.game.player){ 12 | // @TODO combat logic here 13 | this.game.console.log('You killed Zombie'); 14 | this.dead = true; 15 | return true; 16 | } 17 | return false; 18 | } 19 | }; 20 | 21 | var mapData = [ 22 | '##########', 23 | '#....Z...#', 24 | '#........#', 25 | '#...Z..Z.#', 26 | '#Z...Z...#', 27 | '##########', 28 | ]; 29 | 30 | var entityCharToType = { 31 | 'Z': 'zombie' 32 | }; 33 | 34 | var settings = { 35 | mapData: mapData, 36 | }; 37 | var game = makeBasicGame(settings); 38 | 39 | game.entityManager.loadFromArrayString(mapData, entityCharToType); 40 | 41 | game.start(); 42 | 43 | }()); -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Carl Olsen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /manual-src/src/index/entity/pushable.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Pushable 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Entity 9 | 10 | vendor_scripts: 11 | - ../../assets/js/rot.js 12 | 13 | lib_scripts: 14 | - ../../../src/rl.js 15 | - ../../../src/util.js 16 | - ../../../src/mixins.js 17 | - ../../../src/array-2d.js 18 | - ../../../src/map.js 19 | - ../../../src/entity.js 20 | - ../../../src/input.js 21 | - ../../../src/mouse.js 22 | - ../../../src/player.js 23 | - ../../../src/renderer.js 24 | - ../../../src/renderer-layer.js 25 | - ../../../src/tile.js 26 | - ../../../src/console.js 27 | - ../../../src/fov-rot.js 28 | - ../../../src/lighting-rot.js 29 | - ../../../src/object-manager.js 30 | - ../../../src/multi-object-manager.js 31 | - ../../../src/game.js 32 | 33 | scripts: 34 | - ../../js/make-basic-game.js 35 | - js/pushable.js 36 | 37 | example_content: Move the player into the statue entity. 38 | example_controls: 39 | - 40 | action: Move 41 | keys: ARROW_KEYS, W, A, S, D 42 | - 43 | action: Skip Turn 44 | keys: SPACE 45 | --- 46 | 47 |
    48 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | > hr { 23 | border-top-color: darken(@jumbotron-bg, 10%); 24 | } 25 | 26 | .container &, 27 | .container-fluid & { 28 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 29 | } 30 | 31 | .container { 32 | max-width: 100%; 33 | } 34 | 35 | @media screen and (min-width: @screen-sm-min) { 36 | padding: (@jumbotron-padding * 1.6) 0; 37 | 38 | .container & { 39 | padding-left: (@jumbotron-padding * 2); 40 | padding-right: (@jumbotron-padding * 2); 41 | } 42 | 43 | h1, 44 | .h1 { 45 | font-size: (@font-size-base * 4.5); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | p { 17 | margin-bottom: (@jumbotron-padding / 2); 18 | font-size: @jumbotron-font-size; 19 | font-weight: 200; 20 | } 21 | 22 | > hr { 23 | border-top-color: darken(@jumbotron-bg, 10%); 24 | } 25 | 26 | .container &, 27 | .container-fluid & { 28 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 29 | } 30 | 31 | .container { 32 | max-width: 100%; 33 | } 34 | 35 | @media screen and (min-width: @screen-sm-min) { 36 | padding: (@jumbotron-padding * 1.6) 0; 37 | 38 | .container & { 39 | padding-left: (@jumbotron-padding * 2); 40 | padding-right: (@jumbotron-padding * 2); 41 | } 42 | 43 | h1, 44 | .h1 { 45 | font-size: (@font-size-base * 4.5); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | 'use strict'; 3 | grunt.initConfig({ 4 | watch: { 5 | examples_less: { 6 | files: ['examples/assets/less/**/*.less'], 7 | tasks: ['less:examples'], 8 | }, 9 | manual: { 10 | files: [ 11 | 'manual-src/assets/*', 12 | 'manual-src/src/**/*.md', 13 | 'manual-src/src/**/*.js', 14 | 'manual-src/tpl/**/*.dust' 15 | ], 16 | } 17 | }, 18 | yuidoc: { 19 | examples: { 20 | options: { 21 | paths: 'src', 22 | outdir: 'docs' 23 | } 24 | } 25 | }, 26 | metalsmith: { 27 | 28 | } 29 | }); 30 | 31 | grunt.loadNpmTasks('grunt-contrib-yuidoc'); 32 | grunt.loadNpmTasks('grunt-contrib-watch'); 33 | 34 | var metalsmithTask = require('./manual-src/task.js'); 35 | grunt.registerTask('metalsmith', 'metalsmith build task', metalsmithTask); 36 | 37 | grunt.registerTask('build', [ 38 | 'yuidoc:examples', 39 | 'metalsmith' 40 | ]); 41 | }; 42 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /manual-src/src/index/entity/basic-combat.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Basic Combat 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Game 9 | - Entity 10 | 11 | vendor_scripts: 12 | - ../../assets/js/rot.js 13 | 14 | lib_scripts: 15 | - ../../../src/rl.js 16 | - ../../../src/util.js 17 | - ../../../src/mixins.js 18 | - ../../../src/array-2d.js 19 | - ../../../src/map.js 20 | - ../../../src/entity.js 21 | - ../../../src/input.js 22 | - ../../../src/mouse.js 23 | - ../../../src/player.js 24 | - ../../../src/renderer.js 25 | - ../../../src/renderer-layer.js 26 | - ../../../src/tile.js 27 | - ../../../src/console.js 28 | - ../../../src/fov-rot.js 29 | - ../../../src/lighting-rot.js 30 | - ../../../src/object-manager.js 31 | - ../../../src/multi-object-manager.js 32 | - ../../../src/game.js 33 | 34 | scripts: 35 | - ../../js/make-basic-game.js 36 | - js/basic-combat.js 37 | 38 | example_content: Move the player into the zombie entities. 39 | example_controls: 40 | - 41 | action: Move 42 | keys: ARROW_KEYS, W, A, S, D 43 | - 44 | action: Skip Turn 45 | keys: SPACE 46 | --- 47 | 48 |
    49 |
    -------------------------------------------------------------------------------- /manual/index/input/js/triggered-actions.js: -------------------------------------------------------------------------------- 1 | var input = new RL.Input(); 2 | 3 | // key bindings: a list of actions bound to a list of keys to trigger them 4 | // see Input.Keys in input.js for a full list of key names available. 5 | var keyBindings = { 6 | up: ['UP_ARROW', 'K', 'W'], 7 | down: ['DOWN_ARROW', 'J', 'S'], 8 | left: ['LEFT_ARROW', 'H', 'A'], 9 | right: ['RIGHT_ARROW', 'L', 'D'], 10 | attack: ['SPACE'], 11 | }; 12 | 13 | // add input keybindings 14 | input.addBindings(keyBindings); 15 | 16 | // element to show the actions triggered 17 | var inputElement = document.getElementById('input-actions'); 18 | 19 | // clear the element 20 | inputElement.innerHTML = ''; 21 | 22 | // set a function to trigger functionality based on the input action triggered 23 | input.onKeyAction = function(action){ 24 | console.log(action); 25 | inputElement.innerHTML += '
    ' + action + '
    '; 26 | 27 | // remove the first element if there are more than 5 28 | if(inputElement.childElementCount > 5){ 29 | inputElement.removeChild(inputElement.children[0]); 30 | } 31 | }; 32 | 33 | // The Game class has an onKeyAction function that is used this way and is automatically set by the game constructor. 34 | // See Game.prototype.onKeyAction in game.js 35 | -------------------------------------------------------------------------------- /manual-src/src/index/input/js/triggered-actions.js: -------------------------------------------------------------------------------- 1 | var input = new RL.Input(); 2 | 3 | // key bindings: a list of actions bound to a list of keys to trigger them 4 | // see Input.Keys in input.js for a full list of key names available. 5 | var keyBindings = { 6 | up: ['UP_ARROW', 'K', 'W'], 7 | down: ['DOWN_ARROW', 'J', 'S'], 8 | left: ['LEFT_ARROW', 'H', 'A'], 9 | right: ['RIGHT_ARROW', 'L', 'D'], 10 | attack: ['SPACE'], 11 | }; 12 | 13 | // add input keybindings 14 | input.addBindings(keyBindings); 15 | 16 | // element to show the actions triggered 17 | var inputElement = document.getElementById('input-actions'); 18 | 19 | // clear the element 20 | inputElement.innerHTML = ''; 21 | 22 | // set a function to trigger functionality based on the input action triggered 23 | input.onKeyAction = function(action){ 24 | console.log(action); 25 | inputElement.innerHTML += '
    ' + action + '
    '; 26 | 27 | // remove the first element if there are more than 5 28 | if(inputElement.childElementCount > 5){ 29 | inputElement.removeChild(inputElement.children[0]); 30 | } 31 | }; 32 | 33 | // The Game class has an onKeyAction function that is used this way and is automatically set by the game constructor. 34 | // See Game.prototype.onKeyAction in game.js 35 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /manual-src/src/index/entity/basic-movement.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Basic Movement Behavior 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Game 9 | - Entity 10 | 11 | vendor_scripts: 12 | - ../../assets/js/rot.js 13 | 14 | lib_scripts: 15 | - ../../../src/rl.js 16 | - ../../../src/util.js 17 | - ../../../src/mixins.js 18 | - ../../../src/array-2d.js 19 | - ../../../src/map.js 20 | - ../../../src/entity.js 21 | - ../../../src/input.js 22 | - ../../../src/mouse.js 23 | - ../../../src/player.js 24 | - ../../../src/renderer.js 25 | - ../../../src/renderer-layer.js 26 | - ../../../src/tile.js 27 | - ../../../src/console.js 28 | - ../../../src/fov-rot.js 29 | - ../../../src/lighting-rot.js 30 | - ../../../src/object-manager.js 31 | - ../../../src/multi-object-manager.js 32 | - ../../../src/game.js 33 | 34 | scripts: 35 | - ../../js/make-basic-game.js 36 | - js/basic-movement.js 37 | 38 | example_content: Move the player around and watch how the zombie behaves. Just for fun a light that follows the zombie has been added. 39 | example_controls: 40 | - 41 | action: Move 42 | keys: ARROW_KEYS, W, A, S, D 43 | - 44 | action: Skip Turn 45 | keys: SPACE 46 | --- 47 | 48 |
    49 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // Hover state, but only for links 37 | a& { 38 | &:hover, 39 | &:focus { 40 | color: @badge-link-hover-color; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | // Account for badges in navs 47 | a.list-group-item.active > &, 48 | .nav-pills > .active > a > & { 49 | color: @badge-active-color; 50 | background-color: @badge-active-bg; 51 | } 52 | .nav-pills > li > a > & { 53 | margin-left: 3px; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | .btn-xs & { 32 | top: 0; 33 | padding: 1px 5px; 34 | } 35 | 36 | // Hover state, but only for links 37 | a& { 38 | &:hover, 39 | &:focus { 40 | color: @badge-link-hover-color; 41 | text-decoration: none; 42 | cursor: pointer; 43 | } 44 | } 45 | 46 | // Account for badges in navs 47 | a.list-group-item.active > &, 48 | .nav-pills > .active > a > & { 49 | color: @badge-active-color; 50 | background-color: @badge-active-bg; 51 | } 52 | .nav-pills > li > a > & { 53 | margin-left: 3px; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /manual/index/array-2d/js/get-nearest.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#.c.....b#', 4 | '#...a....#', 5 | '#.b...b..#', 6 | '#.......c#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | // getNearest returns an array of all results. 17 | var nearestCTiles = array2d.getNearest(4, 2, { 18 | maxRadius: 10, 19 | filter: function(val, x, y){ 20 | return val && val.char === 'c'; 21 | } 22 | }); 23 | // in this case there is only one result 24 | nearestCTiles[0].bgColor = 'green'; 25 | 26 | // There will be multiple results if mutiple coord values match and are the same closest distance away. 27 | var nearestBTiles = array2d.getNearest(4, 2, { 28 | maxRadius: 10, 29 | filter: function(val, x, y){ 30 | return val && val.char === 'b'; 31 | } 32 | }); 33 | 34 | // in this case there are 2 'b' tiles the same distance from the 'a' tile 35 | for (var i = 0; i < nearestBTiles.length; i++) { 36 | var nearestB = nearestBTiles[i]; 37 | nearestB.bgColor = 'green'; 38 | } 39 | 40 | // draw to show changes 41 | renderer.draw(); 42 | -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/get-nearest.js: -------------------------------------------------------------------------------- 1 | var mapData = [ 2 | '##########', 3 | '#.c.....b#', 4 | '#...a....#', 5 | '#.b...b..#', 6 | '#.......c#', 7 | '##########', 8 | ]; 9 | var array2d = array2dFromMapData(mapData); 10 | var renderer = rendererFromArray2d(array2d); 11 | var containerEl = document.getElementById('example-container'); 12 | // clear contents and append elements created by the game to the DOM 13 | containerEl.innerHTML = ''; 14 | containerEl.appendChild(renderer.canvas); 15 | 16 | // getNearest returns an array of all results. 17 | var nearestCTiles = array2d.getNearest(4, 2, { 18 | maxRadius: 10, 19 | filter: function(val, x, y){ 20 | return val && val.char === 'c'; 21 | } 22 | }); 23 | // in this case there is only one result 24 | nearestCTiles[0].bgColor = 'green'; 25 | 26 | // There will be multiple results if mutiple coord values match and are the same closest distance away. 27 | var nearestBTiles = array2d.getNearest(4, 2, { 28 | maxRadius: 10, 29 | filter: function(val, x, y){ 30 | return val && val.char === 'b'; 31 | } 32 | }); 33 | 34 | // in this case there are 2 'b' tiles the same distance from the 'a' tile 35 | for (var i = 0; i < nearestBTiles.length; i++) { 36 | var nearestB = nearestBTiles[i]; 37 | nearestB.bgColor = 'green'; 38 | } 39 | 40 | // draw to show changes 41 | renderer.draw(); 42 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | // @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | // @import "tables.less"; 16 | // @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | // @import "dropdowns.less"; 22 | // @import "button-groups.less"; 23 | // @import "input-groups.less"; 24 | // @import "navs.less"; 25 | // @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | // @import "pagination.less"; 28 | // @import "pager.less"; 29 | // @import "labels.less"; 30 | // @import "badges.less"; 31 | // @import "jumbotron.less"; 32 | // @import "thumbnails.less"; 33 | // @import "alerts.less"; 34 | // @import "progress-bars.less"; 35 | // @import "media.less"; 36 | // @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | // @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | // @import "modals.less"; 44 | // @import "tooltip.less"; 45 | // @import "popovers.less"; 46 | // @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | // @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | // @import "tables.less"; 16 | // @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | // @import "dropdowns.less"; 22 | // @import "button-groups.less"; 23 | // @import "input-groups.less"; 24 | // @import "navs.less"; 25 | // @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | // @import "pagination.less"; 28 | // @import "pager.less"; 29 | // @import "labels.less"; 30 | // @import "badges.less"; 31 | // @import "jumbotron.less"; 32 | // @import "thumbnails.less"; 33 | // @import "alerts.less"; 34 | // @import "progress-bars.less"; 35 | // @import "media.less"; 36 | // @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | // @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | // @import "modals.less"; 44 | // @import "tooltip.less"; 45 | // @import "popovers.less"; 46 | // @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | 8 | @bg: darken(@background, 10%); 9 | @borderColor: darken(@border, 10%); 10 | color: @color; 11 | background-color: @bg; 12 | border-color: @borderColor; 13 | 14 | &:hover, 15 | &:focus, 16 | &.focus, 17 | &:active, 18 | &.active, 19 | .open > .dropdown-toggle& { 20 | color: @color; 21 | background-color: saturate(lighten(@bg, 6%), 5%); 22 | border-color: saturate(lighten(@borderColor, 6%), 5%); 23 | } 24 | &:active, 25 | &.active, 26 | .open > .dropdown-toggle& { 27 | background-image: none; 28 | } 29 | &.disabled, 30 | &[disabled], 31 | fieldset[disabled] & { 32 | &, 33 | &:hover, 34 | &:focus, 35 | &.focus, 36 | &:active, 37 | &.active { 38 | background-color: @bg; 39 | border-color: @borderColor; 40 | } 41 | } 42 | 43 | .badge { 44 | color: @bg; 45 | background-color: @borderColor; 46 | } 47 | } 48 | 49 | // Button sizes 50 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 51 | padding: @padding-vertical @padding-horizontal; 52 | font-size: @font-size; 53 | line-height: @line-height; 54 | //border-radius: @border-radius; 55 | } 56 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | 8 | @bg: darken(@background, 10%); 9 | @borderColor: darken(@border, 10%); 10 | color: @color; 11 | background-color: @bg; 12 | border-color: @borderColor; 13 | 14 | &:hover, 15 | &:focus, 16 | &.focus, 17 | &:active, 18 | &.active, 19 | .open > .dropdown-toggle& { 20 | color: @color; 21 | background-color: saturate(lighten(@bg, 6%), 5%); 22 | border-color: saturate(lighten(@borderColor, 6%), 5%); 23 | } 24 | &:active, 25 | &.active, 26 | .open > .dropdown-toggle& { 27 | background-image: none; 28 | } 29 | &.disabled, 30 | &[disabled], 31 | fieldset[disabled] & { 32 | &, 33 | &:hover, 34 | &:focus, 35 | &.focus, 36 | &:active, 37 | &.active { 38 | background-color: @bg; 39 | border-color: @borderColor; 40 | } 41 | } 42 | 43 | .badge { 44 | color: @bg; 45 | background-color: @borderColor; 46 | } 47 | } 48 | 49 | // Button sizes 50 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 51 | padding: @padding-vertical @padding-horizontal; 52 | font-size: @font-size; 53 | line-height: @line-height; 54 | //border-radius: @border-radius; 55 | } 56 | -------------------------------------------------------------------------------- /manual-src/src/index/valid-targets/filtering-and-selection.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Filtering and Selection 3 | template: page-method.dust 4 | nav_sort: 1 5 | nav_groups: primary 6 | 7 | related_methods: 8 | - Game 9 | - ValidTargets 10 | - ValidTargetsFinder 11 | 12 | vendor_scripts: 13 | - ../../assets/js/rot.js 14 | 15 | lib_scripts: 16 | - ../../../src/rl.js 17 | - ../../../src/util.js 18 | - ../../../src/mixins.js 19 | - ../../../src/array-2d.js 20 | - ../../../src/map.js 21 | - ../../../src/entity.js 22 | - ../../../src/input.js 23 | - ../../../src/mouse.js 24 | - ../../../src/player.js 25 | - ../../../src/renderer.js 26 | - ../../../src/renderer-layer.js 27 | - ../../../src/tile.js 28 | - ../../../src/console.js 29 | - ../../../src/fov-rot.js 30 | - ../../../src/lighting-rot.js 31 | - ../../../src/valid-targets.js 32 | - ../../../src/valid-targets-finder.js 33 | - ../../../src/object-manager.js 34 | - ../../../src/multi-object-manager.js 35 | - ../../../src/game.js 36 | 37 | scripts: 38 | - ../../js/make-basic-game.js 39 | - js/filtering-and-selection.js 40 | 41 | example_content: Change Targets and Press the Space key to get target info. Note that one of the zombies is not a valid target (see code). 42 | example_controls: 43 | - 44 | action: Move 45 | keys: ARROW_KEYS, W, A, S, D 46 | - 47 | action: Skip Turn 48 | keys: SPACE 49 | - 50 | action: Target Prev 51 | keys: COMMA 52 | - 53 | action: Target Next 54 | keys: PERIOD 55 | --- 56 | 57 |
    58 |
    -------------------------------------------------------------------------------- /docs/assets/js/api-filter.js: -------------------------------------------------------------------------------- 1 | YUI.add('api-filter', function (Y) { 2 | 3 | Y.APIFilter = Y.Base.create('apiFilter', Y.Base, [Y.AutoCompleteBase], { 4 | // -- Initializer ---------------------------------------------------------- 5 | initializer: function () { 6 | this._bindUIACBase(); 7 | this._syncUIACBase(); 8 | }, 9 | getDisplayName: function(name) { 10 | 11 | Y.each(Y.YUIDoc.meta.allModules, function(i) { 12 | if (i.name === name && i.displayName) { 13 | name = i.displayName; 14 | } 15 | }); 16 | 17 | return name; 18 | } 19 | 20 | }, { 21 | // -- Attributes ----------------------------------------------------------- 22 | ATTRS: { 23 | resultHighlighter: { 24 | value: 'phraseMatch' 25 | }, 26 | 27 | // May be set to "classes" or "modules". 28 | queryType: { 29 | value: 'classes' 30 | }, 31 | 32 | source: { 33 | valueFn: function() { 34 | var self = this; 35 | return function(q) { 36 | var data = Y.YUIDoc.meta[self.get('queryType')], 37 | out = []; 38 | Y.each(data, function(v) { 39 | if (v.toLowerCase().indexOf(q.toLowerCase()) > -1) { 40 | out.push(v); 41 | } 42 | }); 43 | return out; 44 | }; 45 | } 46 | } 47 | } 48 | }); 49 | 50 | }, '3.4.0', {requires: [ 51 | 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources' 52 | ]}); 53 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: (@alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 59 | } 60 | .alert-info { 61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 62 | } 63 | .alert-warning { 64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissible alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 41 | .alert-dismissible { 42 | padding-right: (@alert-padding + 20); 43 | 44 | // Adjust close link position 45 | .close { 46 | position: relative; 47 | top: -2px; 48 | right: -21px; 49 | color: inherit; 50 | } 51 | } 52 | 53 | // Alternate styles 54 | // 55 | // Generate contextual modifier classes for colorizing the alert. 56 | 57 | .alert-success { 58 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 59 | } 60 | .alert-info { 61 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 62 | } 63 | .alert-warning { 64 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 65 | } 66 | .alert-danger { 67 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 68 | } 69 | -------------------------------------------------------------------------------- /manual/index/array-2d/js/init.js: -------------------------------------------------------------------------------- 1 | var array2dFromMapData = function(mapData){ 2 | var width = mapData[0].length, 3 | height = mapData.length; 4 | var array2d = new RL.Array2d(width, height); 5 | // loop over each coord in the Array2d (val will be undefined) 6 | array2d.each(function(val, x, y){ 7 | var char = mapData[y][x]; 8 | var tileData = { 9 | char: char, 10 | bgColor: '#222', 11 | color: '#fff' 12 | }; 13 | if(char === '.'){ 14 | tileData.color = '#808080'; 15 | } 16 | else if(char === '#'){ 17 | tileData.color = '#fff'; 18 | } 19 | else if(char === 'a'){ 20 | tileData.color = 'red'; 21 | } 22 | else if(char === 'b'){ 23 | tileData.color = 'blue'; 24 | } 25 | else if(char === 'c'){ 26 | tileData.color = 'yellow'; 27 | } 28 | // set value at coord 29 | array2d.set(x, y, tileData); 30 | }); 31 | 32 | return array2d; 33 | }; 34 | 35 | var rendererFromArray2d = function(array2d){ 36 | RL.RendererLayer.Types.basic_map = { 37 | mergeWithPrevLayer: false, 38 | draw: true, 39 | getTileData: function(x, y, prevTileData){ 40 | var tile = array2d.get(x, y); 41 | if(!tile){ 42 | return false; 43 | } 44 | return tile; 45 | } 46 | }; 47 | 48 | 49 | var renderer = new RL.Renderer(); 50 | // make the tiles big 51 | renderer.tileSize = 20; 52 | // set the view width and height (in this case we want to see the whole map so it is the same as the map width) 53 | renderer.resize(array2d.width, array2d.height); 54 | 55 | renderer.layers = [ 56 | new RL.RendererLayer(null, 'basic_map') 57 | ]; 58 | 59 | return renderer; 60 | }; -------------------------------------------------------------------------------- /manual-src/src/index/array-2d/js/init.js: -------------------------------------------------------------------------------- 1 | var array2dFromMapData = function(mapData){ 2 | var width = mapData[0].length, 3 | height = mapData.length; 4 | var array2d = new RL.Array2d(width, height); 5 | // loop over each coord in the Array2d (val will be undefined) 6 | array2d.each(function(val, x, y){ 7 | var char = mapData[y][x]; 8 | var tileData = { 9 | char: char, 10 | bgColor: '#222', 11 | color: '#fff' 12 | }; 13 | if(char === '.'){ 14 | tileData.color = '#808080'; 15 | } 16 | else if(char === '#'){ 17 | tileData.color = '#fff'; 18 | } 19 | else if(char === 'a'){ 20 | tileData.color = 'red'; 21 | } 22 | else if(char === 'b'){ 23 | tileData.color = 'blue'; 24 | } 25 | else if(char === 'c'){ 26 | tileData.color = 'yellow'; 27 | } 28 | // set value at coord 29 | array2d.set(x, y, tileData); 30 | }); 31 | 32 | return array2d; 33 | }; 34 | 35 | var rendererFromArray2d = function(array2d){ 36 | RL.RendererLayer.Types.basic_map = { 37 | mergeWithPrevLayer: false, 38 | draw: true, 39 | getTileData: function(x, y, prevTileData){ 40 | var tile = array2d.get(x, y); 41 | if(!tile){ 42 | return false; 43 | } 44 | return tile; 45 | } 46 | }; 47 | 48 | 49 | var renderer = new RL.Renderer(); 50 | // make the tiles big 51 | renderer.tileSize = 20; 52 | // set the view width and height (in this case we want to see the whole map so it is the same as the map width) 53 | renderer.resize(array2d.width, array2d.height); 54 | 55 | renderer.layers = [ 56 | new RL.RendererLayer(null, 'basic_map') 57 | ]; 58 | 59 | return renderer; 60 | }; -------------------------------------------------------------------------------- /manual/assets/js/bootstrap/.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "disallowEmptyBlocks": true, 3 | "disallowKeywords": ["with"], 4 | "disallowMixedSpacesAndTabs": true, 5 | "disallowMultipleLineStrings": true, 6 | "disallowMultipleVarDecl": true, 7 | "disallowQuotedKeysInObjects": "allButReserved", 8 | "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], 9 | "disallowSpaceBeforeBinaryOperators": [","], 10 | "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], 11 | "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, 12 | "disallowSpacesInsideArrayBrackets": true, 13 | "disallowSpacesInsideParentheses": true, 14 | "disallowTrailingComma": true, 15 | "disallowTrailingWhitespace": true, 16 | "requireCamelCaseOrUpperCaseIdentifiers": true, 17 | "requireCapitalizedConstructors": true, 18 | "requireCommaBeforeLineBreak": true, 19 | "requireDotNotation": true, 20 | "requireLineFeedAtFileEnd": true, 21 | "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], 22 | "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], 23 | "requireSpaceAfterLineComment": true, 24 | "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], 25 | "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true }, 26 | "requireSpacesInConditionalExpression": true, 27 | "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, 28 | "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, 29 | "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, 30 | "requireSpacesInsideObjectBrackets": "allButNested", 31 | "validateIndentation": 2, 32 | "validateLineBreaks": "LF", 33 | "validateQuoteMarks": "'" 34 | } 35 | -------------------------------------------------------------------------------- /manual-src/assets/js/bootstrap/.jscsrc: -------------------------------------------------------------------------------- 1 | { 2 | "disallowEmptyBlocks": true, 3 | "disallowKeywords": ["with"], 4 | "disallowMixedSpacesAndTabs": true, 5 | "disallowMultipleLineStrings": true, 6 | "disallowMultipleVarDecl": true, 7 | "disallowQuotedKeysInObjects": "allButReserved", 8 | "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], 9 | "disallowSpaceBeforeBinaryOperators": [","], 10 | "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], 11 | "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, 12 | "disallowSpacesInsideArrayBrackets": true, 13 | "disallowSpacesInsideParentheses": true, 14 | "disallowTrailingComma": true, 15 | "disallowTrailingWhitespace": true, 16 | "requireCamelCaseOrUpperCaseIdentifiers": true, 17 | "requireCapitalizedConstructors": true, 18 | "requireCommaBeforeLineBreak": true, 19 | "requireDotNotation": true, 20 | "requireLineFeedAtFileEnd": true, 21 | "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], 22 | "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], 23 | "requireSpaceAfterLineComment": true, 24 | "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], 25 | "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true }, 26 | "requireSpacesInConditionalExpression": true, 27 | "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, 28 | "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, 29 | "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, 30 | "requireSpacesInsideObjectBrackets": "allButNested", 31 | "validateIndentation": 2, 32 | "validateLineBreaks": "LF", 33 | "validateQuoteMarks": "'" 34 | } 35 | -------------------------------------------------------------------------------- /manual/index/entity/js/pushable.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | RL.Entity.Types.statue = { 5 | name: 'Statue', 6 | char: 's', 7 | color: '#808080', 8 | bgColor: '#222', 9 | 10 | bump: function(entity){ 11 | // bumping entity is the player 12 | if(entity === this.game.player){ 13 | var pusherX = entity.x, 14 | pusherY = entity.y, 15 | directionX = this.x - pusherX, 16 | directionY = this.y - pusherY, 17 | targetX = this.x + directionX, 18 | targetY = this.y + directionY; 19 | 20 | // check if can be pushed into destination 21 | var targetPushEnt = this.game.entityManager.get(targetX, targetY); 22 | if(!targetPushEnt){ 23 | var targetPushTile = this.game.map.get(targetX, targetY); 24 | if(targetPushTile.passable){ 25 | var prevX = this.x, 26 | prevY = this.y; 27 | // push target entity into tile 28 | this.moveTo(targetX, targetY); 29 | // move player into previously occupied tile 30 | entity.moveTo(prevX, prevY); 31 | return true; 32 | } 33 | } 34 | } 35 | return false; 36 | } 37 | }; 38 | 39 | var mapData = [ 40 | '##########', 41 | '#........#', 42 | '#........#', 43 | '#........#', 44 | '#........#', 45 | '##########', 46 | ]; 47 | 48 | var settings = { 49 | mapData: mapData 50 | }; 51 | var game = makeBasicGame(settings); 52 | 53 | var entity = new RL.Entity(game, 'statue'); 54 | // add it to the game 55 | game.entityManager.add(4, 2, entity); 56 | 57 | game.start(); 58 | 59 | }()); -------------------------------------------------------------------------------- /manual-src/src/index/entity/js/pushable.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | 'use strict'; 3 | 4 | RL.Entity.Types.statue = { 5 | name: 'Statue', 6 | char: 's', 7 | color: '#808080', 8 | bgColor: '#222', 9 | 10 | bump: function(entity){ 11 | // bumping entity is the player 12 | if(entity === this.game.player){ 13 | var pusherX = entity.x, 14 | pusherY = entity.y, 15 | directionX = this.x - pusherX, 16 | directionY = this.y - pusherY, 17 | targetX = this.x + directionX, 18 | targetY = this.y + directionY; 19 | 20 | // check if can be pushed into destination 21 | var targetPushEnt = this.game.entityManager.get(targetX, targetY); 22 | if(!targetPushEnt){ 23 | var targetPushTile = this.game.map.get(targetX, targetY); 24 | if(targetPushTile.passable){ 25 | var prevX = this.x, 26 | prevY = this.y; 27 | // push target entity into tile 28 | this.moveTo(targetX, targetY); 29 | // move player into previously occupied tile 30 | entity.moveTo(prevX, prevY); 31 | return true; 32 | } 33 | } 34 | } 35 | return false; 36 | } 37 | }; 38 | 39 | var mapData = [ 40 | '##########', 41 | '#........#', 42 | '#........#', 43 | '#........#', 44 | '#........#', 45 | '##########', 46 | ]; 47 | 48 | var settings = { 49 | mapData: mapData 50 | }; 51 | var game = makeBasicGame(settings); 52 | 53 | var entity = new RL.Entity(game, 'statue'); 54 | // add it to the game 55 | game.entityManager.add(4, 2, entity); 56 | 57 | game.start(); 58 | 59 | }()); -------------------------------------------------------------------------------- /manual/assets/js/bootstrap/transition.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: transition.js v3.2.0 3 | * http://getbootstrap.com/javascript/#transitions 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 14 | // ============================================================ 15 | 16 | function transitionEnd() { 17 | var el = document.createElement('bootstrap') 18 | 19 | var transEndEventNames = { 20 | WebkitTransition : 'webkitTransitionEnd', 21 | MozTransition : 'transitionend', 22 | OTransition : 'oTransitionEnd otransitionend', 23 | transition : 'transitionend' 24 | } 25 | 26 | for (var name in transEndEventNames) { 27 | if (el.style[name] !== undefined) { 28 | return { end: transEndEventNames[name] } 29 | } 30 | } 31 | 32 | return false // explicit for ie8 ( ._.) 33 | } 34 | 35 | // http://blog.alexmaccaw.com/css-transitions 36 | $.fn.emulateTransitionEnd = function (duration) { 37 | var called = false 38 | var $el = this 39 | $(this).one('bsTransitionEnd', function () { called = true }) 40 | var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 41 | setTimeout(callback, duration) 42 | return this 43 | } 44 | 45 | $(function () { 46 | $.support.transition = transitionEnd() 47 | 48 | if (!$.support.transition) return 49 | 50 | $.event.special.bsTransitionEnd = { 51 | bindType: $.support.transition.end, 52 | delegateType: $.support.transition.end, 53 | handle: function (e) { 54 | if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 55 | } 56 | } 57 | }) 58 | 59 | }(jQuery); 60 | -------------------------------------------------------------------------------- /manual-src/assets/js/bootstrap/transition.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: transition.js v3.2.0 3 | * http://getbootstrap.com/javascript/#transitions 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 14 | // ============================================================ 15 | 16 | function transitionEnd() { 17 | var el = document.createElement('bootstrap') 18 | 19 | var transEndEventNames = { 20 | WebkitTransition : 'webkitTransitionEnd', 21 | MozTransition : 'transitionend', 22 | OTransition : 'oTransitionEnd otransitionend', 23 | transition : 'transitionend' 24 | } 25 | 26 | for (var name in transEndEventNames) { 27 | if (el.style[name] !== undefined) { 28 | return { end: transEndEventNames[name] } 29 | } 30 | } 31 | 32 | return false // explicit for ie8 ( ._.) 33 | } 34 | 35 | // http://blog.alexmaccaw.com/css-transitions 36 | $.fn.emulateTransitionEnd = function (duration) { 37 | var called = false 38 | var $el = this 39 | $(this).one('bsTransitionEnd', function () { called = true }) 40 | var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 41 | setTimeout(callback, duration) 42 | return this 43 | } 44 | 45 | $(function () { 46 | $.support.transition = transitionEnd() 47 | 48 | if (!$.support.transition) return 49 | 50 | $.event.special.bsTransitionEnd = { 51 | bindType: $.support.transition.end, 52 | delegateType: $.support.transition.end, 53 | handle: function (e) { 54 | if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 55 | } 56 | } 57 | }) 58 | 59 | }(jQuery); 60 | -------------------------------------------------------------------------------- /manual/js/make-basic-game.js: -------------------------------------------------------------------------------- 1 | var makeBasicGame = function(settings){ 2 | 3 | var defaultSettings = { 4 | mapContainerEl: document.getElementById('example-container'), 5 | consoleContainerEl: document.getElementById('example-console-container'), 6 | mapData: [ 7 | // 10x6 8 | '##########', 9 | '#........#', 10 | '#........#', 11 | '#........#', 12 | '#........#', 13 | '##########', 14 | ], 15 | mapCharToType: { 16 | '#': 'wall', 17 | '.': 'floor', 18 | '+': 'door', 19 | }, 20 | keyBindings: { 21 | up: ['UP_ARROW', 'K', 'W'], 22 | down: ['DOWN_ARROW', 'J', 'S'], 23 | left: ['LEFT_ARROW', 'H', 'A'], 24 | right: ['RIGHT_ARROW', 'L', 'D'], 25 | wait: ['SPACE'] 26 | }, 27 | playerStartX: 2, 28 | playerStartY: 2, 29 | rendererWidth: 14, 30 | rendererHeight: 14 31 | }; 32 | 33 | var s = RL.Util.mergeDefaults(defaultSettings, settings); 34 | 35 | // create the game instance 36 | var game = new RL.Game(); 37 | 38 | game.map.loadTilesFromArrayString(s.mapData, s.mapCharToType, 'floor'); 39 | 40 | game.setMapSize(game.map.width, game.map.height); 41 | 42 | // add input keybindings 43 | game.input.addBindings(s.keyBindings); 44 | 45 | // set player starting position 46 | game.entityManager.add(s.playerStartX, s.playerStartY, game.player); 47 | game.renderer.resize(s.rendererWidth, s.rendererHeight); 48 | 49 | // append elements created by the game to the DOM 50 | s.mapContainerEl.appendChild(game.renderer.canvas); 51 | 52 | if(s.consoleContainerEl){ 53 | s.consoleContainerEl.appendChild(game.console.el); 54 | } 55 | 56 | game.renderer.layers = [ 57 | new RL.RendererLayer(game, 'map', {draw: false, mergeWithPrevLayer: false}), 58 | new RL.RendererLayer(game, 'entity', {draw: true, mergeWithPrevLayer: true}), 59 | ]; 60 | 61 | return game; 62 | }; -------------------------------------------------------------------------------- /src/mixins.js: -------------------------------------------------------------------------------- 1 | (function(root) { 2 | 'use strict'; 3 | 4 | /** 5 | * Mixins. Collections of properties to be mixed into objects. 6 | * Functionality is placed in a mixin so that it can be shared by multiple objects without repeating the same code. 7 | * Modifications to mixin functionality will be reflected in all objects using this mixin. 8 | * If the mixin code was copied and pasted, code changes would need to be made in multiple places. 9 | * No flexibility is lost as objects with mixins added to them may still override or extend the mixed in functionality. 10 | * @class Mixins 11 | * @static 12 | */ 13 | var Mixins = { 14 | 15 | /** 16 | * Adds the functionality required for a `Renderer` or `RendererLayer` to retrieve `TileDrawData` from an object. 17 | * @class TileDraw 18 | * @static 19 | */ 20 | TileDraw: { 21 | 22 | /** 23 | * Returns as `tileData`object used by `Renderer` objects to draw tiles. 24 | * @method getTileDrawData 25 | * @return {TileDrawData} 26 | */ 27 | getTileDrawData: function() { 28 | return { 29 | char: this.char, 30 | color: this.color, 31 | bgColor: this.bgColor, 32 | borderColor: this.borderColor, 33 | borderWidth: this.borderWidth, 34 | charStrokeColor: this.charStrokeColor, 35 | charStrokeWidth: this.charStrokeWidth, 36 | font: this.font, 37 | fontSize: this.fontSize, 38 | textAlign: this.textAlign, 39 | textBaseline: this.textBaseline, 40 | offsetX: this.offsetX, 41 | offsetY: this.offsetY, 42 | }; 43 | }, 44 | } 45 | }; 46 | 47 | root.RL.Mixins = Mixins; 48 | 49 | }(this)); 50 | -------------------------------------------------------------------------------- /manual-src/src/js/make-basic-game.js: -------------------------------------------------------------------------------- 1 | var makeBasicGame = function(settings){ 2 | 3 | var defaultSettings = { 4 | mapContainerEl: document.getElementById('example-container'), 5 | consoleContainerEl: document.getElementById('example-console-container'), 6 | mapData: [ 7 | // 10x6 8 | '##########', 9 | '#........#', 10 | '#........#', 11 | '#........#', 12 | '#........#', 13 | '##########', 14 | ], 15 | mapCharToType: { 16 | '#': 'wall', 17 | '.': 'floor', 18 | '+': 'door', 19 | }, 20 | keyBindings: { 21 | up: ['UP_ARROW', 'K', 'W'], 22 | down: ['DOWN_ARROW', 'J', 'S'], 23 | left: ['LEFT_ARROW', 'H', 'A'], 24 | right: ['RIGHT_ARROW', 'L', 'D'], 25 | wait: ['SPACE'] 26 | }, 27 | playerStartX: 2, 28 | playerStartY: 2, 29 | rendererWidth: 14, 30 | rendererHeight: 14 31 | }; 32 | 33 | var s = RL.Util.mergeDefaults(defaultSettings, settings); 34 | 35 | // create the game instance 36 | var game = new RL.Game(); 37 | 38 | game.map.loadTilesFromArrayString(s.mapData, s.mapCharToType, 'floor'); 39 | 40 | game.setMapSize(game.map.width, game.map.height); 41 | 42 | // add input keybindings 43 | game.input.addBindings(s.keyBindings); 44 | 45 | // set player starting position 46 | game.entityManager.add(s.playerStartX, s.playerStartY, game.player); 47 | game.renderer.resize(s.rendererWidth, s.rendererHeight); 48 | 49 | // append elements created by the game to the DOM 50 | s.mapContainerEl.appendChild(game.renderer.canvas); 51 | 52 | if(s.consoleContainerEl){ 53 | s.consoleContainerEl.appendChild(game.console.el); 54 | } 55 | 56 | game.renderer.layers = [ 57 | new RL.RendererLayer(game, 'map', {draw: false, mergeWithPrevLayer: false}), 58 | new RL.RendererLayer(game, 'entity', {draw: true, mergeWithPrevLayer: true}), 59 | ]; 60 | 61 | return game; 62 | }; -------------------------------------------------------------------------------- /src/console.js: -------------------------------------------------------------------------------- 1 | (function(root) { 2 | 'use strict'; 3 | 4 | /** 5 | * Manages the display and history of console messages to the user. 6 | * "The troll hits you dealing 10 damage." 7 | * "You die." 8 | * @class Console 9 | * @constructor 10 | * @param {Game} game - Game instance this obj is attached to. 11 | * @param {Number} [messageHistoryCount=5] - Number of messages to display at once. 12 | * @param {String} [elClassName='console'] - Css class name to assign to the console element. 13 | */ 14 | var Console = function Console(game, messageHistoryCount, elClassName) { 15 | this.el = document.createElement('div'); 16 | this.el.className = elClassName || 'console'; 17 | this.messageHistoryCount = messageHistoryCount || this.messageHistoryCount; 18 | this.game = game; 19 | }; 20 | 21 | Console.prototype = { 22 | constructor: Console, 23 | 24 | /** 25 | * Game instance this obj is attached to. 26 | * @property game 27 | * @type Game 28 | */ 29 | game: null, 30 | 31 | /** 32 | * Element containing console messages. 33 | * Must be manually added to the DOM 34 | * @property el 35 | * @type HTMLElement 36 | */ 37 | el: null, 38 | 39 | /** 40 | * Number of messages to display at once. 41 | * @property messageHistoryCount 42 | * @type Number 43 | */ 44 | messageHistoryCount: 5, 45 | 46 | /** 47 | * Adds a message to the console. 48 | * @method log 49 | * @param {String} - Message to be added. 50 | */ 51 | log: function(message){ 52 | if(this.el.children.length > this.messageHistoryCount - 1){ 53 | var childEl = this.el.childNodes[0]; 54 | childEl.remove(); 55 | } 56 | 57 | var messageEl = document.createElement('div'); 58 | messageEl.innerHTML = message; 59 | this.el.appendChild(messageEl); 60 | 61 | }, 62 | }; 63 | 64 | root.RL.Console = Console; 65 | 66 | }(this)); -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/print.less: -------------------------------------------------------------------------------- 1 | // 2 | // Basic print styles 3 | // -------------------------------------------------- 4 | // Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css 5 | 6 | @media print { 7 | * { 8 | background: transparent !important; 9 | color: #000 !important; // Black prints faster: h5bp.com/s 10 | box-shadow: none !important; 11 | text-shadow: none !important; 12 | } 13 | 14 | a, 15 | a:visited { 16 | text-decoration: underline; 17 | } 18 | 19 | a[href]:after { 20 | content: " (" attr(href) ")"; 21 | } 22 | 23 | abbr[title]:after { 24 | content: " (" attr(title) ")"; 25 | } 26 | 27 | // Don't show links that are fragment identifiers, 28 | // or use the `javascript:` pseudo protocol 29 | a[href^="#"]:after, 30 | a[href^="javascript:"]:after { 31 | content: ""; 32 | } 33 | 34 | pre, 35 | blockquote { 36 | border: 1px solid #999; 37 | page-break-inside: avoid; 38 | } 39 | 40 | thead { 41 | display: table-header-group; // h5bp.com/t 42 | } 43 | 44 | tr, 45 | img { 46 | page-break-inside: avoid; 47 | } 48 | 49 | img { 50 | max-width: 100% !important; 51 | } 52 | 53 | p, 54 | h2, 55 | h3 { 56 | orphans: 3; 57 | widows: 3; 58 | } 59 | 60 | h2, 61 | h3 { 62 | page-break-after: avoid; 63 | } 64 | 65 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 66 | // Once fixed, we can just straight up remove this. 67 | select { 68 | background: #fff !important; 69 | } 70 | 71 | // Bootstrap components 72 | .navbar { 73 | display: none; 74 | } 75 | .btn, 76 | .dropup > .btn { 77 | > .caret { 78 | border-top-color: #000 !important; 79 | } 80 | } 81 | .label { 82 | border: 1px solid #000; 83 | } 84 | 85 | .table { 86 | border-collapse: collapse !important; 87 | 88 | td, 89 | th { 90 | background-color: #fff !important; 91 | } 92 | } 93 | .table-bordered { 94 | th, 95 | td { 96 | border: 1px solid #ddd !important; 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/print.less: -------------------------------------------------------------------------------- 1 | // 2 | // Basic print styles 3 | // -------------------------------------------------- 4 | // Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css 5 | 6 | @media print { 7 | * { 8 | background: transparent !important; 9 | color: #000 !important; // Black prints faster: h5bp.com/s 10 | box-shadow: none !important; 11 | text-shadow: none !important; 12 | } 13 | 14 | a, 15 | a:visited { 16 | text-decoration: underline; 17 | } 18 | 19 | a[href]:after { 20 | content: " (" attr(href) ")"; 21 | } 22 | 23 | abbr[title]:after { 24 | content: " (" attr(title) ")"; 25 | } 26 | 27 | // Don't show links that are fragment identifiers, 28 | // or use the `javascript:` pseudo protocol 29 | a[href^="#"]:after, 30 | a[href^="javascript:"]:after { 31 | content: ""; 32 | } 33 | 34 | pre, 35 | blockquote { 36 | border: 1px solid #999; 37 | page-break-inside: avoid; 38 | } 39 | 40 | thead { 41 | display: table-header-group; // h5bp.com/t 42 | } 43 | 44 | tr, 45 | img { 46 | page-break-inside: avoid; 47 | } 48 | 49 | img { 50 | max-width: 100% !important; 51 | } 52 | 53 | p, 54 | h2, 55 | h3 { 56 | orphans: 3; 57 | widows: 3; 58 | } 59 | 60 | h2, 61 | h3 { 62 | page-break-after: avoid; 63 | } 64 | 65 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 66 | // Once fixed, we can just straight up remove this. 67 | select { 68 | background: #fff !important; 69 | } 70 | 71 | // Bootstrap components 72 | .navbar { 73 | display: none; 74 | } 75 | .btn, 76 | .dropup > .btn { 77 | > .caret { 78 | border-top-color: #000 !important; 79 | } 80 | } 81 | .label { 82 | border: 1px solid #000; 83 | } 84 | 85 | .table { 86 | border-collapse: collapse !important; 87 | 88 | td, 89 | th { 90 | background-color: #fff !important; 91 | } 92 | } 93 | .table-bordered { 94 | th, 95 | td { 96 | border: 1px solid #ddd !important; 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /manual/assets/less/main.less: -------------------------------------------------------------------------------- 1 | // v 3.2.0 2 | // https://github.com/twbs/bootstrap/commit/e33922eb06387fd4ed3a090360a2bc38cf7b8d70 3 | @import "bootstrap/bootstrap.less"; 4 | @font-face { 5 | font-family: 'DejaVuSansMono'; 6 | src: url('../fonts/DejaVuSansMono.eot'); 7 | src: url('../fonts/DejaVuSansMono.eot?#iefix') format('eot'), 8 | url('../fonts/DejaVuSansMono.woff') format('woff'), 9 | url('../fonts/DejaVuSansMono.ttf') format('truetype'); 10 | } 11 | 12 | b, 13 | strong { 14 | font-weight: bold; 15 | color: #d9d9d9; 16 | } 17 | 18 | .page { 19 | padding-top: 10px; 20 | } 21 | .page-title { 22 | margin-bottom: (@line-height-computed); 23 | } 24 | .section { 25 | padding-bottom: (@line-height-computed / 2); 26 | } 27 | .section-heading { 28 | .make-row(); 29 | 30 | background: #0f0f0f; 31 | border-top: 1px solid #333; 32 | > h1, h2, h3, h4, h5, h6 { 33 | margin-top: (@line-height-computed / 2); 34 | margin-bottom: (@line-height-computed / 2); 35 | } 36 | margin-top: (@line-height-computed / 2); 37 | margin-bottom: (@line-height-computed); 38 | padding-bottom: 1px; 39 | } 40 | 41 | .section-subheading { 42 | background: #0f0f0f; 43 | border-top: 1px solid #333; 44 | > h1, h2, h3, h4, h5, h6 { 45 | margin-top: (@line-height-computed / 2); 46 | margin-bottom: (@line-height-computed / 2); 47 | } 48 | margin-bottom: (@line-height-computed); 49 | padding-bottom: 1px; 50 | } 51 | 52 | .game-container { 53 | // border: 1px solid #333; 54 | } 55 | .ex-code { 56 | width: 100%; 57 | } 58 | pre[class*="language-"] { 59 | padding: 1em; 60 | } 61 | 62 | .panel-default { 63 | .panel-heading { 64 | background: #141414; 65 | border-left: 1px solid #1d1d1d; 66 | border-right: 1px solid #1d1d1d; 67 | // border-bottom: 1px solid #161616; 68 | } 69 | 70 | .panel-body { 71 | border: 1px solid #1d1d1d; 72 | border-top:0; 73 | } 74 | } 75 | 76 | .ex-code-input { 77 | display: block; 78 | font-family: 'DejaVuSansMono', monospace; 79 | width: 100%; 80 | min-height: 300px; 81 | } 82 | 83 | .panel-heading .btn { 84 | margin-top: -5px; 85 | } 86 | 87 | .heading-controls { 88 | border-bottom: 1px dotted #353535; 89 | padding-bottom: 10px; 90 | } 91 | -------------------------------------------------------------------------------- /manual-src/assets/less/main.less: -------------------------------------------------------------------------------- 1 | // v 3.2.0 2 | // https://github.com/twbs/bootstrap/commit/e33922eb06387fd4ed3a090360a2bc38cf7b8d70 3 | @import "bootstrap/bootstrap.less"; 4 | @font-face { 5 | font-family: 'DejaVuSansMono'; 6 | src: url('../fonts/DejaVuSansMono.eot'); 7 | src: url('../fonts/DejaVuSansMono.eot?#iefix') format('eot'), 8 | url('../fonts/DejaVuSansMono.woff') format('woff'), 9 | url('../fonts/DejaVuSansMono.ttf') format('truetype'); 10 | } 11 | 12 | b, 13 | strong { 14 | font-weight: bold; 15 | color: #d9d9d9; 16 | } 17 | 18 | .page { 19 | padding-top: 10px; 20 | } 21 | .page-title { 22 | margin-bottom: (@line-height-computed); 23 | } 24 | .section { 25 | padding-bottom: (@line-height-computed / 2); 26 | } 27 | .section-heading { 28 | .make-row(); 29 | 30 | background: #0f0f0f; 31 | border-top: 1px solid #333; 32 | > h1, h2, h3, h4, h5, h6 { 33 | margin-top: (@line-height-computed / 2); 34 | margin-bottom: (@line-height-computed / 2); 35 | } 36 | margin-top: (@line-height-computed / 2); 37 | margin-bottom: (@line-height-computed); 38 | padding-bottom: 1px; 39 | } 40 | 41 | .section-subheading { 42 | background: #0f0f0f; 43 | border-top: 1px solid #333; 44 | > h1, h2, h3, h4, h5, h6 { 45 | margin-top: (@line-height-computed / 2); 46 | margin-bottom: (@line-height-computed / 2); 47 | } 48 | margin-bottom: (@line-height-computed); 49 | padding-bottom: 1px; 50 | } 51 | 52 | .game-container { 53 | // border: 1px solid #333; 54 | } 55 | .ex-code { 56 | width: 100%; 57 | } 58 | pre[class*="language-"] { 59 | padding: 1em; 60 | } 61 | 62 | .panel-default { 63 | .panel-heading { 64 | background: #141414; 65 | border-left: 1px solid #1d1d1d; 66 | border-right: 1px solid #1d1d1d; 67 | // border-bottom: 1px solid #161616; 68 | } 69 | 70 | .panel-body { 71 | border: 1px solid #1d1d1d; 72 | border-top:0; 73 | } 74 | } 75 | 76 | .ex-code-input { 77 | display: block; 78 | font-family: 'DejaVuSansMono', monospace; 79 | width: 100%; 80 | min-height: 300px; 81 | } 82 | 83 | .panel-heading .btn { 84 | margin-top: -5px; 85 | } 86 | 87 | .heading-controls { 88 | border-bottom: 1px dotted #353535; 89 | padding-bottom: 10px; 90 | } 91 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: @pagination-hover-color; 44 | background-color: @pagination-hover-bg; 45 | border-color: @pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: @pagination-active-color; 56 | background-color: @pagination-active-bg; 57 | border-color: @pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: @pagination-disabled-color; 70 | background-color: @pagination-disabled-bg; 71 | border-color: @pagination-disabled-border; 72 | cursor: not-allowed; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | color: @pagination-color; 20 | background-color: @pagination-bg; 21 | border: 1px solid @pagination-border; 22 | margin-left: -1px; 23 | } 24 | &:first-child { 25 | > a, 26 | > span { 27 | margin-left: 0; 28 | .border-left-radius(@border-radius-base); 29 | } 30 | } 31 | &:last-child { 32 | > a, 33 | > span { 34 | .border-right-radius(@border-radius-base); 35 | } 36 | } 37 | } 38 | 39 | > li > a, 40 | > li > span { 41 | &:hover, 42 | &:focus { 43 | color: @pagination-hover-color; 44 | background-color: @pagination-hover-bg; 45 | border-color: @pagination-hover-border; 46 | } 47 | } 48 | 49 | > .active > a, 50 | > .active > span { 51 | &, 52 | &:hover, 53 | &:focus { 54 | z-index: 2; 55 | color: @pagination-active-color; 56 | background-color: @pagination-active-bg; 57 | border-color: @pagination-active-border; 58 | cursor: default; 59 | } 60 | } 61 | 62 | > .disabled { 63 | > span, 64 | > span:hover, 65 | > span:focus, 66 | > a, 67 | > a:hover, 68 | > a:focus { 69 | color: @pagination-disabled-color; 70 | background-color: @pagination-disabled-bg; 71 | border-color: @pagination-disabled-border; 72 | cursor: not-allowed; 73 | } 74 | } 75 | } 76 | 77 | // Sizing 78 | // -------------------------------------------------- 79 | 80 | // Large 81 | .pagination-lg { 82 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 83 | } 84 | 85 | // Small 86 | .pagination-sm { 87 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 88 | } 89 | -------------------------------------------------------------------------------- /manual/index/game/js/basic.js: -------------------------------------------------------------------------------- 1 | // create the game instance 2 | var game = new RL.Game(); 3 | 4 | var mapData = [ 5 | "#####################", 6 | "#.........#.........#", 7 | "#....Z....#....##...#", 8 | "#.........+....##...#", 9 | "#.........#.........#", 10 | "#.#..#..#.#.........#", 11 | "#.........#...####+##", 12 | "#.........#...#.....#", 13 | "#.........#...#.....#", 14 | "#.........#...#.....#", 15 | "#####################" 16 | ]; 17 | 18 | var mapCharToType = { 19 | '#': 'wall', 20 | '.': 'floor', 21 | '+': 'door' 22 | }; 23 | 24 | var entityCharToType = { 25 | 'Z': 'zombie' 26 | }; 27 | 28 | var keyBindings = { 29 | up: ['UP_ARROW', 'K', 'W'], 30 | down: ['DOWN_ARROW', 'J', 'S'], 31 | left: ['LEFT_ARROW', 'H', 'A'], 32 | right: ['RIGHT_ARROW', 'L', 'D'], 33 | }; 34 | 35 | game.map.loadTilesFromArrayString(mapData, mapCharToType, 'floor'); 36 | game.entityManager.loadFromArrayString(mapData, entityCharToType); 37 | 38 | // add some lights 39 | game.lighting.set(3, 7, 255, 0, 0); 40 | game.lighting.set(7, 7, 0, 0, 255); 41 | 42 | // generate and assign a map object (repaces empty default) 43 | game.setMapSize(game.map.width, game.map.height); 44 | 45 | // add input keybindings 46 | game.input.addBindings(keyBindings); 47 | 48 | // create entities and add to game.entityManager 49 | var entZombie = new RL.Entity(game, 'zombie'); 50 | game.entityManager.add(2, 8, entZombie); 51 | 52 | // or just add by entity type 53 | game.entityManager.add(5, 9, 'zombie'); 54 | 55 | // set player starting position 56 | game.player.x = 3; 57 | game.player.y = 3; 58 | 59 | // make the view a little smaller 60 | game.renderer.resize(10, 14); 61 | 62 | // get existing DOM elements 63 | var mapContainerEl = document.getElementById('example-map-container'); 64 | var consoleContainerEl = document.getElementById('example-console-container'); 65 | 66 | // append elements created by the game to the DOM 67 | mapContainerEl.appendChild(game.renderer.canvas); 68 | consoleContainerEl.appendChild(game.console.el); 69 | 70 | game.renderer.layers = [ 71 | new RL.RendererLayer(game, 'map', {draw: false, mergeWithPrevLayer: false}), 72 | new RL.RendererLayer(game, 'entity', {draw: false, mergeWithPrevLayer: true}), 73 | new RL.RendererLayer(game, 'lighting', {draw: true, mergeWithPrevLayer: false}), 74 | new RL.RendererLayer(game, 'fov', {draw: true, mergeWithPrevLayer: false}), 75 | ]; 76 | 77 | game.console.log('The game starts.'); 78 | // start the game 79 | game.start(); 80 | -------------------------------------------------------------------------------- /manual-src/src/index/game/js/basic.js: -------------------------------------------------------------------------------- 1 | // create the game instance 2 | var game = new RL.Game(); 3 | 4 | var mapData = [ 5 | "#####################", 6 | "#.........#.........#", 7 | "#....Z....#....##...#", 8 | "#.........+....##...#", 9 | "#.........#.........#", 10 | "#.#..#..#.#.........#", 11 | "#.........#...####+##", 12 | "#.........#...#.....#", 13 | "#.........#...#.....#", 14 | "#.........#...#.....#", 15 | "#####################" 16 | ]; 17 | 18 | var mapCharToType = { 19 | '#': 'wall', 20 | '.': 'floor', 21 | '+': 'door' 22 | }; 23 | 24 | var entityCharToType = { 25 | 'Z': 'zombie' 26 | }; 27 | 28 | var keyBindings = { 29 | up: ['UP_ARROW', 'K', 'W'], 30 | down: ['DOWN_ARROW', 'J', 'S'], 31 | left: ['LEFT_ARROW', 'H', 'A'], 32 | right: ['RIGHT_ARROW', 'L', 'D'], 33 | }; 34 | 35 | game.map.loadTilesFromArrayString(mapData, mapCharToType, 'floor'); 36 | game.entityManager.loadFromArrayString(mapData, entityCharToType); 37 | 38 | // add some lights 39 | game.lighting.set(3, 7, 255, 0, 0); 40 | game.lighting.set(7, 7, 0, 0, 255); 41 | 42 | // generate and assign a map object (repaces empty default) 43 | game.setMapSize(game.map.width, game.map.height); 44 | 45 | // add input keybindings 46 | game.input.addBindings(keyBindings); 47 | 48 | // create entities and add to game.entityManager 49 | var entZombie = new RL.Entity(game, 'zombie'); 50 | game.entityManager.add(2, 8, entZombie); 51 | 52 | // or just add by entity type 53 | game.entityManager.add(5, 9, 'zombie'); 54 | 55 | // set player starting position 56 | game.player.x = 3; 57 | game.player.y = 3; 58 | 59 | // make the view a little smaller 60 | game.renderer.resize(10, 14); 61 | 62 | // get existing DOM elements 63 | var mapContainerEl = document.getElementById('example-map-container'); 64 | var consoleContainerEl = document.getElementById('example-console-container'); 65 | 66 | // append elements created by the game to the DOM 67 | mapContainerEl.appendChild(game.renderer.canvas); 68 | consoleContainerEl.appendChild(game.console.el); 69 | 70 | game.renderer.layers = [ 71 | new RL.RendererLayer(game, 'map', {draw: false, mergeWithPrevLayer: false}), 72 | new RL.RendererLayer(game, 'entity', {draw: false, mergeWithPrevLayer: true}), 73 | new RL.RendererLayer(game, 'lighting', {draw: true, mergeWithPrevLayer: false}), 74 | new RL.RendererLayer(game, 'fov', {draw: true, mergeWithPrevLayer: false}), 75 | ]; 76 | 77 | game.console.log('The game starts.'); 78 | // start the game 79 | game.start(); 80 | -------------------------------------------------------------------------------- /manual-src/tpl/page-class.dust: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {title} 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | {> "manual-src/tpl/breadcrumb" /} 16 | {?nav_children.primary} 17 |

    18 | {#yui_class_data.description} 19 | {yui_class_data.description} 20 | {:else} 21 | No class description. 22 | {/yui_class_data.description} 23 |

    24 | {/nav_children.primary} 25 |
    26 | 27 |
    28 |
    29 |
    30 | Examples 31 |
    32 |
    33 |
      34 | {#nav_children.primary} 35 | {> "manual-src/tpl/nav" root_path=nav_path /} 36 | {/nav_children.primary} 37 |
    38 |
    39 |
    40 |
    41 |
    42 |
    43 | Related API Docs 44 |
    45 | 52 |
    53 |
    54 |
    55 | {#contents} 56 |
    57 | {contents|s} 58 |
    59 | {/contents} 60 | 61 | 62 | 63 | 64 | 65 | {> "manual-src/tpl/footer" /} 66 |
    67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /manual/assets/js/bootstrap/alert.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: alert.js v3.2.0 3 | * http://getbootstrap.com/javascript/#alerts 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // ALERT CLASS DEFINITION 14 | // ====================== 15 | 16 | var dismiss = '[data-dismiss="alert"]' 17 | var Alert = function (el) { 18 | $(el).on('click', dismiss, this.close) 19 | } 20 | 21 | Alert.VERSION = '3.2.0' 22 | 23 | Alert.TRANSITION_DURATION = 150 24 | 25 | Alert.prototype.close = function (e) { 26 | var $this = $(this) 27 | var selector = $this.attr('data-target') 28 | 29 | if (!selector) { 30 | selector = $this.attr('href') 31 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 32 | } 33 | 34 | var $parent = $(selector) 35 | 36 | if (e) e.preventDefault() 37 | 38 | if (!$parent.length) { 39 | $parent = $this.closest('.alert') 40 | } 41 | 42 | $parent.trigger(e = $.Event('close.bs.alert')) 43 | 44 | if (e.isDefaultPrevented()) return 45 | 46 | $parent.removeClass('in') 47 | 48 | function removeElement() { 49 | // detach from parent, fire event then clean up data 50 | $parent.detach().trigger('closed.bs.alert').remove() 51 | } 52 | 53 | $.support.transition && $parent.hasClass('fade') ? 54 | $parent 55 | .one('bsTransitionEnd', removeElement) 56 | .emulateTransitionEnd(Alert.TRANSITION_DURATION) : 57 | removeElement() 58 | } 59 | 60 | 61 | // ALERT PLUGIN DEFINITION 62 | // ======================= 63 | 64 | function Plugin(option) { 65 | return this.each(function () { 66 | var $this = $(this) 67 | var data = $this.data('bs.alert') 68 | 69 | if (!data) $this.data('bs.alert', (data = new Alert(this))) 70 | if (typeof option == 'string') data[option].call($this) 71 | }) 72 | } 73 | 74 | var old = $.fn.alert 75 | 76 | $.fn.alert = Plugin 77 | $.fn.alert.Constructor = Alert 78 | 79 | 80 | // ALERT NO CONFLICT 81 | // ================= 82 | 83 | $.fn.alert.noConflict = function () { 84 | $.fn.alert = old 85 | return this 86 | } 87 | 88 | 89 | // ALERT DATA-API 90 | // ============== 91 | 92 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 93 | 94 | }(jQuery); 95 | -------------------------------------------------------------------------------- /manual-src/assets/js/bootstrap/alert.js: -------------------------------------------------------------------------------- 1 | /* ======================================================================== 2 | * Bootstrap: alert.js v3.2.0 3 | * http://getbootstrap.com/javascript/#alerts 4 | * ======================================================================== 5 | * Copyright 2011-2014 Twitter, Inc. 6 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 | * ======================================================================== */ 8 | 9 | 10 | +function ($) { 11 | 'use strict'; 12 | 13 | // ALERT CLASS DEFINITION 14 | // ====================== 15 | 16 | var dismiss = '[data-dismiss="alert"]' 17 | var Alert = function (el) { 18 | $(el).on('click', dismiss, this.close) 19 | } 20 | 21 | Alert.VERSION = '3.2.0' 22 | 23 | Alert.TRANSITION_DURATION = 150 24 | 25 | Alert.prototype.close = function (e) { 26 | var $this = $(this) 27 | var selector = $this.attr('data-target') 28 | 29 | if (!selector) { 30 | selector = $this.attr('href') 31 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 32 | } 33 | 34 | var $parent = $(selector) 35 | 36 | if (e) e.preventDefault() 37 | 38 | if (!$parent.length) { 39 | $parent = $this.closest('.alert') 40 | } 41 | 42 | $parent.trigger(e = $.Event('close.bs.alert')) 43 | 44 | if (e.isDefaultPrevented()) return 45 | 46 | $parent.removeClass('in') 47 | 48 | function removeElement() { 49 | // detach from parent, fire event then clean up data 50 | $parent.detach().trigger('closed.bs.alert').remove() 51 | } 52 | 53 | $.support.transition && $parent.hasClass('fade') ? 54 | $parent 55 | .one('bsTransitionEnd', removeElement) 56 | .emulateTransitionEnd(Alert.TRANSITION_DURATION) : 57 | removeElement() 58 | } 59 | 60 | 61 | // ALERT PLUGIN DEFINITION 62 | // ======================= 63 | 64 | function Plugin(option) { 65 | return this.each(function () { 66 | var $this = $(this) 67 | var data = $this.data('bs.alert') 68 | 69 | if (!data) $this.data('bs.alert', (data = new Alert(this))) 70 | if (typeof option == 'string') data[option].call($this) 71 | }) 72 | } 73 | 74 | var old = $.fn.alert 75 | 76 | $.fn.alert = Plugin 77 | $.fn.alert.Constructor = Alert 78 | 79 | 80 | // ALERT NO CONFLICT 81 | // ================= 82 | 83 | $.fn.alert.noConflict = function () { 84 | $.fn.alert = old 85 | return this 86 | } 87 | 88 | 89 | // ALERT DATA-API 90 | // ============== 91 | 92 | $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 93 | 94 | }(jQuery); 95 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | 23 | // Bar itself 24 | // ------------------------- 25 | 26 | // Outer container 27 | .progress { 28 | overflow: hidden; 29 | height: @line-height-computed; 30 | margin-bottom: @line-height-computed; 31 | background-color: @progress-bg; 32 | border-radius: @progress-border-radius; 33 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 34 | } 35 | 36 | // Bar of progress 37 | .progress-bar { 38 | float: left; 39 | width: 0%; 40 | height: 100%; 41 | font-size: @font-size-small; 42 | line-height: @line-height-computed; 43 | color: @progress-bar-color; 44 | text-align: center; 45 | background-color: @progress-bar-bg; 46 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 47 | .transition(width .6s ease); 48 | } 49 | 50 | // Striped bars 51 | // 52 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 53 | // `.progress-bar-striped` class, which you just add to an existing 54 | // `.progress-bar`. 55 | .progress-striped .progress-bar, 56 | .progress-bar-striped { 57 | #gradient > .striped(); 58 | background-size: 40px 40px; 59 | } 60 | 61 | // Call animation for the active one 62 | // 63 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 64 | // `.progress-bar.active` approach. 65 | .progress.active .progress-bar, 66 | .progress-bar.active { 67 | .animation(progress-bar-stripes 2s linear infinite); 68 | } 69 | 70 | // Account for lower percentages 71 | .progress-bar { 72 | &[aria-valuenow="0"] { 73 | color: @gray-light; 74 | min-width: 30px; 75 | background-color: transparent; 76 | background-image: none; 77 | box-shadow: none; 78 | } 79 | } 80 | 81 | 82 | 83 | // Variations 84 | // ------------------------- 85 | 86 | .progress-bar-success { 87 | .progress-bar-variant(@progress-bar-success-bg); 88 | } 89 | 90 | .progress-bar-info { 91 | .progress-bar-variant(@progress-bar-info-bg); 92 | } 93 | 94 | .progress-bar-warning { 95 | .progress-bar-variant(@progress-bar-warning-bg); 96 | } 97 | 98 | .progress-bar-danger { 99 | .progress-bar-variant(@progress-bar-danger-bg); 100 | } 101 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Spec and IE10+ 16 | @keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | 22 | 23 | // Bar itself 24 | // ------------------------- 25 | 26 | // Outer container 27 | .progress { 28 | overflow: hidden; 29 | height: @line-height-computed; 30 | margin-bottom: @line-height-computed; 31 | background-color: @progress-bg; 32 | border-radius: @progress-border-radius; 33 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 34 | } 35 | 36 | // Bar of progress 37 | .progress-bar { 38 | float: left; 39 | width: 0%; 40 | height: 100%; 41 | font-size: @font-size-small; 42 | line-height: @line-height-computed; 43 | color: @progress-bar-color; 44 | text-align: center; 45 | background-color: @progress-bar-bg; 46 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 47 | .transition(width .6s ease); 48 | } 49 | 50 | // Striped bars 51 | // 52 | // `.progress-striped .progress-bar` is deprecated as of v3.2.0 in favor of the 53 | // `.progress-bar-striped` class, which you just add to an existing 54 | // `.progress-bar`. 55 | .progress-striped .progress-bar, 56 | .progress-bar-striped { 57 | #gradient > .striped(); 58 | background-size: 40px 40px; 59 | } 60 | 61 | // Call animation for the active one 62 | // 63 | // `.progress.active .progress-bar` is deprecated as of v3.2.0 in favor of the 64 | // `.progress-bar.active` approach. 65 | .progress.active .progress-bar, 66 | .progress-bar.active { 67 | .animation(progress-bar-stripes 2s linear infinite); 68 | } 69 | 70 | // Account for lower percentages 71 | .progress-bar { 72 | &[aria-valuenow="0"] { 73 | color: @gray-light; 74 | min-width: 30px; 75 | background-color: transparent; 76 | background-image: none; 77 | box-shadow: none; 78 | } 79 | } 80 | 81 | 82 | 83 | // Variations 84 | // ------------------------- 85 | 86 | .progress-bar-success { 87 | .progress-bar-variant(@progress-bar-success-bg); 88 | } 89 | 90 | .progress-bar-info { 91 | .progress-bar-variant(@progress-bar-info-bg); 92 | } 93 | 94 | .progress-bar-warning { 95 | .progress-bar-variant(@progress-bar-warning-bg); 96 | } 97 | 98 | .progress-bar-danger { 99 | .progress-bar-variant(@progress-bar-danger-bg); 100 | } 101 | -------------------------------------------------------------------------------- /manual/index/tile.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Tile 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 19 | 20 |

    21 | 22 | Represents a tile in the game map. 23 | 24 |

    25 | 26 |
    27 | 28 |
    29 |
    30 |
    31 | Examples 32 |
    33 |
    34 |
      35 | 36 |
    1. 37 | 38 | Defining Types 39 | 40 | 41 | 42 |
    2. 43 | 44 |
    45 |
    46 |
    47 |
    48 |
    49 |
    50 | Related API Docs 51 |
    52 | 59 |
    60 |
    61 |
    62 | 63 | 64 | 65 | 66 | 67 | 68 |
    69 |
    70 | Examples are designed to be simple and easily editable once Downloaded. 71 |
    72 |
    73 |
    74 |

    75 | Roguelike JS Skeleton 76 | | 77 | Manual Home 78 | | 79 | Github 80 | | 81 | Download Zip 82 |

    83 | 84 |
    85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /manual/index/input.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Input 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 19 | 20 |

    21 | 22 | Helper for binding user key input to actions. 23 | 24 |

    25 | 26 |
    27 | 28 |
    29 |
    30 |
    31 | Examples 32 |
    33 |
    34 |
      35 | 36 |
    1. 37 | 38 | Triggered Actions 39 | 40 | 41 | 42 |
    2. 43 | 44 |
    45 |
    46 |
    47 |
    48 |
    49 |
    50 | Related API Docs 51 |
    52 | 59 |
    60 |
    61 |
    62 | 63 | 64 | 65 | 66 | 67 | 68 |
    69 |
    70 | Examples are designed to be simple and easily editable once Downloaded. 71 |
    72 |
    73 |
    74 |

    75 | Roguelike JS Skeleton 76 | | 77 | Manual Home 78 | | 79 | Github 80 | | 81 | Download Zip 82 |

    83 | 84 |
    85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /manual/index/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Game 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 19 | 20 |

    21 | 22 | Container for all game objects. 23 | Handles updating the state of game objects each turn. 24 | Listens for player input to trigger and resolve new turns. 25 | 26 |

    27 | 28 |
    29 | 30 |
    31 |
    32 |
    33 | Examples 34 |
    35 |
    36 |
      37 | 38 |
    1. 39 | 40 | Basic Example 41 | 42 | 43 | 44 |
    2. 45 | 46 |
    47 |
    48 |
    49 |
    50 |
    51 |
    52 | Related API Docs 53 |
    54 | 61 |
    62 |
    63 |
    64 | 65 | 66 | 67 | 68 | 69 | 70 |
    71 |
    72 | Examples are designed to be simple and easily editable once Downloaded. 73 |
    74 |
    75 |
    76 |

    77 | Roguelike JS Skeleton 78 | | 79 | Manual Home 80 | | 81 | Github 82 | | 83 | Download Zip 84 |

    85 | 86 |
    87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/tooltip.less: -------------------------------------------------------------------------------- 1 | // 2 | // Tooltips 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .tooltip { 8 | position: absolute; 9 | z-index: @zindex-tooltip; 10 | display: block; 11 | visibility: visible; 12 | font-size: @font-size-small; 13 | line-height: 1.4; 14 | .opacity(0); 15 | 16 | &.in { .opacity(@tooltip-opacity); } 17 | &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; } 18 | &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; } 19 | &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; } 20 | &.left { margin-left: -3px; padding: 0 @tooltip-arrow-width; } 21 | } 22 | 23 | // Wrapper for the tooltip content 24 | .tooltip-inner { 25 | max-width: @tooltip-max-width; 26 | padding: 3px 8px; 27 | color: @tooltip-color; 28 | text-align: center; 29 | text-decoration: none; 30 | background-color: @tooltip-bg; 31 | border-radius: @border-radius-base; 32 | } 33 | 34 | // Arrows 35 | .tooltip-arrow { 36 | position: absolute; 37 | width: 0; 38 | height: 0; 39 | border-color: transparent; 40 | border-style: solid; 41 | } 42 | .tooltip { 43 | &.top .tooltip-arrow { 44 | bottom: 0; 45 | left: 50%; 46 | margin-left: -@tooltip-arrow-width; 47 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 48 | border-top-color: @tooltip-arrow-color; 49 | } 50 | &.top-left .tooltip-arrow { 51 | bottom: 0; 52 | left: @tooltip-arrow-width; 53 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 54 | border-top-color: @tooltip-arrow-color; 55 | } 56 | &.top-right .tooltip-arrow { 57 | bottom: 0; 58 | right: @tooltip-arrow-width; 59 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 60 | border-top-color: @tooltip-arrow-color; 61 | } 62 | &.right .tooltip-arrow { 63 | top: 50%; 64 | left: 0; 65 | margin-top: -@tooltip-arrow-width; 66 | border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0; 67 | border-right-color: @tooltip-arrow-color; 68 | } 69 | &.left .tooltip-arrow { 70 | top: 50%; 71 | right: 0; 72 | margin-top: -@tooltip-arrow-width; 73 | border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width; 74 | border-left-color: @tooltip-arrow-color; 75 | } 76 | &.bottom .tooltip-arrow { 77 | top: 0; 78 | left: 50%; 79 | margin-left: -@tooltip-arrow-width; 80 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 81 | border-bottom-color: @tooltip-arrow-color; 82 | } 83 | &.bottom-left .tooltip-arrow { 84 | top: 0; 85 | left: @tooltip-arrow-width; 86 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 87 | border-bottom-color: @tooltip-arrow-color; 88 | } 89 | &.bottom-right .tooltip-arrow { 90 | top: 0; 91 | right: @tooltip-arrow-width; 92 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 93 | border-bottom-color: @tooltip-arrow-color; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/tooltip.less: -------------------------------------------------------------------------------- 1 | // 2 | // Tooltips 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .tooltip { 8 | position: absolute; 9 | z-index: @zindex-tooltip; 10 | display: block; 11 | visibility: visible; 12 | font-size: @font-size-small; 13 | line-height: 1.4; 14 | .opacity(0); 15 | 16 | &.in { .opacity(@tooltip-opacity); } 17 | &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; } 18 | &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; } 19 | &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; } 20 | &.left { margin-left: -3px; padding: 0 @tooltip-arrow-width; } 21 | } 22 | 23 | // Wrapper for the tooltip content 24 | .tooltip-inner { 25 | max-width: @tooltip-max-width; 26 | padding: 3px 8px; 27 | color: @tooltip-color; 28 | text-align: center; 29 | text-decoration: none; 30 | background-color: @tooltip-bg; 31 | border-radius: @border-radius-base; 32 | } 33 | 34 | // Arrows 35 | .tooltip-arrow { 36 | position: absolute; 37 | width: 0; 38 | height: 0; 39 | border-color: transparent; 40 | border-style: solid; 41 | } 42 | .tooltip { 43 | &.top .tooltip-arrow { 44 | bottom: 0; 45 | left: 50%; 46 | margin-left: -@tooltip-arrow-width; 47 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 48 | border-top-color: @tooltip-arrow-color; 49 | } 50 | &.top-left .tooltip-arrow { 51 | bottom: 0; 52 | left: @tooltip-arrow-width; 53 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 54 | border-top-color: @tooltip-arrow-color; 55 | } 56 | &.top-right .tooltip-arrow { 57 | bottom: 0; 58 | right: @tooltip-arrow-width; 59 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0; 60 | border-top-color: @tooltip-arrow-color; 61 | } 62 | &.right .tooltip-arrow { 63 | top: 50%; 64 | left: 0; 65 | margin-top: -@tooltip-arrow-width; 66 | border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0; 67 | border-right-color: @tooltip-arrow-color; 68 | } 69 | &.left .tooltip-arrow { 70 | top: 50%; 71 | right: 0; 72 | margin-top: -@tooltip-arrow-width; 73 | border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width; 74 | border-left-color: @tooltip-arrow-color; 75 | } 76 | &.bottom .tooltip-arrow { 77 | top: 0; 78 | left: 50%; 79 | margin-left: -@tooltip-arrow-width; 80 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 81 | border-bottom-color: @tooltip-arrow-color; 82 | } 83 | &.bottom-left .tooltip-arrow { 84 | top: 0; 85 | left: @tooltip-arrow-width; 86 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 87 | border-bottom-color: @tooltip-arrow-color; 88 | } 89 | &.bottom-right .tooltip-arrow { 90 | top: 0; 91 | right: @tooltip-arrow-width; 92 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width; 93 | border-bottom-color: @tooltip-arrow-color; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/forms.less: -------------------------------------------------------------------------------- 1 | // Form validation states 2 | // 3 | // Used in forms.less to generate the form validation CSS for warnings, errors, 4 | // and successes. 5 | 6 | .form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { 7 | // Color the label and help text 8 | .help-block, 9 | .control-label, 10 | .radio, 11 | .checkbox, 12 | .radio-inline, 13 | .checkbox-inline, 14 | &.radio label, 15 | &.checkbox label, 16 | &.radio-inline label, 17 | &.checkbox-inline label { 18 | color: @text-color; 19 | } 20 | // Set the border and box shadow on specific inputs to match 21 | .form-control { 22 | border-color: @border-color; 23 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work 24 | &:focus { 25 | border-color: darken(@border-color, 10%); 26 | @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); 27 | .box-shadow(@shadow); 28 | } 29 | } 30 | // Set validation states also for addons 31 | .input-group-addon { 32 | color: @text-color; 33 | border-color: @border-color; 34 | background-color: @background-color; 35 | } 36 | // Optional feedback icon 37 | .form-control-feedback { 38 | color: @text-color; 39 | } 40 | } 41 | 42 | 43 | // Form control focus state 44 | // 45 | // Generate a customized focus state and for any input with the specified color, 46 | // which defaults to the `@input-border-focus` variable. 47 | // 48 | // We highly encourage you to not customize the default value, but instead use 49 | // this to tweak colors on an as-needed basis. This aesthetic change is based on 50 | // WebKit's default styles, but applicable to a wider range of browsers. Its 51 | // usability and accessibility should be taken into account with any change. 52 | // 53 | // Example usage: change the default blue border and shadow to white for better 54 | // contrast against a dark gray background. 55 | .form-control-focus(@color: @input-border-focus) { 56 | @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); 57 | &:focus { 58 | border-color: @color; 59 | outline: 0; 60 | .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); 61 | } 62 | } 63 | 64 | // Form control sizing 65 | // 66 | // Relative text size, padding, and border-radii changes for form controls. For 67 | // horizontal sizing, wrap controls in the predefined grid classes. `` 68 | // element gets special love because it's special, and that's a fact! 69 | .input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 70 | height: @input-height; 71 | padding: @padding-vertical @padding-horizontal; 72 | font-size: @font-size; 73 | line-height: @line-height; 74 | border-radius: @border-radius; 75 | 76 | select& { 77 | height: @input-height; 78 | line-height: @input-height; 79 | } 80 | 81 | textarea&, 82 | select[multiple]& { 83 | height: auto; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /manual/index/valid-targets.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Valid Targets 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 19 | 20 |

    21 | 22 | Manages a list of valid targets and which is currently selected. 23 | 24 |

    25 | 26 |
    27 | 28 |
    29 |
    30 |
    31 | Examples 32 |
    33 |
    34 |
      35 | 36 |
    1. 37 | 38 | Filtering and Selection 39 | 40 | 41 | 42 |
    2. 43 | 44 |
    45 |
    46 |
    47 |
    48 |
    49 |
    50 | Related API Docs 51 |
    52 | 63 |
    64 |
    65 |
    66 | 67 | 68 | 69 | 70 | 71 | 72 |
    73 |
    74 | Examples are designed to be simple and easily editable once Downloaded. 75 |
    76 |
    77 |
    78 |

    79 | Roguelike JS Skeleton 80 | | 81 | Manual Home 82 | | 83 | Github 84 | | 85 | Download Zip 86 |

    87 | 88 |
    89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/mixins/grid-framework.less: -------------------------------------------------------------------------------- 1 | // Framework grid generation 2 | // 3 | // Used only by Bootstrap to generate the correct number of grid classes given 4 | // any value of `@grid-columns`. 5 | 6 | .make-grid-columns() { 7 | // Common styles for all sizes of grid columns, widths 1-12 8 | .col(@index) when (@index = 1) { // initial 9 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; 10 | .col((@index + 1), @item); 11 | } 12 | .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo 13 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; 14 | .col((@index + 1), ~"@{list}, @{item}"); 15 | } 16 | .col(@index, @list) when (@index > @grid-columns) { // terminal 17 | @{list} { 18 | position: relative; 19 | // Prevent columns from collapsing when empty 20 | min-height: 1px; 21 | // Inner gutter via padding 22 | padding-left: (@grid-gutter-width / 2); 23 | padding-right: (@grid-gutter-width / 2); 24 | } 25 | } 26 | .col(1); // kickstart it 27 | } 28 | 29 | .float-grid-columns(@class) { 30 | .col(@index) when (@index = 1) { // initial 31 | @item: ~".col-@{class}-@{index}"; 32 | .col((@index + 1), @item); 33 | } 34 | .col(@index, @list) when (@index =< @grid-columns) { // general 35 | @item: ~".col-@{class}-@{index}"; 36 | .col((@index + 1), ~"@{list}, @{item}"); 37 | } 38 | .col(@index, @list) when (@index > @grid-columns) { // terminal 39 | @{list} { 40 | float: left; 41 | } 42 | } 43 | .col(1); // kickstart it 44 | } 45 | 46 | .calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) { 47 | .col-@{class}-@{index} { 48 | width: percentage((@index / @grid-columns)); 49 | } 50 | } 51 | .calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) { 52 | .col-@{class}-push-@{index} { 53 | left: percentage((@index / @grid-columns)); 54 | } 55 | } 56 | .calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) { 57 | .col-@{class}-push-0 { 58 | left: auto; 59 | } 60 | } 61 | .calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) { 62 | .col-@{class}-pull-@{index} { 63 | right: percentage((@index / @grid-columns)); 64 | } 65 | } 66 | .calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) { 67 | .col-@{class}-pull-0 { 68 | right: auto; 69 | } 70 | } 71 | .calc-grid-column(@index, @class, @type) when (@type = offset) { 72 | .col-@{class}-offset-@{index} { 73 | margin-left: percentage((@index / @grid-columns)); 74 | } 75 | } 76 | 77 | // Basic looping in LESS 78 | .loop-grid-columns(@index, @class, @type) when (@index >= 0) { 79 | .calc-grid-column(@index, @class, @type); 80 | // next iteration 81 | .loop-grid-columns((@index - 1), @class, @type); 82 | } 83 | 84 | // Create grid for specific class 85 | .make-grid(@class) { 86 | .float-grid-columns(@class); 87 | .loop-grid-columns(@grid-columns, @class, width); 88 | .loop-grid-columns(@grid-columns, @class, pull); 89 | .loop-grid-columns(@grid-columns, @class, push); 90 | .loop-grid-columns(@grid-columns, @class, offset); 91 | } 92 | -------------------------------------------------------------------------------- /manual-src/assets/less/bootstrap/mixins/grid-framework.less: -------------------------------------------------------------------------------- 1 | // Framework grid generation 2 | // 3 | // Used only by Bootstrap to generate the correct number of grid classes given 4 | // any value of `@grid-columns`. 5 | 6 | .make-grid-columns() { 7 | // Common styles for all sizes of grid columns, widths 1-12 8 | .col(@index) when (@index = 1) { // initial 9 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; 10 | .col((@index + 1), @item); 11 | } 12 | .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo 13 | @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; 14 | .col((@index + 1), ~"@{list}, @{item}"); 15 | } 16 | .col(@index, @list) when (@index > @grid-columns) { // terminal 17 | @{list} { 18 | position: relative; 19 | // Prevent columns from collapsing when empty 20 | min-height: 1px; 21 | // Inner gutter via padding 22 | padding-left: (@grid-gutter-width / 2); 23 | padding-right: (@grid-gutter-width / 2); 24 | } 25 | } 26 | .col(1); // kickstart it 27 | } 28 | 29 | .float-grid-columns(@class) { 30 | .col(@index) when (@index = 1) { // initial 31 | @item: ~".col-@{class}-@{index}"; 32 | .col((@index + 1), @item); 33 | } 34 | .col(@index, @list) when (@index =< @grid-columns) { // general 35 | @item: ~".col-@{class}-@{index}"; 36 | .col((@index + 1), ~"@{list}, @{item}"); 37 | } 38 | .col(@index, @list) when (@index > @grid-columns) { // terminal 39 | @{list} { 40 | float: left; 41 | } 42 | } 43 | .col(1); // kickstart it 44 | } 45 | 46 | .calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) { 47 | .col-@{class}-@{index} { 48 | width: percentage((@index / @grid-columns)); 49 | } 50 | } 51 | .calc-grid-column(@index, @class, @type) when (@type = push) and (@index > 0) { 52 | .col-@{class}-push-@{index} { 53 | left: percentage((@index / @grid-columns)); 54 | } 55 | } 56 | .calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) { 57 | .col-@{class}-push-0 { 58 | left: auto; 59 | } 60 | } 61 | .calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) { 62 | .col-@{class}-pull-@{index} { 63 | right: percentage((@index / @grid-columns)); 64 | } 65 | } 66 | .calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) { 67 | .col-@{class}-pull-0 { 68 | right: auto; 69 | } 70 | } 71 | .calc-grid-column(@index, @class, @type) when (@type = offset) { 72 | .col-@{class}-offset-@{index} { 73 | margin-left: percentage((@index / @grid-columns)); 74 | } 75 | } 76 | 77 | // Basic looping in LESS 78 | .loop-grid-columns(@index, @class, @type) when (@index >= 0) { 79 | .calc-grid-column(@index, @class, @type); 80 | // next iteration 81 | .loop-grid-columns((@index - 1), @class, @type); 82 | } 83 | 84 | // Create grid for specific class 85 | .make-grid(@class) { 86 | .float-grid-columns(@class); 87 | .loop-grid-columns(@grid-columns, @class, width); 88 | .loop-grid-columns(@grid-columns, @class, pull); 89 | .loop-grid-columns(@grid-columns, @class, push); 90 | .loop-grid-columns(@grid-columns, @class, offset); 91 | } 92 | -------------------------------------------------------------------------------- /docs/assets/js/api-search.js: -------------------------------------------------------------------------------- 1 | YUI.add('api-search', function (Y) { 2 | 3 | var Lang = Y.Lang, 4 | Node = Y.Node, 5 | YArray = Y.Array; 6 | 7 | Y.APISearch = Y.Base.create('apiSearch', Y.Base, [Y.AutoCompleteBase], { 8 | // -- Public Properties ---------------------------------------------------- 9 | RESULT_TEMPLATE: 10 | '
  • ' + 11 | '' + 12 | '

    {name}

    ' + 13 | '{resultType}' + 14 | '
    {description}
    ' + 15 | '{class}' + 16 | '
    ' + 17 | '
  • ', 18 | 19 | // -- Initializer ---------------------------------------------------------- 20 | initializer: function () { 21 | this._bindUIACBase(); 22 | this._syncUIACBase(); 23 | }, 24 | 25 | // -- Protected Methods ---------------------------------------------------- 26 | _apiResultFilter: function (query, results) { 27 | // Filter components out of the results. 28 | return YArray.filter(results, function (result) { 29 | return result.raw.resultType === 'component' ? false : result; 30 | }); 31 | }, 32 | 33 | _apiResultFormatter: function (query, results) { 34 | return YArray.map(results, function (result) { 35 | var raw = Y.merge(result.raw), // create a copy 36 | desc = raw.description || ''; 37 | 38 | // Convert description to text and truncate it if necessary. 39 | desc = Node.create('
    ' + desc + '
    ').get('text'); 40 | 41 | if (desc.length > 65) { 42 | desc = Y.Escape.html(desc.substr(0, 65)) + ' …'; 43 | } else { 44 | desc = Y.Escape.html(desc); 45 | } 46 | 47 | raw['class'] || (raw['class'] = ''); 48 | raw.description = desc; 49 | 50 | // Use the highlighted result name. 51 | raw.name = result.highlighted; 52 | 53 | return Lang.sub(this.RESULT_TEMPLATE, raw); 54 | }, this); 55 | }, 56 | 57 | _apiTextLocator: function (result) { 58 | return result.displayName || result.name; 59 | } 60 | }, { 61 | // -- Attributes ----------------------------------------------------------- 62 | ATTRS: { 63 | resultFormatter: { 64 | valueFn: function () { 65 | return this._apiResultFormatter; 66 | } 67 | }, 68 | 69 | resultFilters: { 70 | valueFn: function () { 71 | return this._apiResultFilter; 72 | } 73 | }, 74 | 75 | resultHighlighter: { 76 | value: 'phraseMatch' 77 | }, 78 | 79 | resultListLocator: { 80 | value: 'data.results' 81 | }, 82 | 83 | resultTextLocator: { 84 | valueFn: function () { 85 | return this._apiTextLocator; 86 | } 87 | }, 88 | 89 | source: { 90 | value: '/api/v1/search?q={query}&count={maxResults}' 91 | } 92 | } 93 | }); 94 | 95 | }, '3.4.0', {requires: [ 96 | 'autocomplete-base', 'autocomplete-highlighters', 'autocomplete-sources', 97 | 'escape' 98 | ]}); 99 | -------------------------------------------------------------------------------- /manual/index/entity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Entity 8 | 9 | 10 | 11 | 12 | 13 |
    14 |
    15 | 19 | 20 |

    21 | 22 | Represents an entity in the game. Usually a character or enemy. 23 | Manages state (position, health, stats, etc) 24 | Occupies a single game map tile. 25 | 26 |

    27 | 28 |
    29 | 30 |
    31 |
    32 |
    33 | Examples 34 |
    35 |
    36 |
      37 | 38 |
    1. 39 | 40 | Pushable 41 | 42 | 43 | 44 |
    2. 45 | 46 |
    3. 47 | 48 | Basic Movement Behavior 49 | 50 | 51 | 52 |
    4. 53 | 54 |
    5. 55 | 56 | Basic Combat 57 | 58 | 59 | 60 |
    6. 61 | 62 |
    63 |
    64 |
    65 |
    66 |
    67 |
    68 | Related API Docs 69 |
    70 | 77 |
    78 |
    79 |
    80 | 81 | 82 | 83 | 84 | 85 | 86 |
    87 |
    88 | Examples are designed to be simple and easily editable once Downloaded. 89 |
    90 |
    91 |
    92 |

    93 | Roguelike JS Skeleton 94 | | 95 | Manual Home 96 | | 97 | Github 98 | | 99 | Download Zip 100 |

    101 | 102 |
    103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /manual/assets/less/bootstrap/scaffolding.less: -------------------------------------------------------------------------------- 1 | // 2 | // Scaffolding 3 | // -------------------------------------------------- 4 | 5 | 6 | // Reset the box-sizing 7 | // 8 | // Heads up! This reset may cause conflicts with some third-party widgets. 9 | // For recommendations on resolving such conflicts, see 10 | // http://getbootstrap.com/getting-started/#third-box-sizing 11 | * { 12 | .box-sizing(border-box); 13 | } 14 | *:before, 15 | *:after { 16 | .box-sizing(border-box); 17 | } 18 | 19 | 20 | // Body reset 21 | 22 | html { 23 | font-size: 10px; 24 | -webkit-tap-highlight-color: rgba(0,0,0,0); 25 | } 26 | 27 | body { 28 | font-family: @font-family-base; 29 | font-size: @font-size-base; 30 | line-height: @line-height-base; 31 | color: @text-color; 32 | background-color: @body-bg; 33 | } 34 | 35 | // Reset fonts for relevant elements 36 | input, 37 | button, 38 | select, 39 | textarea { 40 | font-family: inherit; 41 | font-size: inherit; 42 | line-height: inherit; 43 | } 44 | 45 | 46 | // Links 47 | 48 | a { 49 | color: @link-color; 50 | text-decoration: none; 51 | 52 | &:hover, 53 | &:focus { 54 | color: @link-hover-color; 55 | text-decoration: underline; 56 | } 57 | 58 | &:focus { 59 | .tab-focus(); 60 | } 61 | } 62 | 63 | 64 | // Figures 65 | // 66 | // We reset this here because previously Normalize had no `figure` margins. This 67 | // ensures we don't break anyone's use of the element. 68 | 69 | figure { 70 | margin: 0; 71 | } 72 | 73 | 74 | // Images 75 | 76 | img { 77 | vertical-align: middle; 78 | } 79 | 80 | // Responsive images (ensure images don't scale beyond their parents) 81 | .img-responsive { 82 | .img-responsive(); 83 | } 84 | 85 | // Rounded corners 86 | .img-rounded { 87 | border-radius: @border-radius-large; 88 | } 89 | 90 | // Image thumbnails 91 | // 92 | // Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`. 93 | .img-thumbnail { 94 | padding: @thumbnail-padding; 95 | line-height: @line-height-base; 96 | background-color: @thumbnail-bg; 97 | border: 1px solid @thumbnail-border; 98 | border-radius: @thumbnail-border-radius; 99 | .transition(all .2s ease-in-out); 100 | 101 | // Keep them at most 100% wide 102 | .img-responsive(inline-block); 103 | } 104 | 105 | // Perfect circle 106 | .img-circle { 107 | border-radius: 50%; // set radius in percents 108 | } 109 | 110 | 111 | // Horizontal rules 112 | 113 | hr { 114 | margin-top: @line-height-computed; 115 | margin-bottom: @line-height-computed; 116 | border: 0; 117 | border-top: 1px solid @hr-border; 118 | } 119 | 120 | 121 | // Only display content to screen readers 122 | // 123 | // See: http://a11yproject.com/posts/how-to-hide-content/ 124 | 125 | .sr-only { 126 | position: absolute; 127 | width: 1px; 128 | height: 1px; 129 | margin: -1px; 130 | padding: 0; 131 | overflow: hidden; 132 | clip: rect(0,0,0,0); 133 | border: 0; 134 | } 135 | 136 | // Use in conjunction with .sr-only to only display content when it's focused. 137 | // Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 138 | // Credit: HTML5 Boilerplate 139 | 140 | .sr-only-focusable { 141 | &:active, 142 | &:focus { 143 | position: static; 144 | width: auto; 145 | height: auto; 146 | margin: 0; 147 | overflow: visible; 148 | clip: auto; 149 | } 150 | } 151 | --------------------------------------------------------------------------------