comparison code/ghost0.gq @ 68:f4f403c83e80

Small ghost AI change. Doesn't seem to change results, but closer to my actual intent
author Michael Pavone <pavone@retrodev.com>
date Sun, 27 Jul 2014 23:11:46 -0700
parents 9cc019c98335
children 8a0f1447c034
comparison
equal deleted inserted replaced
67:76570158a6e9 68:f4f403c83e80
103 103
104 104
105 105
106 tmp <- 0 106 tmp <- 0
107 i <- 0 107 i <- 0
108 while: { i < 2} do: { 108 while: { i < 3} do: {
109 targetX <- getDirX: firstChoice myX 109 targetX <- getDirX: firstChoice myX
110 targetY <- getDirY: firstChoice myY 110 targetY <- getDirY: firstChoice myY
111 111
112 if: (mapContentsAt: targetX targetY) - 1 > 4 { 112 if: (mapContentsAt: targetX targetY) - 1 > 4 {
113 //first choice is a wall or ghost start pos 113 //first choice is a wall or ghost start pos
121 tmp <- firstChoice 121 tmp <- firstChoice
122 firstChoice <- secondChoice 122 firstChoice <- secondChoice
123 secondChoice <- opDir: firstChoice 123 secondChoice <- opDir: firstChoice
124 i <- i + 1 124 i <- i + 1
125 } else: { 125 } else: {
126 i <- 2 126 i <- 3
127 } 127 }
128 } 128 }
129 } 129 }
130 direction!: firstChoice 130 direction!: firstChoice
131 131