Package com.apogee.dev.DuoVaders.client
Class DualVaders
java.lang.Object
javafx.application.Application
com.apogee.dev.DuoVaders.client.DualVaders
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionVariables globales *(package private) static javafx.scene.text.Text(package private) static javafx.scene.text.Text(package private) static int(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.RectangleFields inherited from class javafx.application.Application
STYLESHEET_CASPIAN, STYLESHEET_MODENA -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidalienMove(javafx.scene.Scene s) Déplacement des aliens.static voidÉlection des aliens qui vont tirer.static voidVérification de la fin du jeu (gagnant ou perdant)static voidgame(javafx.stage.Stage primaryStage) Main game method - instantiate all the game objects, start game loops and handle mechanicsstatic voidgame(javafx.stage.Stage primaryStage, boolean isLocal) static voidÉcran de fin de partiestatic voidLancement du jeuprivate static voidplace_enemies(int nombre_enemies, int taille_enemies, javafx.scene.Scene s) Placement initial des ennemis.voidstart(javafx.stage.Stage primaryStage) Menu principal de l'applicationstatic voidtimer()Permet au timer de s'incrémenter toutes les 10 millisecondesprivate static javafx.scene.text.TextTexte de titrevoidupdate(Observable o, Object arg) This method is called whenever the observed object is changed.static voidMise à 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
-
Field Details
-
primStage
static javafx.stage.Stage primStage -
enemies
Variables globales * -
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
-
-
Constructor Details
-
DualVaders
public DualVaders()
-
-
Method Details
-
start
public void start(javafx.stage.Stage primaryStage) Menu principal de l'application- Specified by:
startin classjavafx.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
Texte de titre- Parameters:
text- texte à affichers- scène sur laquelle afficher le texte- Returns:
- le texte mis en forme
-
gameOver
É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 à placertaille_enemies- Taille des ennemiss- Scène sur laquelle les ennemis sont affichés
-
main
Lancement du jeu- Parameters:
args- Arguments de la ligne de commande
-
update
This method is called whenever the observed object is changed. An application calls anObservableobject'snotifyObserversmethod to have all the object's observers notified of the change.
-