PurrfectFlight is a 2D side-scrolling game similar to Flappy Bird. This project provides a character selection and loading system for a Unity game. It includes the following scripts:
- CharacterSelectionScript
- LoadCharacter
- BirdScript
- CharacterDatabase
- CharacterManager
- LogicScript
- PipeMoveScript
- Player
- Add the
CharacterSelectionScript
to a GameObject to manage the selection of characters. - Add the
LoadCharacter
script to a GameObject to load the selected character into a new scene. - Use the
BirdScript
as an example of a character script that can be used with the selection and loading system. - Create a
CharacterDatabase
ScriptableObject to store a list of available characters. - Add the
CharacterManager
script to a GameObject to manage character selection and loading. - Use the
LogicScript
to handle scoring and game over logic. - Add the
PipeMoveScript
to your pipe GameObjects to make them move in the game. - Use the
Player
script to load the selected character sprite for the player.
- Manages the selection of characters using NextCharacter and PreviousCharacter methods.
- Stores the selected character in PlayerPrefs.
- Instantiates the selected character in a new scene.
- Displays the character name using a TMP_Text component.
- Example character script for a bird character.
- Manages bird flapping and game over logic.
- ScriptableObject to store a list of available characters.
- Provides methods to access characters by index.
- Manages character selection and loading.
- Updates the displayed character information when the selection changes.
- Saves and loads the selected character using PlayerPrefs.
- Handles player scoring and displays the score.
- Manages game over logic and displays a game over screen.
- Moves the pipes in the game.
- Destroys the pipes once they go beyond the dead zone.
- Loads the selected character sprite for the player.
- Updates the player's sprite based on the selected character.
The provided code contains commented sections. Uncomment the code sections in each script to use the functionality. It's also a work in progress, not fully complete! This was intended as a learning journey for myself and will be updated ever so slightly. I followed a youtube tutorial on several parts and learned how to mesh scenes.