A desktop pet that randomly wanders around a screen created in C. 

Features:
- Speed variance
- Color variance
- User interactions can affect visible variations
- Animations to represent walking

Contributions:
- Code architecture & maintaining architecture through development
- Sprite initialization
- Basic sprite movement
- Unit testing

A model, view, controller architecture was utilized to help with clean, easy-to-follow integration.
The four directions the desktop pet can move in were represented by integers from 0 to 4, inclusive, where 4 represented the pet idling/remaining in its current location. Window bounds make the pet reverse direction.

The movement was determined by a semi-random function with a 52% chance of repeating the previous movement and a 12% chance of a new movement, allowing for non-circular paths that would traverse a wider portion of the screen.
Sprite sheets with all of the movement frames in each direction were used to implement walking animations while also reducing memory usage & load times. 
Users can interact with the pet in a few different ways:
1-Clicking on the pet changes its color
2-Pressing the space bar adjusts the speed of the pet

You may also like

Back to Top