-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add social/sharing data * Update README with links to play online * Add hints for level 2 * Update hints for levels 1 and 2 * Add Level 3. Vases are now transparent * Level 4 WIP * WIP level 4 * Update victory screen text with score * Update level 4 * Add level 5 * Swap levels 4 and 5
- Loading branch information
1 parent
bd5b5eb
commit d809892
Showing
9 changed files
with
264 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Atom from '@avo/atom' | ||
import { TILE_SIZE } from '@avo/constants' | ||
|
||
/* | ||
The TextMessage displays (non-interactable) text on the canvas. | ||
Useful for having in-game instructions. | ||
*/ | ||
export default class TextMessage extends Atom { | ||
constructor (app, text, col = 0, row = 0, layer = 0) { | ||
super(app) | ||
this._type = 'text-message' | ||
|
||
this.x = col * TILE_SIZE + TILE_SIZE / 2 | ||
this.y = row * TILE_SIZE + TILE_SIZE / 2 | ||
this.text = text | ||
this.layer = layer | ||
|
||
this.colour = 'rgba(0, 0, 0, 0.5)' | ||
this.font = '3em sans-serif' | ||
this.textBaseline = 'middle' | ||
this.textAlign = 'center' | ||
|
||
this.solid = false | ||
this.movable = false | ||
} | ||
|
||
paint (layer = 0) { | ||
// super.paint(layer) | ||
|
||
const c2d = this._app.canvas2d | ||
const camera = this._app.camera | ||
|
||
if (layer === this.layer) { | ||
c2d.font = this.font | ||
c2d.textBaseline = this.textBaseline | ||
c2d.textAlign = this.textAlign | ||
c2d.fillStyle = this.colour | ||
|
||
c2d.fillText(this.text, this.x, this.y) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ table { | |
#banner { | ||
#card { | ||
display: block; | ||
max-width: 50%; | ||
max-width: 60%; | ||
margin: 0 auto; | ||
} | ||
} | ||
|