<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tankattack;

import javafx.animation.*;
import javafx.application.*;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.*;
import javafx.scene.control.Button;
import javafx.scene.effect.*;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.stage.Stage;
import javafx.util.*;

/**
 *
 * @author Ruslan
 */
public class TankAttack extends Application {
    
    public static final double gameWidth = 600;
    public static final double gameHeight = 600;
    
    public static final int NUM_FRAMES_PER_SECOND = 60;
    
    public static double buttonWidth = gameWidth / 5;
    public static double buttonHeight = gameWidth / 10;
    
    private Stage currStage;
    private World currWorld;
    private Scene currScene;
    
    @Override
    public void start(Stage primaryStage) {
        
        currStage = primaryStage;
        displayStartMenu(primaryStage);

    }
    
    private void displayStartMenu(Stage stage) {
        
        stage.setTitle("Main Menu");
        Group menuRoot = new Group();
        final Scene mainMenu = new Scene(menuRoot, TankAttack.gameWidth, TankAttack.gameHeight);
        
        // Launch Background Animation
        launchAnimationForDisplayMenu(stage, menuRoot);
        
        // Create Buttons
        createButtonsForDisplayMenu(stage, menuRoot);
        
        stage.setScene(mainMenu);
        stage.show();
        
    }
        
        displayCurrentScene();
        
        primaryStage.setTitle("TANK ATTACK");
        primaryStage.show();
                
        setupAndLaunchGameLoopForCurrWorld(currWorld);

    }
    
    public void setupAndLaunchGameLoopForCurrWorld(World world) {

        world.initAnimation();
    
    }
    
    private void transitionFromFirstWorldToSecondWorld() {
        
        
        
    }<commit_msg>implements circle animation on launch screen<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tankattack;

import javafx.animation.*;
import javafx.application.*;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.*;
import javafx.scene.control.Button;
import javafx.scene.effect.*;
import javafx.scene.layout.*;
import javafx.scene.paint.*;
import javafx.scene.shape.*;
import javafx.stage.Stage;
import javafx.util.*;

/**
 *
 * @author Ruslan
 */
public class TankAttack extends Application {
    
    public static final double gameWidth = 600;
    public static final double gameHeight = 600;
    
    public static final int NUM_FRAMES_PER_SECOND = 60;
    
    public static double buttonWidth = gameWidth / 5;
    public static double buttonHeight = gameWidth / 10;
    
    private Stage currStage;
    private World currWorld;
    private Scene currScene;
    
    @Override
    public void start(Stage primaryStage) {
        
        currStage = primaryStage;
        displayStartMenu(primaryStage);

    }
    
    private void displayStartMenu(Stage stage) {
        
        stage.setTitle("Main Menu");
        Group menuRoot = new Group();
        final Scene mainMenu = new Scene(menuRoot, TankAttack.gameWidth, TankAttack.gameHeight);
        
        // Launch Background Animation
        launchAnimationForDisplayMenu(stage, menuRoot);
        
        // Create Buttons
        createButtonsForDisplayMenu(stage, menuRoot);
        
        stage.setScene(mainMenu);
        stage.show();
        
    }
    
    private void launchAnimationForDisplayMenu(Stage stage, Group root) {
        
        // Most of this method was obtained from stackoverflow.com
        
        Group circles = new Group();

        for(int cont = 0 ; cont < 30 ; cont++) {  
            
            Circle circle = new Circle();  
            circle.setFill(Color.BLUE);  
            circle.setEffect(new GaussianBlur(Math.random() * 8 + 2));  
            circle.setOpacity(Math.random());  
            circle.setRadius(Math.random()*30);  
            circle.setCenterX(TankAttack.gameWidth * Math.random());
            circle.setCenterY(TankAttack.gameHeight * Math.random());
             
            circles.getChildren().add(circle);  
             
            double randScale = (Math.random() * 4) + 1;  
             
            KeyValue kValueX = new KeyValue(circle.scaleXProperty() , randScale);  
            KeyValue kValueY = new KeyValue(circle.scaleYProperty() , randScale);  
            KeyFrame kFrame = new KeyFrame(Duration.millis(5000 + (Math.random() * 5000)) , kValueX , kValueY);  
             
            Timeline timeL = new Timeline();  
            timeL.getKeyFrames().add(kFrame);  
            timeL.setAutoReverse(true);  
            timeL.setCycleCount(Animation.INDEFINITE);  
            timeL.play();  
            
        }  
        
        root.getChildren().add(circles);
        
    }
        
        displayCurrentScene();
        
        primaryStage.setTitle("TANK ATTACK");
        primaryStage.show();
                
        setupAndLaunchGameLoopForCurrWorld(currWorld);

    }
    
    public void setupAndLaunchGameLoopForCurrWorld(World world) {

        world.initAnimation();
    
    }
    
    private void transitionFromFirstWorldToSecondWorld() {
        
        
        
    }
{'fraction_non_alphanumeric': 0.08737177219667493, 'fraction_numerical': 0.006897771489211178, 'mean_word_length': 2.23512585812357, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7196724', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1503, 'n_words': 373}