Also, no code here because understanding your tools and the logic is part of the task. Every App/Game is a task with unique challenges, so is up to you to find a solution for those problems instead of relying on copy-paste.