Use this.gameSize.x instead of magic number 300 for width.
This produces an error, as gameSize is not visible.
Pass gameSize into update, and use gameSize.x and .y instead of magic number 300.