Skip to content

Jeu de destruction de cible par laser. On tire avec un laser dans un terrain, le rayon est dévié avec des miroirs placés au préalable par le joueur pour éviter que le laser casse les murs et pour qu’il atteigne la cible.

Notifications You must be signed in to change notification settings

Pr3DaSniP/ProjetLaser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laser game

Language IDE Libraries Tests

Jeu de destruction de cible par laser. On tire avec un laser dans un terrain, le rayon est dévié avec des miroirs placés au préalable par le joueur pour éviter que le laser casse les murs et pour qu’il atteigne la cible.

Installation

Il suffit d'ajouter les fichiers dans un projet Code::Blocks et de compiler. Attention, il faut ajouter seulement les fichiers dont le nom ne commence pas par "test".

Structure du projet

Structure du projet

On peut brancher simplement des nouvelles façons d'afficher le jeu en créant une nouvelle classe héritant de Afficheur et en implémentant les méthodes virtuelles pures.

De même pour les objets dans le jeu, il suffit de créer une nouvelle classe héritant de Objet et en implémentant les méthodes virtuelles pures.

Démonstration

Menu du jeu :
Démonstration

Jeu (Headless) :

Démonstration Démonstration

Jeu (Graphique) :

Démonstration Démonstration

Création de terrain

Les terrains sont stockés dans un fichier JSON. Un mur est représenté par un X, un laser par un = et la cible par un @. Les espaces sont des cases vides.

{
    "NbColonnes": 5,
    "NbLignes": 5,
    "Terrain": [
        ["X","X","@","X","X"],
        ["X"," "," "," ","X"],
        ["="," "," "," ","X"],
        ["X"," "," "," ","X"],
        ["X","X","X","X","X"]
    ]
}

Démonstration

Le terrain créé est ensuite sauvegardé dans un fichier JSON.

{
    "NbColonnes": 10,
    "NbLignes": 10,
    "Terrain": [
        ["X","X","X","X","X","=","X","X","X","X"],
        ["X"," "," "," "," "," "," "," "," ","X"],
        ["X"," "," "," "," "," "," "," "," ","X"],
        ["X"," "," "," "," "," "," "," "," ","X"],
        ["X"," "," "," "," "," "," "," "," ","X"],
        ["X"," "," "," "," ","X"," "," "," ","@"],
        ["X"," "," "," "," "," "," "," "," ","X"],
        ["X"," "," "," "," "," "," "," "," ","X"],
        ["X"," "," "," "," "," "," "," "," ","X"],
        ["X","X","X","X","X","X","X","X","X","X"]
    ]
}

Exemple de terrain

Démonstration Démonstration Démonstration

Tests unitaires

Les tests unitaires sont réalisés avec la bibliothèque doctest. Les fichiers de tests portent le nom test*.cpp.

Tests unitaires

Auteurs

  • GEILLER Valentin, Université de Haute Alsace, L3 Informatique
  • DEMBELE Marieme, Université de Haute Alsace, L3 Miage
  • DIALLO Mouhamed, Université de Haute Alsace, L3 Miage

About

Jeu de destruction de cible par laser. On tire avec un laser dans un terrain, le rayon est dévié avec des miroirs placés au préalable par le joueur pour éviter que le laser casse les murs et pour qu’il atteigne la cible.

Topics

Resources

Stars

Watchers

Forks