A 2D demo game project made with the Hazel engine and based on the popular Boulder Dash game from the 1980's.
As featured in episode 65 of TheCherno's Game Engine series. Check it out if you haven't already.
Sharp eyed people may notice that the graphics are different here to the ones featured in the youtube clip. HazelDash is rendered with the Hazel Engine's scene renderer, which currently only supports coloured squares. The player is the white square. Move with WASD, collect the yellow squares, and then go to the light grey square to proceed to next level. Dark grey squares are boulders and will fall on you, or you can drop them on butterflies (cyan squares), or fireflies (red squares). Avoid the slime (green squares).
On earlier branches (see Repository Structure section), a custom texture renderer is used. Thanks to iHelp (https://github.com/dovker) for the sprites on those branches.
If you wish for a more authentic retro "Boulder Dash" look, then you can find the original assets on the internet and it is a simple matter to incorporate them into a fork of this code.
There are many BoulderDash clones out there, and most of them are far better than this one. The goal of this repository is not to make the perfect BoulderDash clone, but rather just to make something, for educational purposes, demonstrating use of the Hazel game engine. Check out the series if you havent already - TheCherno's Game Engine series.
Important, please read
There are several different branches of the code in this repository. After cloning the repository, be sure to checkout the branch that most reflects what you are interested in.
Whenever you switch branches, you will need to also re-update the submodules, and re-run VS2019-GenProjects.bat
.
The table below describes what the various branches are, and what state they are in.
branch | description |
---|---|
master | The intention is to keep the master branch up to date with the current master branch of Hazel, and so as new features are added in to the Hazel Game Engine, I will update this game to demonstrate use of those features. This branch renders the game using a Hazel Scene, and uses Hazel's NativeScripting to control the camera, the player, and the game logic. Warning The version of Hazel used in this branch has a dependency on the Vulkan SDK. I suggest downloading and installing that from https://www.lunarg.com/vulkan-sdk/ before attempting to use this branch. You will also need the VulkanSDK debug libs which can be downloaded from the same location. Extract the debug libs archive into Hazel/vendor/VulkanSDK. Note There is a script (Hazel/scripts/setup.bat) which does the VulkanSDK setup for you. However, this script requires a working python installation, and also has been found to not work in some situations. I suggest doing the VulkanSDK setup manually rather than using the script (ymmv). Warning Currently, Hazel SpriteRenderer can only do coloured squares (textured sprites are coming) - so the game does not look very interesting (it's a bunch of coloured squares). The gameplay is all there though, so you can use your imagination! This branch is uses Hazel Engine as at episode 100. |
079-ecs | This branch demonstrates use of the ECS developed in the game engine series episodes 76-79. This branch uses Hazel Engine as it was at episode 79. |
065-batch_render | This branch demonstrates use of the Hazel batch rendering. This branch uses Hazel Engine as it was at episode 65. |
audio | This is basically the same as the 079-ecs branch, except with sound effects. It uses HazelAudio which is an additional plugin for the Hazel engine that is not (yet) covered in the Game Engine Series. |
Only Visual Studio 2019 on Windows has been tested.
- Download and install the Vulkan SDK (only needed if you want to build for master branch)
- Clone the repository with
git clone https://github.com/Freeman40/HazelDash
cd HazelDash
- Checkout the branch that interests you e.g.
git checkout 065-batch_render
- Update submodules
git submodule update --init --recursive
- Run the script
VS2019-GenProjects.bat
from the Build subdirectory - Open the generated VS2019 solution file from the Build/VS2019 subdirectory. Build project.
Repeat steps 4 to 7 if you want to change to a different branch.
When running for the first time, you might need to move ImGui popup windows out of the way...