#4 Conditions

This commit is contained in:
Tibo De Peuter 2022-12-23 10:03:53 +01:00
parent 9addf1ed07
commit 72b460788d
3 changed files with 34 additions and 16 deletions

View file

@ -104,7 +104,7 @@ checkForInteraction g = g{ state = Error "something went wrong while checking fo
interact :: Game -> Game
interact g@Game{ state = s@Playing{ level = level, player = player } } = g{ state = newState }
where newState = ActionSelection actionList selector continue
actionList = filterActions $ getActions $ fromJust $ hasAt pos level
actionList = filterActions s $ getActions $ fromJust $ hasAt pos level
selector = ListSelector 0 False
pos = position player
continue = s