updated viewport in index and gameover handler