Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added Attempt/bin/Attacker.class
Binary file not shown.
Binary file added Attempt/bin/EnemyControl.class
Binary file not shown.
Binary file added Attempt/bin/GameMenuDemo$1.class
Binary file not shown.
Binary file added Attempt/bin/GameMenuDemo$2.class
Binary file not shown.
Binary file added Attempt/bin/GameMenuDemo$3.class
Binary file not shown.
Binary file added Attempt/bin/GameMenuDemo$MenuBox.class
Binary file not shown.
Binary file added Attempt/bin/GameMenuDemo$MenuItem.class
Binary file not shown.
Binary file added Attempt/bin/GameMenuDemo.class
Binary file not shown.
Binary file added Attempt/bin/One.class
Binary file not shown.
Binary file added Attempt/bin/TroopControl.class
Binary file not shown.
Binary file added Attempt/bin/Zero.class
Binary file not shown.
Binary file added Attempt/bin/soundtrack.mp3
Binary file not shown.
Binary file added Attempt/res/imgs/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Background Main.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/BackgroundMain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Code_of_Honor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Evolution1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Evolution1E.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Evolution2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Evolution2E.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Evolution3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Evolution3E.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/MusicOff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/Thumbs.db
Binary file not shown.
Binary file added Attempt/res/imgs/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/cashbag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/evolve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/music.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/one.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/troop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/turret.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Attempt/res/imgs/zero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Attempt/src/Attacker.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import java.io.FileNotFoundException;

import javafx.scene.control.Button;
import javafx.scene.image.ImageView;



public abstract class Attacker extends TroopControl
{
public abstract void decreaseHealth(int d);
public abstract int getHealth();
public abstract int getDamage();
public abstract void move();
public abstract void setImg(ImageView i);
public abstract void setImgE(ImageView i);
//public abstract void setClosest(Button x);
public abstract ImageView getImg();
}
65 changes: 65 additions & 0 deletions Attempt/src/EnemyControl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransition;
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;
import javafx.util.Duration;

public class EnemyControl extends TroopControl
{
private Pane root;
private ImageView img;
public void setRoot(Pane root)
{
this.root = root;

logic();
}

public void logic()
{

/*System.out.println("Hey");
Timer t = new TranslateTransition();
t.setDuration(Duration.millis(50000));
t.setByX(10);
t.setOnFinished(e -> {

System.out.println("Hey2");
try
{
img = createTroop(new One(false), false);
} catch (Exception e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
root.getChildren().add(img);



});
t.play();*/

Timeline timeline = new Timeline(new KeyFrame(
Duration.millis((int)(Math.random() * 3000) + 2000),
ae -> produceOne()));
timeline.play();
}

public void produceOne()
{
try
{
img = createTroop(new One(false), false);
} catch (Exception e1)
{
// TODO Auto-generated catch block
e1.printStackTrace();
}
root.getChildren().add(img);
if(stop)
logic();
}
}
Loading