changeset 80:4438054a183c

Merge
author Michael Pavone <pavone@retrodev.com>
date Mon, 28 Jul 2014 03:25:05 -0700
parents dcfa97976071 (current diff) 8f6ade456edf (diff)
children 4251797af36b 3e5de539a676
files
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/code/gameState.lm	Mon Jul 28 03:24:21 2014 -0700
+++ b/code/gameState.lm	Mon Jul 28 03:25:05 2014 -0700
@@ -43,7 +43,7 @@
 		if: input >= mod {
 			ret <- input - mod
 		} else: {
-			ret input 
+			ret <- input 
 		}
 		ret
 	}
@@ -77,6 +77,7 @@
 	dirFlipped <- :dir {(dir + 2) poorMod: 4}
 
 	makeTicker <- :mapGrid :ghosts{
+		print: #[2 ghosts]
 		lives <- 3
 		lambdamanStartPos <- #[5 5] // TODO grab during parse or write {grid: mapGrid find: tileLm}
 		lambdamanStartDir <- dirDown
@@ -88,6 +89,7 @@
 		isFood <- :tile { (2 <= tile) myAnd: (tile <= 4) }
 		getLambdamanChoice <- {0} // TODO ai hookups
 
+		print: 30
 		ghostPopulation <- ghosts value
 		ghostChoosers <- #[{0} {0} {0} {0}] // TODO ai hookups
 		ghostChoice <- :ghostIdx{tupGet: ghostChoosers ghostIdx 4}
@@ -276,11 +278,11 @@
 			ghostTick <- 0
 			while: {ghostIdx < ghostPopulation} do: {
 				ghostTick <- ghostGetLag: ghostType ghostModeStandard
+				print: 5
 				events <- (moveGhost: 0 ghostIdx ghostType ghostTick) | events
 				ghostIdx <- ghostIdx + 1
 				ghostType <- (ghostType + 1) poorMod: 4
 			}
-			print: 5
 			while: {(tick < runUntil) myAnd: (not: (events empty?))} do: {
 				print: 6
 				events <- executeTick: tick events
@@ -298,19 +300,19 @@
 
 		world
 
-		ticker <- makeTicker: grid
-		print: 2
+		ghostsList <- ((world tail) tail) value
+		ghosts <- makeTree: ghostsList
+		ticker <- makeTicker: grid ghosts
+		print: 3
 		ticker: 1000
-		print: 3
 
 		#[0 0]
 	}
 
-/*
 	main <- :initWorld ghostCode{
 		#[0 step]
 	}
-*/
+/*
 	main <- {
 		print: (step: 0 #[
 			//grid
@@ -328,5 +330,6 @@
 			0
 		])
 	}
+*/
 }