[Open Source] Releasing a JavaFX-based Mini Game: CrazyAlpha
Features Designed a game engine XEngine based on JavaFX Implemented complete game functionality using the self-developed game engine XEngine Game resource management: font, image, and audio management Game map management, multi-map switching MVVM layered design, decoupled code, highly cohesive modules Model system design, modular design Message system and event handling implemented using the publish-subscribe pattern Built with Gradle Download and Run First, click to open: CrazyAlpha Download Page Download CrazyAlpha
目录13 个章节
Features
- Designed a game engine XEngine based on JavaFX
- Implemented complete game functionality using the self-developed game engine XEngine
- Game resource management: font, image, and audio management
- Game map management, multi-map switching
- MVVM layered design, decoupled code, highly cohesive modules
- Model system design, modular design
- Message system and event handling implemented using the publish-subscribe pattern
- Built with Gradle
Download and Run
First, click to open: CrazyAlpha Download Page

Download the latest version of CrazyAlpha; for example, the one in the screenshot is 1.0.1, and the filename is: crazyalpha.jar
PS: Since the game is written in Java, friends who don't have Java installed please download Java first. Windows Java runtime download: Click to download
After installing the Java environment, you can double-click the jar to run it, or right-click and choose to run it with Java Runtime
Of course, you can also run it from the command line
java -jar crazyalpha.jar
Open Source
Github project address: https://github.com/Deali-Axy/CrazyAlpha
PS: Due to copyright reasons, the Github code does not include resource files such as images, fonts, and sounds used by the game, so those who want to run the game can replace the resource files themselves, or contact me to obtain the resource files.
Architecture
Game.Engine: self-implemented game engine packageAnnotation: engine annotation package, containing annotations defined by the engineGameEventHandler: event handler annotationGameManager: annotation for various managers in the gameGameModel: model annotationGameObject: game object annotationGameView: view annotation, used to implement MVVM layered design
Base: base class package, containing various abstract base classes defined by the engineBaseModel: base modelImageModel: base image modelShapeModel: base shape modelTextModel: base text model
Enum: definitions of various enums (omitted)Utils: other utilities (omitted)GameObject: game object base class; all objects derive from this classGameView: screens other than the main game interface are all derived from the view base class
Game.EventHandler: contains all event handlersGame.Manager: contains various managers, including map, resource, data, model, event, and other managersGame.Object: contains definitions of all game objectsModel: contains definitions of all game modelsGameMap: game map objectGenerator: game event generator
Game.View: view package, containing definitions of all viewsGame: global game object, created using the singleton patternMain: game main classRender: core renderer, responsible for the game's rendering
GUI Implementation
To develop this game, I first developed a JavaFX-based game engine. The engine implements a series of features from game resource management and model definition to screen rendering, designed following the design approach of existing commercial game engines on the market. “Though the sparrow is small, it has all the vital organs”—although it cannot rival other mature game engines, in terms of functionality it is fully equipped and can meet the development needs of most 2D mini games.
Screenshots
Game startup screen:
The upper left is the game logo, the lower left shows the high score record, and below that are the author information and version.
The lower right has two buttons: a start-game button and a quit button.

Game main screen:
The upper left shows the player avatar, current score, and health; directly above is the current level;
In the center of the screen is a large pinwheel. The pinwheel shoots out letters following the music's rhythm, and the player needs to press the corresponding letter before it flies off the screen in order to score.

Game pause screen

Game over screen
The lower left shows the score for this round, and whether the high score record was broken. The lower right shows a button to return to the main screen.

