Class DualVaders

java.lang.Object
javafx.application.Application
com.apogee.dev.DuoVaders.client.DualVaders
All Implemented Interfaces:
Observer

public class DualVaders extends javafx.application.Application implements Observer
Classe principale du jeu DualVaders
Version:
2.0
Author:
Margot Taillantou-Candau, Thomas Prévost
See Also:
  • Application
  • Nested Class Summary

    Nested classes/interfaces inherited from class javafx.application.Application

    javafx.application.Application.Parameters
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static List<Alien>
    Variables globales *
    (package private) static List<Bullet>
     
    (package private) static javafx.scene.text.Text
     
    (package private) static javafx.scene.text.Text
     
    (package private) static int
     
    (package private) static ArrayList<Player>
     
    (package private) static javafx.stage.Stage
     
    (package private) static javafx.scene.text.Text
     
    (package private) static javafx.scene.text.Text
     
    (package private) static int
     
    (package private) static double
     
    (package private) static javafx.scene.text.Text
     
    (package private) static javafx.scene.shape.Rectangle
     
    (package private) static javafx.scene.shape.Rectangle
     

    Fields inherited from class javafx.application.Application

    STYLESHEET_CASPIAN, STYLESHEET_MODENA
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    alienMove(javafx.scene.Scene s)
    Déplacement des aliens.
    static void
    Élection des aliens qui vont tirer.
    static void
    Vérification de la fin du jeu (gagnant ou perdant)
    static void
    game(javafx.stage.Stage primaryStage)
    Main game method - instantiate all the game objects, start game loops and handle mechanics
    static void
    game(javafx.stage.Stage primaryStage, boolean isLocal)
     
    static void
    gameOver(javafx.stage.Stage primaryStage, String msg)
    Écran de fin de partie
    static void
    main(String[] args)
    Lancement du jeu
    private static void
    place_enemies(int nombre_enemies, int taille_enemies, javafx.scene.Scene s)
    Placement initial des ennemis.
    void
    start(javafx.stage.Stage primaryStage)
    Menu principal de l'application
    static void
    Permet au timer de s'incrémenter toutes les 10 millisecondes
    private static javafx.scene.text.Text
    title(String text, javafx.scene.Scene s)
    Texte de titre
    void
    This method is called whenever the observed object is changed.
    static void
    Mise à jour des compteurs de score et de vie en cours de partie.

    Methods inherited from class javafx.application.Application

    getHostServices, getParameters, getUserAgentStylesheet, init, launch, launch, notifyPreloader, setUserAgentStylesheet, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • primStage

      static javafx.stage.Stage primStage
    • enemies

      static List<Alien> enemies
      Variables globales *
    • flyingBullets

      static List<Bullet> flyingBullets
    • viePlayer1

      static javafx.scene.shape.Rectangle viePlayer1
    • viePlayer2

      static javafx.scene.shape.Rectangle viePlayer2
    • lifeTxt1

      static javafx.scene.text.Text lifeTxt1
    • lifeTxt2

      static javafx.scene.text.Text lifeTxt2
    • scoreTxt1

      static javafx.scene.text.Text scoreTxt1
    • scoreTxt2

      static javafx.scene.text.Text scoreTxt2
    • timerTxt

      static javafx.scene.text.Text timerTxt
    • timeElapsed

      static double timeElapsed
    • nombre_ennemis

      static int nombre_ennemis
    • taille_ennemis

      static int taille_ennemis
    • players

      static ArrayList<Player> players
  • Constructor Details

    • DualVaders

      public DualVaders()
  • Method Details

    • start

      public void start(javafx.stage.Stage primaryStage)
      Menu principal de l'application
      Specified by:
      start in class javafx.application.Application
      Parameters:
      primaryStage - the primary stage for this application, onto which the application scene can be set. Applications may create other stages, if needed, but they will not be primary stages.
    • game

      public static void game(javafx.stage.Stage primaryStage)
      Main game method - instantiate all the game objects, start game loops and handle mechanics
      Parameters:
      primaryStage - the primary stage for this application, onto which the application scene can be set. Applications may create other stages, if needed, but they will not be primary stages.
    • game

      public static void game(javafx.stage.Stage primaryStage, boolean isLocal)
    • title

      private static javafx.scene.text.Text title(String text, javafx.scene.Scene s)
      Texte de titre
      Parameters:
      text - texte à afficher
      s - scène sur laquelle afficher le texte
      Returns:
      le texte mis en forme
    • gameOver

      public static void gameOver(javafx.stage.Stage primaryStage, String msg)
      Écran de fin de partie
      Parameters:
      primaryStage - the primary stage for this application, onto which the application scene can be set. Applications may create other stages, if needed, but they will not be primary stages.
      msg - Message à afficher aux joueurs (raison du game over)
    • checkEndGame

      public static void checkEndGame()
      Vérification de la fin du jeu (gagnant ou perdant)
    • timer

      public static void timer()
      Permet au timer de s'incrémenter toutes les 10 millisecondes
    • alienMove

      public static void alienMove(javafx.scene.Scene s)
      Déplacement des aliens. L'armada alien verticale part de la gauche de l'écran et se déplace horizontalement de gauche à droite. Lorsqu'elle atteint le côté droit de l'écran, elle monte ou descend d'une rangée et se déplace de droite à gauche. Lorsqu'elle atteint le côté gauche de l'écran, elle monte ou descend d'une rangée et se déplace à nouveau vers la droite. Le déplacement vertical est aléatoire pour l'ensemble de la flotte.
      Parameters:
      s - la scène du jeu
    • alienShoot

      public static void alienShoot()
      Élection des aliens qui vont tirer. Cette sélection est aléatoire dans [0, nb_aliens/2[.
    • updateCounters

      public static void updateCounters()
      Mise à jour des compteurs de score et de vie en cours de partie.
    • place_enemies

      private static void place_enemies(int nombre_enemies, int taille_enemies, javafx.scene.Scene s)
      Placement initial des ennemis.
      Parameters:
      nombre_enemies - Nombre d'ennemis à placer
      taille_enemies - Taille des ennemis
      s - Scène sur laquelle les ennemis sont affichés
    • main

      public static void main(String[] args)
      Lancement du jeu
      Parameters:
      args - Arguments de la ligne de commande
    • update

      public void update(Observable o, Object arg)
      This method is called whenever the observed object is changed. An application calls an Observable object's notifyObservers method to have all the object's observers notified of the change.
      Specified by:
      update in interface Observer
      Parameters:
      o - the observable object.
      arg - an argument passed to the notifyObservers method.