Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cb9a05b
revert before javafx; gradle 8.5; java 11; reformat; io.mattw.jpowder
mattwright324 Jul 28, 2024
c8caeef
remove eclipse file
mattwright324 Jul 28, 2024
d4e8591
fix initialization npe
mattwright324 Jul 28, 2024
f8f0757
more cleanup and moving things around
mattwright324 Jul 28, 2024
1f27c98
separate application main class; flatlaf
mattwright324 Jul 28, 2024
2804451
basic menu bar items; window embedded menu
mattwright324 Jul 28, 2024
7b05b50
add missing braces
mattwright324 Jul 28, 2024
1f63f53
lombok; lots of getters n setters
mattwright324 Jul 28, 2024
2a6c61a
rename some stuff; cleanup
mattwright324 Jul 28, 2024
86921dc
more renaming
mattwright324 Jul 28, 2024
c387647
more renaming
mattwright324 Jul 28, 2024
f349c94
move some things around
mattwright324 Jul 28, 2024
a3c28d9
particle update id
mattwright324 Jul 29, 2024
968149f
icon 256
mattwright324 Jul 29, 2024
1f157cd
change menu bgs
mattwright324 Jul 29, 2024
b08db9f
move rename
mattwright324 Jul 30, 2024
dfa52d3
move rename
mattwright324 Jul 30, 2024
a495912
move rename
mattwright324 Jul 30, 2024
c0a3e3b
move rename
mattwright324 Jul 30, 2024
e0e5960
formatting
mattwright324 Jul 30, 2024
0326fc6
remove unused
mattwright324 Jul 30, 2024
18c1d30
refactor
mattwright324 Jul 30, 2024
9fe22f1
refactor
mattwright324 Jul 30, 2024
e28224b
refactor
mattwright324 Jul 31, 2024
e42939c
refactor; eventify, private, and de-static several things
mattwright324 Aug 1, 2024
30b6de5
view change event; refactor
mattwright324 Aug 4, 2024
e400240
tool selection event; refactor
mattwright324 Aug 5, 2024
a36d928
more cleanup; help event
mattwright324 Aug 11, 2024
5aed1bc
refactor and fix several things; draw circle now drawn with cells
mattwright324 Aug 15, 2024
4651d27
small cleanup
mattwright324 Aug 15, 2024
d3b3708
update readme
mattwright324 Aug 15, 2024
504b81b
update readme
mattwright324 Aug 15, 2024
c1fd260
decaymode enum
mattwright324 Aug 19, 2024
4a712d8
faster cursor drawing
mattwright324 Aug 19, 2024
3c219cc
fix cursor drawing
mattwright324 Aug 19, 2024
c8cd7aa
fix some wall interaction; add bomb element
mattwright324 Aug 19, 2024
a1b83dd
try new parts as queue
mattwright324 Aug 19, 2024
d6be0de
fix more wall interaction
mattwright324 Aug 19, 2024
f547712
clne bomb
mattwright324 Aug 19, 2024
f17c140
add warm and cool tools
mattwright324 Aug 19, 2024
90c0d24
fix plut decay
mattwright324 Aug 19, 2024
6dab6eb
add btry
mattwright324 Aug 23, 2024
09cacf1
btry burns
mattwright324 Aug 23, 2024
fe097dd
bomb temp
mattwright324 Aug 25, 2024
d439086
fill bomb wall npe
mattwright324 Aug 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ build/
jpowder-game.iml

/bin1/

log/
11 changes: 0 additions & 11 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

67 changes: 44 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,48 @@
# JPowder
# <img src='./src/main/resources/icon.png' width=42> JPowder

![Github All Releases](https://img.shields.io/github/downloads/mattwright324/jpowder-game/total.svg?style=flat-square)
![GitHub release](https://img.shields.io/github/release/mattwright324/jpowder-game.svg?style=flat-square)
![Github Releases](https://img.shields.io/github/downloads/mattwright324/jpowder-game/latest/total.svg?style=flat-square)

A java cellular automata based on The Powder Toy.

Thread located at [powdertoy.co.uk](http://powdertoy.co.uk/Discussions/Thread/View.html?Thread=19989&PageNum=0)

TODO:
* Walls - nearly done
* Pressure
* Display Options:
- Temp (color) - done
- Life Gradient - done
- Fancy-like - done
- Other effects - ?
* Particle Stacking - working on
* Gravity
* Improved liquid movement

Control | Action
------- | ------
T | Toggle drawing shape as Circle or Square.
F | Update by a single frame.
H | Toggle HUD
S | Toggle window size.
SPACE | Pause & Play
[ ] | Change drawing size +- 1
1 to 4 | View type: Default, Temp, Life Gradient, Fancy

![Preview](./README_preview.png)

Keybinding help, the same info can also be enabled on the hud in-game.

| Control | Action |
|---------|------------------------------------------------|
| T | Toggle drawing shape as Circle or Square. |
| F | Update by a single frame. |
| H | Toggle HUD |
| S | Toggle window size. |
| SPACE | Pause & Play |
| [ ] | Change drawing size +- 1 |
| 1 to 4 | View type: Default, Temp, Life Gradient, Fancy |

## Download

[![GitHub Releases](https://img.shields.io/badge/downloads-releases-brightgreen.svg?maxAge=60&style=flat-square)](https://github.com/mattwright324/jpowder-game/releases)

Be sure to have at least Java 11 installed.

Extract the latest release zip file and run `jpowder-yyyyMMdd.HHmmss.jar`.

## Build

Use the clean build commands to test a build. Use the run command to build and run.

```sh
$ ./gradlew clean build
$ ./gradlew run
```

## Package

Run the package command then zip up the `build/package` folder contents for a release.

```sh
$ ./gradlew packageJar
```
Binary file added README_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 68 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,76 @@
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'eclipse'
apply plugin: 'idea'
sourceCompatibility = 1.5
version = '0.0.1'
mainClassName = "main.java.powder.Window"
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
}
}

plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id "application"
}

repositories {
mavenCentral()
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

jar {
manifest {
attributes "Main-Class": "$mainClassName"
// fix for shadow plugin + log4j
attributes 'Multi-Release': 'true'
}
}

static def buildTime() {
return new Date().format('yyyyMMdd.HHmmss')
}

tasks.register('packageJar', Copy) {
delete layout.buildDirectory.dir('package')
dependsOn('shadowJar')

from layout.projectDirectory.file('README.md')
into layout.buildDirectory.dir('package')

from layout.projectDirectory.file('LICENSE')
into layout.buildDirectory.dir('package')

from layout.buildDirectory.file('libs/jpowder-game-all.jar')
into layout.buildDirectory.dir('package')

def version = buildTime()
from layout.buildDirectory.file('package/jpowder-game-all.jar')
rename { String fileName -> fileName.replace('game-all', version) }
}

// Setup application, dependencies
group = "io.mattw.jpowder"

application {
mainClassName = "io.mattw.jpowder.Application"
}

dependencies {
// implementation 'commons-io:commons-io:2.15.1'
implementation 'org.apache.logging.log4j:log4j-api:2.23.1'
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'

compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
implementation 'org.greenrobot:eventbus:3.1.1'

// UI
implementation 'com.formdev:flatlaf:3.4'
// implementation 'com.formdev:flatlaf-extras:3.4'
// implementation 'com.formdev:flatlaf-intellij-themes:3.4'
// implementation 'com.miglayout:miglayout-swing:11.3'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Fri Apr 10 10:58:33 BST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-all.zip
Loading