INDAPlus21 / INDAPlus21/ardstrom-task-12

Pass

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

**Very well done Dante!**

Well, honestly, this is a guess since I cannot figure out how to compile your JavaFX Maven build on my crappy Windows machine. I will have nightmares of `Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)`. Could you please entertain instructions in the README file of how to setup and start your applications. This is an important skill to train. You don't have to explain how to build in a Windows environment, Linux will be enough. Imagine a setup instruction for a n00b you.

Notes on your code: You attempt minimal inline commentary. However, this is useless unless you acctually use the comments to explain your code.

_Your useful commentary_:
```java
public void start(Stage stage) throws IOException {
//...
Circle circle = new Circle(10); // tried making it a sphere and in so making this 3d but linux and javafx hates each other
//...
}
```
_Your useless commentary_:
```java
@Override
public void start(Stage stage) throws IOException {
Group group = new Group();
Scene scene = new Scene(group, sceneWidth, sceneHeight);
stage.setTitle("Ball");
stage.setScene(scene);

//...

Circle circle = new Circle(10);
//...

group.getChildren().add(circle);

stage.show();

//timeline basecase
Timeline timeline = new Timeline();
//...
timeline.getKeyFrames().addAll(/*...*/);
//timeline animation
timeline.setOnFinished(event -> {
//...

//x position
if(position.x >=sceneWidth ){/*...*/}
else if(position.x<=0 ){/*...*/}

//y position
if(position.y>=sceneHeight ){/*...*/}
else if(position.y <=0 ){/*...*/}

//z position
if(position.z>=sceneDepth ){/*...*/}
else if(position.z<=0 ){/*...*/}

timeline.getKeyFrames().set(/*...*/);
timeline.playFromStart();
});
timeline.play();
}
```
_Suggenstion_:
```java
@Override
/**
* Shows an animation of a moving ball on a given window
* in bounds of 600x600px.
*
* @param stage The application window object.
* @throws IOException Fail to print to screen.
*/
public void start(Stage stage) throws IOException {
//...

// Create ball graphics as a circle.
Circle circle = new Circle(10);
//...

// Add graphics to a scene graph.
Group group = new Group();
group.getChildren().add(circle);
Scene scene = new Scene(group, sceneWidth, sceneHeight);

// Setup window and render.
stage.setTitle("Ball");
stage.setScene(scene);
stage.show();

// Setup ball animation.
Timeline timeline = new Timeline();
//...

// Set start aninmation frame.
timeline.getKeyFrames().addAll(/*...*/);

// Setup and run.
timeline.setOnFinished(event -> {
//...

if(position.x >=sceneWidth ){/*...*/}
else if(position.x<=0 ){/*...*/}

if(position.y>=sceneHeight ){/*...*/}
else if(position.y <=0 ){/*...*/}

if(position.z>=sceneDepth ){/*...*/}
else if(position.z<=0 ){/*...*/}

timeline.getKeyFrames().set(/*...*/);
timeline.playFromStart();
});
timeline.play();
}
```

Secondly, I've newer written a JavaFX application before, so I might be wrong, but are you supposed to restart a single-frame-animation to animate the ball? There must be a simpler solution.

Keep it up!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README and the JavaFX Maven setup, then inspect the start(Stage stage) entry point and its animation logic. Done means Linux users can follow setup, build, and launch instructions, while the requested code commentary and animation concern are addressed or clearly scoped.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
desktop, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.