# HG changeset patch # User Michael Pavone # Date 1406543105 25200 # Node ID 4438054a183cde539d51af6f96ffe552d425c5b0 # Parent dcfa9797607125be7fd135f32e900a83c0310090# Parent 8f6ade456edfaea21ea4482fc33a5c3d6d613e63 Merge diff -r dcfa97976071 -r 4438054a183c code/gameState.lm --- 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 ]) } +*/ }