From 43bdf48ba170a19a7363ee3b0310f82c0fe747a5 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 18 May 2016 07:11:44 +0200 Subject: [PATCH] Petite maj --- GUI.cpp | 146 ++++++++++++++++++++++++++++---------------------------- GUI.hpp | 60 +++++++++++------------ 2 files changed, 103 insertions(+), 103 deletions(-) diff --git a/GUI.cpp b/GUI.cpp index 3c01c48..83373e9 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -1,73 +1,73 @@ - -#include "GUI.hpp" - -extern "C" -{ -#include -} - -void Script_GUI::Start() -{ - - vie = 3; - score = 0; - level = 1; - vulnerability = 0; - -} - -void Script_GUI::UpdateEverySecond() -{ - if(vulnerability > 0)vulnerability --; - else vulnerability = 0; -} - -void Script_GUI::Update() -{ - const unsigned char svie[]={0x6d, 0x93, 0x83, 0x45, 0x29, 0x11, }; - - ML_rectangle(105,0,127,63,1,ML_WHITE,ML_WHITE); - ML_line(104,0,104,63,ML_BLACK); - - PrintMini(107,7,"Score",0); - PrintV(107,15,score); - - if(vie > 0)ML_bmp_or(svie,105,30,7,6); - if(vie > 1)ML_bmp_or(svie,113,30,7,6); - if(vie > 2)ML_bmp_or_cl(svie,121,30,7,6); - - PrintMini(107,47,"Level",0); - PrintV(115,55,level); - -} - - -void Script_GUI::DelVie(int v) -{ - if(v < 0)return; - vie -= v; - - if(vie <= 0) - { - ML_clear_vram(); - PrintXY(25,28,"You Lose",0); - ML_display_vram(); - Sleep(1500); - GetEngine()->StopGame(); - } -} - -void Script_GUI::AddScore(int v) -{ - if(v > 0)score += v; -} - -void Script_GUI::SetVulnerability(int v) -{ - if( v > 0)vulnerability = v; -} - -int Script_GUI::GetVulnerability() -{ - return vulnerability; -} + +#include "GUI.hpp" + +extern "C" +{ +#include +} + +void Script_GUI::Start() +{ + + vie = 3; + score = 0; + level = 1; + vulnerability = 0; + +} + +void Script_GUI::UpdateEverySecond() +{ + if(vulnerability > 0)vulnerability --; + else vulnerability = 0; +} + +void Script_GUI::Update() +{ + const unsigned char svie[]={0x6d, 0x93, 0x83, 0x45, 0x29, 0x11, }; + + ML_rectangle(105,0,127,63,1,ML_WHITE,ML_WHITE); + ML_line(104,0,104,63,ML_BLACK); + + PrintMini(107,7,"Score",0); + PrintV(107,15,score); + + if(vie > 0)ML_bmp_or(svie,105,30,7,6); + if(vie > 1)ML_bmp_or(svie,113,30,7,6); + if(vie > 2)ML_bmp_or_cl(svie,121,30,7,6); + + PrintMini(107,47,"Level",0); + PrintV(115,55,level); + +} + + +void Script_GUI::DelVie(int v) +{ + if(v < 0)return; + vie -= v; + + if(vie <= 0) + { + ML_clear_vram(); + PrintXY(25,28,"You Lose",0); + ML_display_vram(); + Sleep(1500); + GetEngine()->StopGame(); + } +} + +void Script_GUI::AddScore(int v) +{ + if(v > 0)score += v; +} + +void Script_GUI::SetVulnerability(int v) +{ + if( v > 0)vulnerability = v; +} + +int Script_GUI::GetVulnerability() +{ + return vulnerability; +} diff --git a/GUI.hpp b/GUI.hpp index 8e16a33..17dde93 100644 --- a/GUI.hpp +++ b/GUI.hpp @@ -1,30 +1,30 @@ -#ifndef GUI -#define GUI - -#include "..\C-Engine\CHeader.hpp" - -class Script_GUI: public Script -{ - public: - - void Start(); - void Update(); - void UpdateEverySecond(); - - void DelVie(int v); - void AddScore(int v); - - void SetVulnerability(int v); - int GetVulnerability(); - - private: - - int score;//Sc: 0 - int vie;//Nb de vie - int level; - int vulnerability; - -}; - - -#endif +#ifndef GUI +#define GUI + +#include "..\C-Engine\CHeader.hpp" + +class Script_GUI: public Script +{ + public: + + void Start(); + void Update(); + void UpdateEverySecond(); + + void DelVie(int v); + void AddScore(int v); + + void SetVulnerability(int v); + int GetVulnerability(); + + private: + + int score;//Sc: 0 + int vie;//Nb de vie + int level; + int vulnerability; + +}; + + +#endif