프로그래밍/콘솔프로젝트10 TextRpgGame <최종> namespace TextRpgTest { internal class INFO { public string m_name; public int m_attack; public int m_hp; } } namespace TextRpgTest { internal class Player { INFO pInfo; public void SetDamage(int damage) { pInfo.m_hp -= damage; } public void SetHp(int hp) { pInfo.m_hp = hp; } public INFO GetInfo() { return pInfo; } public int num; public void SelectJob() { pInfo = new INFO(); Console.WriteLine(".. 2023. 7. 11. ShootingGame <최종> using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; namespace ShootingGame { // 미사일 클래스 public class Bullet { public int x; public int y; public bool fire; } // 플레이어 클래스 public class Player { [DllImport("msvcrt.dll")] static extern int _getch(); //c언어 함수 가져옴 public int playerX; //플레이어 X좌표 public.. 2023. 7. 4. TextRpgGame Ver.2 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace TextRpgGame { public class Player { public INFO m_tInfo; //데미지를 입는 함수 public void SetDamage(int iAttack) { m_tInfo.iHp -= iAttack; } //플레이어 정보를 외부에서 볼수있는 함수 public INFO GetInfo() { return m_tInfo; } //hp를 다시 설정해주는 함수 public void SetHp(int iHp) { m_tInfo.iHp = iHp; } publi.. 2023. 7. 4. TextRpgGame Ver.1 클래스 공부를 위한 -> 구조 공부 namespace TextRpgGame02 { internal class Program { static void Main(string[] args) { MainGame mainGame = new MainGame(); //게임을 실행 시키기 위해 mainGame.Initialize(); mainGame.Progress(); } } } namespace TextRpgGame02 { internal class Info { //필요 정보 //이름, 공격력, hp public string name; public int attack; public int hp; } } // 플레이어 선택을 위한 namespace TextRpgGame02 { //직업 선택을 위함 internal c.. 2023. 6. 29. 이전 1 2 다음 728x90