A maven-based JavaFX Asteroids game based on a tutorial from Lee Stemkoski

Related tags

GUI javafx-asteroids
Overview

JavaFX Asteroids

About

This is a maven-based project which implements a JavaFX Asteroids Game.

The code is based on a tutorial from Lee Stemkoski which comes in two parts:

The project was created in IntelliJ from the "IntelliJ: Modular with Maven" instructions on https://openjfx.io/openjfx-docs/

The project is modular and does not require a separate javafx library install because it brings in javafx via the maven dependency. The only prerequisites were to have the Java SDK installed (I'm using 17.0.1 from Oracle) and to install maven (3.8.4).

I use both a Windows 10 desktop and MacBook Pro laptop (2012) and ran the project on both. For Windows, I use Git Bash (mingw64) in Windows terminal.

The code is an almost direct copy of the code from the video tutorial from Lee Stemkoski. There are some comments in the comments section asking for a link to the code. I will therefore not refactor the code so that it stays close to the original. I reached out to Lee Stemkoski to ask if he was okay with me putting the code for the video online. Lee confirmed he is fine with me sharing the code from his tutorial video. Thank you Lee!

Since Lee was so kind to allow me to share, I'd like to encourage you to take a look at his homepage and some of his other videos (and books). You can find them via the following links:

How to run the game

From terminal / windows terminal / git bash

  1. cd into the root folder of the project (where the pom.xml is)
  2. mvn javafx:run

From intellij

  1. open the project in intellij
  2. in the maven pane, navigate to plugins and run javafx:run under javafx
  3. or create a maven run configuration with the run field set to "javafx:run"

Game Assets

Game images were sourced from opengameart.org. All of them are Public Domain CCO license: https://creativecommons.org/publicdomain/zero/1.0/

Asteroid: https://opengameart.org/content/asteroid-generator-and-a-set-of-generated-asteroids scaled to 100x100

Space background: https://opengameart.org/content/space-backgrounds-with-stars-and-nubular scaled to 800x600

Ship: https://opengameart.org/content/purple-space-ship scaled to 50x50

Laser: https://opengameart.org/content/pixel-orbs scaled to 10x10

Creating an installer

To create an installer (exe for windows, dmg for mac), follow these instructions:

  1. if using windows make sure wix toolset is installed. for mac make sure xcode is installed.
  2. open a terminal
  3. cd into the root of this project
  4. build-package.sh
  5. an exe (installer for windows) or dmg (installer for mac) will be created
  6. run the installer

note: on windows, you may have to use explorer go to c:\program files\javafx-asteroids. In the future the build-package script could be modified to add a shortcut on the desktop or the windows app launcher

You might also like...

FXDesktopSearch - a Java and JavaFX based Desktop Search Application

FXDesktopSearch - a Java and JavaFX based Desktop Search Application

FXDesktopSearch - The free search application for your desktop FXDesktopSearch is a Java and JavaFX based Desktop Search Application. It crawls a conf

Oct 14, 2022

Tic-Tac-Toe-GUI - This repository contains Java based interactive Tic-Tac-Toe game.

Tic-Tac-Toe This repository contains Java based interactive Tic-Tac-Toe game. In this game you can play individual or with another player with your na

Sep 1, 2022

Collection of Binding helpers for JavaFX(8)

Advanced-Bindings for JavaFX (8) advanced-bindings is a collection of useful helpers and custom binding implementations to simplify the development of

Nov 19, 2022

Docking framework for JavaFX platform

Docking framework for JavaFX platform

Docking framework for JavaFX platform AnchorFX is a gratis and open source library for JavaFX to create graphical interfaces with docking features Anc

Oct 15, 2022

A library of +70 ready-to-use animations for JavaFX

AnimateFX A library of ready-to-use animations for JavaFX Features: Custom animations Custom interpolators Play/Stop animation Play an animation after

Jan 5, 2023

BootstrapFX: Bootstrap for JavaFX

BootstrapFX: Bootstrap for JavaFX

BootstrapFX BootstrapFX is a partial port of Twitter Bootstrap for JavaFX. It mainly provides a CSS stylesheet that closely resembles the original whi

Dec 28, 2022

A Java framework for creating sophisticated calendar views (JavaFX 8, 9, 10, and 11)

A Java framework for creating sophisticated calendar views (JavaFX 8, 9, 10, and 11)

CalendarFX A Java framework for creating sophisticated calendar views based on JavaFX. A detailed developer manual can be found online: CalendarFX 8 D

Jan 6, 2023

Allow runtime modification of JavaFX CSS

Allow runtime modification of JavaFX CSS

cssfx ⚠ WARNING ⚠ In version 11.3.0 we have relocated & refactored the project. maven groupId has been changed to fr.brouillard.oss java module name h

Jan 2, 2023

A JavaFX UI framework to create fully customized undecorated windows

A JavaFX UI framework to create fully customized undecorated windows

CustomStage A JavaFX undecorated stage which can fully be customized Donations If this project is helpful to you and love my work and feel like showin

Jan 6, 2023
Owner
null
DataFX - is a JavaFX frameworks that provides additional features to create MVC based applications in JavaFX by providing routing and a context for CDI.

What you’ve stumbled upon here is a project that intends to make retrieving, massaging, populating, viewing, and editing data in JavaFX UI controls ea

Guigarage 110 Dec 29, 2022
JavaFX based Connect4 Game.

Connect4 [email protected] https://github.com/MitchellGray100/Connect4 JavaFX Connect4 Game. Local 2 Player or 1 Player (With AI). It's Connec

Mitchell Gray 3 Jan 6, 2022
Tray Icon implementation for JavaFX applications. Say goodbye to using AWT's SystemTray icon, instead use a JavaFX Tray Icon.

FXTrayIcon Library intended for use in JavaFX applications that makes adding a System Tray icon easier. The FXTrayIcon class handles all the messy AWT

Dustin Redmond 248 Dec 30, 2022
Lobby System Template for a multiplayer java game, with chat and other features, using JavaFX and socket TCP (will be extended to UDP).

JavaFX-MultiplayerLobbySystem JavaFX lobby system for multiplayer games with chat, ready toggle and kick buttons, using socket TCP by default. Demo Cr

Michele Righi 7 May 8, 2022
The snake and Ladders Game 🎲 for two players made using JavaFx with important concepts of OOPs🐍 🪜

The snake and Ladders Game made using JavaFx with important concepts of OOPs, done as a project for Advanced Programming course (CSE201) under Prof. Koteswar Rao Jerripothula

null 2 Sep 5, 2022
Checkers game. Server and Client. Client's app handled in JavaFX. Play with radom player or against AI.

Checkers-JavaFX-and-Sockets Checkers game. Server and Client. Client's app handled in JavaFX. Play with radom player or against AI. If you want to pla

Jakub Bednarski 1 Mar 30, 2022
Tetromino is a Tetris-like game written in Java with JavaFX.

Tetromino Link to original project in university's GitLab Tetromino is a Tetris-like game written in Java with JavaFX made by Jonas and myself during

Tobias Helmrich 2 Dec 13, 2021
A maven plugin to include features from jmeter-plugins.org for JMeterPluginsCMD Command Line Tool to create graphs, export csv files from jmeter result files and Filter Result tool.

jmeter-graph-tool-maven-plugin A maven plugin to create graphs using the JMeter Plugins CMDRunner from JMeter result files (*.jtl or *.csv) or using F

Vincent DABURON 6 Nov 3, 2022
Example of using the TestFX library to perform E2E tests in a Maven project

demoTestFX Ejemplo de uso de la librería TestFX para realizar pruebas E2E en un proyecto Maven. El principal problema para conseguir ejecutar los test

null 1 Jan 28, 2022
It is a desktop application based on JavaFX to implement a Carmeter-GPS.

CarMeter_JavaFX It is a desktop application based on JavaFX to implement a Carmeter-GPS. Video View more Details about the project.---> Link to Video

Abdullah HAnfy 0 Nov 29, 2022