According to what I read on the website, the Mac version only supports i386, i.e. 32 bit. Rosetta2 which is a translation layer to translate Intel Mac code to Apple Silicon code is only 64 bit.
One solution could be to download the source code version, get Apple development tools and build an Apple Silicon native version.
The macOS branch of Code::Blocks developers have admitted that their version is woefully out date do to that lack of Apple developers for the project. This is always an issue with open source tools as they are all generally developed on a volunteer basis.
Another solution might be creating a Windows11 or a Linux virtual machine with something like Parallels Desktop or VMware Fusion. However these will be ARM64 versions and again the tools may be needed to be built from scratch. In this case however, Linux may be an easier option as the distros often have build tools to build apps from source.
Bottom line is that here really is not a quick and easy solution to the issue using an M2 Mac.