If you want players to keep playing your game, it needs to be fun. It has to be something they want to play. This sounds obvious, and it is, but it’s impossible to stress this enough. People play games to be entertained. Never lose sight of this. People want to have fun. People like to do things they think are fun.
I could talk for the rest of my life about the nature of fun and never come close to really describing it, and since I intend to update as often as I can, I want to leave some stuff for later. For now, I’ll just cover it in broad terms.
The traditional video game approach to fun is by presenting challenges for the players to overcome. If a challenge is too difficult, the player becomes frustrated. If a challenge is too easy, the player becomes bored. A player’s skill at playing the game rises with continued play, so the game needs to present challenges of increasing difficulty to keep players from getting bored.
If a game’s difficult rises with player competence at a 1:1 ratio, players might still become bored because the experience is too similar whenever they play. A game needs challenging parts and easy parts to shake things up a bit, and what’s challenging or easy is relative to a player’s skill.
When a player faces challenges that grow to their skill level and present easy parts to let them exercise their mastery, and hard parts to present them with memorable challenges to overcome, that’s where engagement and fun happens. This is by no means the only method of having fun, but it’s a baseline common to many games.