state pattern for the level object