Development Notes
This is my first time using Java for game development. Previously, my understanding of the Java language was limited to JavaEE web development. Recently I learned JavaFX, and after using it I discovered that JavaFX is actually so nice to use. It really is a framework designed specifically for GUIs, just that relatively few people use it. I ran into many problems during development and could barely find any Chinese resources. Luckily there's the almighty StackOverFlow, and Oracle's official documentation is also quite detailed. Thanks~
For someone like me who's used to writing dynamic languages like Python, the feeling of writing a lot of Java code is that it's tedious, but worry-free. You don't need to think much; you don't have to wrestle with what type a parameter is or whether you need forced type checking. Everything is clearly arranged by the IDE and the JVM, so I don't need to worry about types anymore. Also, because Java syntax is relatively rigid and doesn't have that many flexible ways of writing things, this is both a disadvantage and an advantage. The disadvantage is that for someone like me who likes to show off, writing Java code doesn't bring much pleasure. But the advantage is that for the same functionality, the implementation code is basically similar, and different people implementing it won't differ much, which ensures code maintainability. Maybe if you write a large project in Python now, the code is all free-flowing and unconstrained, which feels great while writing, but when it comes time to refactor later, you're done for—you can't understand the previous code. Even though there are comments, it's impossible for every line of code to have comments, right? Flexible writing styles increase the difficulty of understanding. Therefore, Java's absolute dominance in large projects is not unfounded.
This game development also deepened my understanding of the Java language, for example reflection, for example events. At first, when working on the event-handling part, what puzzled me a bit was that Java has neither delegates nor a true concept of “events”; everything is implemented with interfaces and classes. Implementing interface functionality is generally done by passing in an anonymous class that implements some event interface (of course in Java 8 you can use lambda expressions). But this isn't a big problem; these issues can all be solved in other ways, it's just more tedious to write. Maybe because I was used to writing C#, I always involuntarily compare when writing Java code, but actually these two languages aren't very comparable, because they were born in different eras. C# is indeed much more sophisticated than Java in language design. In recent years, new versions of Java have been more or less imitating features that C# had years ago, for example Java 8's lambda expressions, Java 11's var for defining variables, and so on.
Additionally, developing this mini game gave me this impression of Java: the syntax is very simple, not as numerous and complex as C# and C++, so it's especially beginner-friendly, because you can pick it up right away. Combined with the best IDE: IDEA, you can easily write all kinds of projects. There's a saying that because Java itself has too few features, various design patterns emerged to make up for the language's shortcomings.
About

Learn more on my WeChat Official Account:DealiAxy
Every post was in my blog:blog.deali.cn
Welcome to Connect
For questions, please leave a message on the WeChat official account backend; I'll reply to every message~
- WeChat Official Account: 画星星高手
- Coding livestream: https://live.bilibili.com/11883038
- Zhihu: https://www.zhihu.com/people/dealiaxy
- Column: https://zhuanlan.zhihu.com/deali
- Jianshu: https://www.jianshu.com/u/965b95853b9f
_EOF_
[Open Source] Releasing a JavaFX-based Mini Game: CrazyAlpha
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
【开源】发布一个Java课程设计BookManageSystem
JavaBookManageSystem Github主页:https://github.com/Deali-Axy/JavaBookManageSystem 介绍 使用Java编写的简易图书管理软件,Java课程的课设之一。 依赖 Mybatis 3.4.6 QFramework4J: About QFramework Sqlite-Jdbc 3.23.1 SwingSets3 数据库设计 Us
2021-12-18 · Production · 约 1 分钟
小老板的账都在微信里,我做成了 AI 产品,然后…
一年了终于憋出第一篇文章,自称AI产品却干着ERP的活。核心就一句话:小老板不缺记账,缺的是“这单到底赚没赚”——还得靠AI把微信聊天变账本。最后成本压垮项目?醒醒,先想清楚卖给谁再谈开发。
2026-07-31 · Production · 约 1 分钟
这台 iPad mini 7,可能是苹果最后的LCD小屏幕设备
苹果终于要放弃LCD了?iPad mini 7这块小屏幕成了绝唱,OLED是越来越刺眼。LCD自然、不伤眼,这可能是苹果最后一块让人舒服的屏幕了。真要改用OLED,LCD党表示不服。
2025-10-28 · 平板 · 约 1 分钟
Django集成腾讯COS对象存储
腾讯COS集成Django真够折腾的,官方SDK和文档烂到不行。自己封装Storage虽然简单,但腾讯那帮人写代码的心思让人看不懂。Django这套东西倒是好用,`FileField`、`ImageField`自动转OSS,不过`django-filer`那中文locale问题得手动改。
2025-07-17 · DjangoStarter · 约 1 分钟
讨论
共 0 条加载评论中…