Skip to content

Commit

Permalink
Ok, no more white spaces under stuff.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfn committed Mar 20, 2012
1 parent c090ad1 commit 81d8c38
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
Binary file added src/main/resources/textures/ghost.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/main/resources/textures/terrain_d.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/resources/textures/terrain_d.psd
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main/scala/Game.scala
Expand Up @@ -66,7 +66,7 @@ object Main {
val finalShader = new Shader("minimal", "final")

var curLevel : Level = null
var currentLevelNum = 1
var currentLevelNum = 2

def main(args:Array[String]) = {
var fullscreen = false
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/Level.scala
Expand Up @@ -36,11 +36,11 @@ class LevelModel(val name: String)
0x00ff00->2,
0x00ffff->3,
0xff0000->4,
0xff00ff->5,
0xffff00->6,
//0xff00ff->5,
//0xffff00->6,
0xffffff->7,
0x202020->8, //Crystal
0x000050->9 //Block
0x202020->5,//8, //Crystal
0x000050->6//9 //Block
)
)

Expand All @@ -60,9 +60,9 @@ class LevelModel(val name: String)
// Special case colors. Create new entities and append to list.
if (color == 0) {

} else if (color == 8) {
} else if (color == 5) {
newEntities = (new Crystal(x, y, height)) :: newEntities
} else if (color == 9) {
} else if (color == 6) {
newEntities = (new Block(x, y, height)) :: newEntities
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/scala/Protagonist.scala
Expand Up @@ -18,7 +18,9 @@ class Ghost() extends VBOModelEntity {
x = 1.0f
y = 0.0f
z = 0.0f
val model = new SquareModel(x, y, z)//, List(100, 0, 0))

//1.05f instead of 1.00f is an awesome hack that stops z-fighting when the ghost is in a wall.
val model = new SkyModel(x, y, z, 1.05f, "/textures/ghost.png", 1.0f)

def setPosition(newx: Float, newy: Float, newz: Float) = {
x = newx
Expand Down Expand Up @@ -103,7 +105,7 @@ class Protagonist(val ghost: Ghost) extends VBOModelEntity {
def hasWon(m: EntityManager) = {
val lv:Level = m.entities.filter(_.traits.contains("level")).head.asInstanceOf[Level]

lv.model.texMap.valueAt(x.asInstanceOf[Int], y.asInstanceOf[Int]) == 7
lv.model.texMap.valueAt(x.asInstanceOf[Int], y.asInstanceOf[Int]) == 7 && (z <= m.height(x, y, this))
}

def moveGhost(m: EntityManager, lv: Level) = {
Expand Down

0 comments on commit 81d8c38

Please sign in to comment.