Tile Game
- Category: Game
- Project URL: https://github.com/Hanszhang12/tilegame
Project Details
In this project, I implemented a 2D tile-based world exploration game. The user is able to move around the 2D world and interact with it. In addition to this, the game allows for two players to compete against each other to see who can collect more coins.
World Generation
The world is pseudorandomly generated based on the seed number that's passed in. Each world is unique to its own seed number and identical seed numbers will result in the generation of the same world. The world is generated by first filling up the empty space with rectangular rooms. Afterwards, each room creates hallways that lead to the other rooms. The number of rooms, number of hallways, and width/height of the rooms are all random. Looking at the pictures from above, we can see that the floor is easily distinguishable from the walls. I also added a feature that allows for different walls and floors each time. The user can start a new game in a new world even after entering the seed number.
Interactivity
The user one is able to control the avatar around using the W, A, S, and D keys. User two is able to control the avatar using I, J, K, L keys. User one is represented using '@' and user two is represented using 'b'. The avatars are able to collect coins which are represented with '0'. The starting position of each avatar is random each time.