Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Medieval adventure #3033

Closed
wants to merge 5 commits into from
Closed
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
1 change: 1 addition & 0 deletions Games/Medieval_Adventure/.gitIgnore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
16 changes: 16 additions & 0 deletions Games/Medieval_Adventure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# **Medieval Adventure**

---

<br>

## **Description 📃**
To complete the game, you'll have to fight the various creatures in your path, making strategic choices.

## **functionalities 🎮**
You can choose your character, a warrior or a wizard. Each has two different abilities, making for a different gaming experience.

<br>

## **How to play? 🕹️**
Select the ability you wish to use. Each character has an attack and a protection/care ability. Be careful with your life, some enemies are tougher than others.
52 changes: 52 additions & 0 deletions Games/Medieval_Adventure/assets/game-lvl2.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Battle</title>
</head>
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet">

<body class="game2" id="game">
<div id="game-bloc">
<div id="character-bloc">
<div id="character-hp__container">
<div id="character-hp"></div>
</div>
<div id="character-energy__container">
<div id="character-energy"></div>
</div>
<div id="character-xp__container">
<div id="character-xp"></div>
</div>
</div>
<div id="monster-bloc" class="monsterFeuilleIdle">
<div id="monster-hp__container">
<div id="monster-hp"></div>
</div>
</div>
</div>
<div id="infos-bloc">
<div id="spell-bloc">
<div id="spell1" class="btn btn-spell"><img src="./img/Potion.png"></img>
</div>
<div id="spell2" class="btn btn-spell"><img src="./img/Sword.png"></img>
</div>
<div id="next" class="btn btn-spell">Pass</div>
</div>
<div id="log-bloc">
<p>...</p>
</div>
<div id="counter-bloc">
<p>Round 0</p>

</div>

</div>
<script type='module' src="../assets/module/game-lvl2.js"></script>
</body>

</html>
52 changes: 52 additions & 0 deletions Games/Medieval_Adventure/assets/game-lvl3.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Battle</title>
</head>
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet">

<body class="game3" id="game">
<div id="game-bloc">
<div id="character-bloc">
<div id="character-hp__container">
<div id="character-hp"></div>
</div>
<div id="character-energy__container">
<div id="character-energy"></div>
</div>
<div id="character-xp__container">
<div id="character-xp"></div>
</div>
</div>
<div id="monster-bloc3" class="dragon">
<div id="monster-hp__container">
<div id="monster-hp"></div>
</div>
</div>
</div>
<div id="infos-bloc">
<div id="spell-bloc">
<div id="spell1" class="btn btn-spell"><img src="./img/Potion.png"></img>
</div>
<div id="spell2" class="btn btn-spell"><img src="./img/Sword.png"></img>
</div>
<div id="next" class="btn btn-spell">Pass</div>
</div>
<div id="log-bloc">
<p>...</p>
</div>
<div id="counter-bloc">
<p>Round 0</p>

</div>

</div>
<script type='module' src="../assets/module/game-lvl3.js"></script>
</body>

</html>
22 changes: 22 additions & 0 deletions Games/Medieval_Adventure/assets/game-over.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Battle</title>
</head>
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet">

<body class="game-over" id="game-over">
<div id="game-over-bloc">
<h1>Game Over</h1>
<button id="goBtn" class="btn">Replay</button>
</div>

<script type="module" src="../assets/module/game-over.js"></script>
</body>

</html>
52 changes: 52 additions & 0 deletions Games/Medieval_Adventure/assets/game.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>Battle</title>
</head>
<link rel="stylesheet" href="../style.css" type="text/css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet">

<body class="game" id="game">
<div id="game-bloc">
<div id="character-bloc">
<div id="character-hp__container">
<div id="character-hp"></div>
</div>
<div id="character-energy__container">
<div id="character-energy"></div>
</div>
<div id="character-xp__container">
<div id="character-xp"></div>
</div>
</div>
<div id="monster-bloc" class="monsterdIdle">
<div id="monster-hp__container">
<div id="monster-hp"></div>
</div>
</div>
</div>
<div id="infos-bloc">
<div id="spell-bloc">
<div id="spell1" class="btn btn-spell"><img src="../assets/img/Potion.png"></img>
</div>
<div id="spell2" class="btn btn-spell"><img src="../assets/img/Sword.png"></img>
</div>
<div id="next" class="btn btn-spell">Pass</div>
</div>
<div id="log-bloc">
<p>...</p>
</div>
<div id="counter-bloc">
<p>Round 0</p>

</div>

</div>
<script type='module' src="../assets/module/game.js"></script>
</body>

