view code/simple.lm @ 54:476cd9eba2be

fixed event system with refactor to remove gamestate passing. much more simple, less pure. runs correctly in simulator.
author William Morgan <billjunk@mrgn.org>
date Sun, 27 Jul 2014 16:52:36 -0700
parents 84f595cff062
children
line wrap: on
line source

#{
	counterLoad <- 4
	step <- :myState world {
		move <- myState value
		counter <- (myState tail) - 1
		if: counter = 0 {
			move <- move + 1
			counter <- counterLoad
			if: move = 4 {
				move <- 0
			} else: {}
		} else: {}
		#[#[move counter] move]
	}
	
	main <- :initWorld mystery {
		print: mystery
		#[#[0 counterLoad] step]
	}
}