Share My Creation [B4J] - Minesweeper, dark/light theme, smooth animations, modern UI

Animation.gif

Minesweeper built with B4J. Three difficulty levels (Easy 5×5, Medium 8×8, Hard 12×12), flag support (right-click), BFS wave flood-fill reveal with spring-bounce animation, sequential mine reveal on loss, game timer, and a full dark/light theme system with a custom ModernToggle sun/moon switch. All colors, borders, and styles are theme-driven through a Theme class.
 

Attachments

  • b4j-minesweeper.zip
    9 KB · Views: 89

Alessandro71

Well-Known Member
Licensed User
Longtime User
i like to look at other people source to learn new tricks.
just some preliminary thoughts after a quick glance:
1) it's surprisingly compact
2) you don't use comments at all: it's your usual style or you just cleared them before publishing?
3) you created ModernToggle with all the designer properties, but you actually did not use designer to create the main layout: what is the choice behind that?
4) you did not use B4XPages at all: that would have allowed a port to mobile platforms, even if that would require converting all java-specific code to B4XView attributes (i.e. "-fx-font-size: 15;-fx-font-weight: bold;-fx-text-fill: " for example)
I'm not criticizing your work, just tech curiosity
 

Maxcfgos

Member
Licensed User
i like to look at other people source to learn new tricks.
just some preliminary thoughts after a quick glance:
1) it's surprisingly compact
2) you don't use comments at all: it's your usual style or you just cleared them before publishing?
3) you created ModernToggle with all the designer properties, but you actually did not use designer to create the main layout: what is the choice behind that?
4) you did not use B4XPages at all: that would have allowed a port to mobile platforms, even if that would require converting all java-specific code to B4XView attributes (i.e. "-fx-font-size: 15;-fx-font-weight: bold;-fx-text-fill: " for example)
I'm not criticizing your work, just tech curiosity
  1. Yeah, I clean up comments before publishing — just my usual habit.
  2. I'm trying to move away from relying on the Designer. The trend with newer tech stacks seems to be heading toward no visual designer at all, so I've been building layouts in code instead. ModernToggle still has Designer properties because I originally created and used it in the Designer on another project — here I just reused it as-is.
  3. I didn't use B4XPages mainly because I still don't fully understand that workflow yet — it's something I want to learn properly before using it in a project.
 
Top