</html>
Binary file added Games/Medieval_Adventure/assets/img/Blob.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 Games/Medieval_Adventure/assets/img/Dragon.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 Games/Medieval_Adventure/assets/img/Fond.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 Games/Medieval_Adventure/assets/img/Idle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Games/Medieval_Adventure/assets/img/Map1.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 Games/Medieval_Adventure/assets/img/Map2.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 Games/Medieval_Adventure/assets/img/Map3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Games/Medieval_Adventure/assets/img/Potion.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 Games/Medieval_Adventure/assets/img/Sword.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 Games/Medieval_Adventure/assets/img/Warrior.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions Games/Medieval_Adventure/assets/js/blob.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import Character from "./Character.js";

class Blob extends Character {
maxEnergie;
maxHp;
degat;
constructor(){
super(window.localStorage.getItem('Name'),100,1,0,10,1);
this.maxEnergie = this.energie;
this.maxHp = this.hp;
}

/**
* Repos
*/
capacite1(){
if(this.energie >= 1){
this.energie -= 1;
this.hp += 1;
if(this.hp == this.maxHp){
return " is resting, he's already at maximum hp.";
}
return " rests, recovers 1 pv.";
}
return " can't do anything."
}

/**
* Attack
*/
capacite2(ennemi){
if(this.energie >= 1){
this.energie -= 1;
ennemi.hp -= 1;
return " inflicts 1 damage on the enemy.";
}
return " is tired, he can't do anything.";
}
}
export default Blob;
59 changes: 59 additions & 0 deletions Games/Medieval_Adventure/assets/js/character.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
class Character{
/**
* Personnage choisi
* @param {string} name Name
* @param {int} hp Hp
* @param {int} power Power
* @param {int} xp Xp
* @param {int} xpMax Xp Maximum
* @param {int} energie Energie
*/

constructor(name, hp, power, xp, xpMax, energie){
this.name = name;
this.hp = hp;
this.power = power;
this.xp = xp;
this.xpMax = xpMax;
this.energie = energie;
}
// Setter and Getter
get getName() {
return this.name;
}
set setName(name) {
this.name = name;
}
get getHp() {
return this.hp;
}
set setHp(hp) {
this.hp = hp;
}
get getPower() {
return this.power;
}
set setPower(power) {
this.power = power;
}
get getXp() {
return this.xp;
}
set setXp(xp) {
this.xp = xp;
}
get getXpMax() {
return this.xpMax;
}
set setXpMax(xp) {
this.xpMax = this.xp;
}
get getEnergie() {
return this.energie;
}
set setEnergie(energie) {
this.energie = energie;
}

}
export default Character;
17 changes: 17 additions & 0 deletions Games/Medieval_Adventure/assets/js/dragon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Monster from "./Monster.js";

class Dragon extends Monster {
constructor(){
super(35,7,0);
}

/**
* Attack
*/
attack(ennemi){
var degat = Math.floor(Math.random() * this.power) + 1;
ennemi.hp -= degat;
return degat;
}
}
export default Dragon;
34 changes: 34 additions & 0 deletions Games/Medieval_Adventure/assets/js/monster.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class Monster{
/**
* Monstre ennemi
* @param {int} hp Point de vie de l'ennemi
* @param {int} power Pouvoir de l'ennemi
* @param {int} energie Energie de l'ennemi
*/
constructor(hp, power, energie){
this.hp = hp;
this.power = power;
this.energie = energie;
}

// Setter and getter
get getHp() {
return this.hp;
}
set setHp(hp) {
this.hp = hp;
}
get getPower() {
return this.power;
}
set setPower(power) {
this.power = power;
}
get getEnergie() {
return this.energie;
}
set setEnergie(energie) {
this.energie = energie;
}
}
export default Monster;
17 changes: 17 additions & 0 deletions Games/Medieval_Adventure/assets/js/tasDeFeuille.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Monster from "./Monster.js";

class TasDeFeuille extends Monster {
constructor(){
super(20,6,0);
}

/**
* Attack
*/
attack(ennemi){
var degat = Math.floor(Math.random() * this.power) + 1;
ennemi.hp -= degat;
return degat;
}
}
export default TasDeFeuille;
17 changes: 17 additions & 0 deletions Games/Medieval_Adventure/assets/js/vers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Monster from "./Monster.js";

class Vers extends Monster {
constructor(){
super(15,5,0);
}

/**
* Attack
*/
attack(ennemi){
var degat = Math.floor(Math.random() * this.power) + 1;
ennemi.hp -= degat;
return degat;
}
}
export default Vers;
Loading
Loading