Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bd7145d
commit 1e6d02f
Showing
5 changed files
with
85 additions
and
56 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
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 |
---|---|---|
@@ -1,14 +1,5 @@ | ||
package twitter4z.tetris | ||
|
||
import java.awt.image.BufferedImage | ||
import java.net.URL | ||
import javax.imageio.ImageIO | ||
/* | ||
case class Block(image: BufferedImage, coord: Coord) | ||
|
||
object Block { | ||
def apply(url: URL): ImageBlock = ImageBlock(ImageIO.read(url)) | ||
} | ||
*/ | ||
case class Block(image: BufferedImage, coord: Coord, text: String) |
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,12 @@ | ||
package twitter4z.tetris | ||
|
||
import scalaz._ | ||
import Scalaz._ | ||
|
||
case class Coord(x: Int, y: Int) | ||
|
||
object Coord { | ||
|
||
implicit lazy val CoordEqual: Equal[Coord] = equalA | ||
|
||
} |
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 |
---|---|---|
@@ -1,29 +1,27 @@ | ||
package twitter4z | ||
|
||
import java.awt.Font | ||
|
||
import scalaz._ | ||
import Scalaz._ | ||
|
||
package object tetris { | ||
|
||
// type Field = List[List[Block]] | ||
|
||
type Coord = (Int, Int) | ||
|
||
type Coords = (Coord, Coord, Coord, Coord) | ||
|
||
type Image = java.awt.image.BufferedImage | ||
|
||
val Row = 20 | ||
val Row = 15 | ||
|
||
val Column = 10 | ||
|
||
val Size = 20 | ||
val Size = 48 | ||
|
||
val Width = Column * Size | ||
|
||
val Height = Row * Size | ||
|
||
// val EmptyField: Field = List.fill(Row, Column)(EmptyBlock) | ||
val SleepTime = 1000 | ||
|
||
val FontSize = Size / 2 | ||
|
||
val DefaultFont: Font = new Font(Font.SANS_SERIF, Font.PLAIN, FontSize) | ||
|
||
} | ||
|