I have this warning in my code, i dont know which part of it need to change ...
It keeps give me this warning message :
here is my code:
Expand|Select|Wrap|Line Numbers
- /* hero.h */
- #ifndef _HERO_H_
- #define _HERO_H_
- #include <iostream>
- #include <string>
- #include "screen.h"
- #include "terrain.h"
- namespace Game {
- using namespace std;
- class Hero{
- public:
- Hero(){
- posX = 2;
- posY = 2;
- health = 100;
- scr.setStatus("Health : 100%");
- }
- int getHealth(){
- return health;
- }
- bool testAlive(){
- if(health==0){
- return false;
- }else{
- return true;
- }
- }
- void moving(){
- char c;
- system("stty raw -echo");
- cin.get(c);
- system("stty raw -echo");
- if(c=='u' || c=='U'){
- if(terr.Move(posX,posY-1)==true){
- posY = posY - 1;
- health = health - 1;
- }else{
- health = health - 5;
- scr.setStatus("You ran into a Wall!");
- scr.Beep();
- }
- }else if(c=='d' || c=='D'){
- if(terr.Move(posX,posY-1)==true){
- posY = posY + 1;
- health = health - 1;
- }else{
- scr.setStatus("You ran into a Wall!");
- scr.Beep();
- health = health - 5;
- }
- }else if(c=='r' || c=='R'){
- if(terr.Move(posX,posY-1)==true){
- posX = posX + 1;
- health = health - 1;
- }else{
- scr.setStatus("You ran into a Wall!");
- scr.Beep();
- health = health - 5;
- }
- }else if(c=='l' || c=='L'){
- if(terr.Move(posX,posY-1)==true){
- posX = posX - 1;
- health = health - 1;
- }else{
- scr.setStatus("You ran into a Wall!");
- scr.Beep();
- health = health - 5;
- }
- }
- }
- void DrawHero(){
- scr.Insert(posX,posY,'H');
- }
- private:
- int posX;
- unsigned posY;
- unsigned health;
- Screen scr;
- Terrain terr;
- };
- }
- #endif