JavaFX Game Tutorial: Bejeweled (Stream API)
We create a simple clone of game Bejeweled. Also while doing that we just touch the surface of the Stream API and see how a grid based game can be done using only streams.
There is a bug in how points are gathered. It should be i % W, i / H.
Couple of points I missed out on:
1. point - new Jewel(point) can be replaced with Jewel::new, since constructors can also be referenced, just like methods
2. There is no need to "collect" rows and columns each time we call checkState(). We don't alter the objects, so we can pre-compute list for rows and columns during content creation
Source: https://github.com/AlmasB/FXTutorials
Stream API doc: https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html
Twitter: https://twitter.com/AlmasBaim
Sponsor: https://github.com/sponsors/AlmasB/
Other Videos By Almas Baim (AlmasB)
2015-11-20 | FXGL - Core Features |
2015-10-29 | Git: Simple Introduction |
2015-10-19 | JavaFX: Shapes, Animation, Lambda Expressions |
2015-09-25 | JavaFX Game: Minesweeper |
2015-09-24 | JavaFX FXGL: Basic Game Introduction |
2015-09-21 | JavaFX MVC + JDBC + DAO + DI: Library Loan System |
2015-09-13 | JavaFX UI: iOS Style Toggle Switch |
2015-09-03 | JavaFX on Android (Full Tutorial) |
2015-09-01 | JavaFX Software: Chat (Server-Client) |
2015-08-23 | JavaFX Software: File Downloader (Threads) |
2015-08-21 | JavaFX Game Tutorial: Bejeweled (Stream API) |
2015-08-18 | JavaFX Game Development: Particle System |
2015-08-05 | JavaFX Game Development: Games Architecture |
2015-08-01 | JavaFX Software Tutorial: Calculator (MVC) |
2015-07-29 | JavaFX Game Tutorial: Millionaire |
2015-07-23 | JavaFX Game Tutorial: TicTacToe |
2015-07-18 | JavaFX Game Tutorial: Memory Puzzle |
2015-07-17 | JavaFX Game Development: Basic Math |
2015-07-15 | JavaFX on Android (Quick Preview) |
2015-07-04 | Full JavaFX Game Development Process (Breakout) |
2015-07-02 | FXGL 0.1.3 Preview (Raycast, Entity Interaction) |