needed something to catch my attention. • Inspired by @GarethIW’s #1GAM efforts I wanted to make a little game prototype. • Snake seemed simple and doable. • Graphics are nothing more than a coloured rectangle. • Functional code in F#, because it is fun and forced me to think differently. #IWDev 16/ Matt Ball / @saxonmatt
communicating with other Objects. • (FP) state and behaviour are separated into values and functions. #IWDev 16/ Matt Ball / @saxonmatt Snake Class State: position, size, colour etc. Behaviour: move, eat, grow Behaviours modify the state of this snake. Snake Data Position, size, colour. Snake Functions Move, eat, grow Functions take a snake and return a new snake
to capture time and input and tell our game engine to do things. • (OOP) call methods on objects with input/time and change their state – then draw that state to the screen. • (FP) take the value of the last known state pass it through functions to get new values for the state – then draw that state to the screen. #IWDev 16/ Matt Ball / @saxonmatt