The Goal: Create a game mechanic or mini-game in under a week that involves the Simple Factory Design Pattern in the code's implementation.
1. What does the player do in the game that creates an object of a specific type?
When the player starts the game, the enemy spawner starts spawning random enemies for the player to fight.
2. What determines which object is created (with the Simple Factory design pattern) while the game is running? Does the player choose the object or does the game choose the object based on something the player does? In other words, what sets the condition that is checked by the factory?
There’s a string array of enemies that are randomly chosen from when the game needs to spawn in a new enemy. In terms of it being in response to what the player does, the player sets a spawn rate every time they start a new round of the game, which changes how fast the factory and spawn manager create new randomly chosen enemies.
3. What were the benefits of using the Simple Factory Pattern to make your mini-game?
The simple factory pattern really encouraged me to make sure all my enemies had distinct differences while still being similar enough that the “simple factory pattern” would be useful. It also made spawning in the different types that all needed different spawn locations a lot easier as they all had a specific string “enemyType” associated with them.
4. Did you find any drawbacks to using the Simple Factory Pattern? If so, what were they?
I wouldn’t call this a drawback as much as personal confusion, but I’m a bit worried that I put too much in the SpawnManager class as I was unclear on how much the simple factory pattern depended on the specific setup of classes in the example code. All in all the code does what it’s supposed to do, but part of me wonders what exactly makes it better than spawn managers I've created in the past for previous assignments.
5. What is the player’s goal in your mini-game and what makes it challenging?
The goal in this mini-game is to shoot down all the enemies before they make it back off screen and to survive long enough to get 250 points, which you get from shooting down enemies. What makes this challenging is the different enemy movement patterns and shooting behaviors that starts to turn the game into a kind of bullet hell.
6. How does the game communicate its goal(s) to the player?
The game communicates both the goals and the controls to the player on the start screen, along with a message telling the player the score requirement on a loss.
7. How can the player fail at the game and how does the game detect it?
The player can fail at the game by either allowing themself to get hit by a bullet or other enemy, or by letting an enemy get off screen. The game detects it through a GameOver() method that is called anytime the player object is destroyed or an enemy is destroyed by a DespawnWall.
8. How does the game give players feedback about how well they are doing?
The game gives players feedback by showing them their final score and the score they need to win on every death. The score is also displayed during runtime, showing the player how many points they’re getting for each enemy.