씨샵 프로그래밍 텍스트RPG 12
본 자료는 6페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
해당 자료는 6페이지 까지만 미리보기를 제공합니다.
6페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

씨샵 프로그래밍 텍스트RPG 12에 대한 보고서 자료입니다.

본문내용

using System;
using System.Collections.Generic;
using System.Text;

namespace TextRpg
{
class BattleController
{
private Random mRand;

private int mGold;
private int mExp;

public BattleController()
{
mRand = new Random();
}
public void BattleLoop(Player player)
{
Console.Clear();
Monster monster = new Monster(this, "Goblin", 4, 1, 0, 10, 5); // 이름, 체력, 공격력, 방어력, 골드, 경험치

while (true)
{
Console.WriteLine("========== 전투 ==========");
monster.ShowData();
Console.WriteLine();
player.ShowData();
Console.WriteLine();

Console.WriteLine("1.공격");
Console.WriteLine("2.아이템 사용");
Console.WriteLine("3.도망");
Console.Write("커맨드를 입력하세요 >>>>> ");

string input = Console.ReadLine();
int command;

if (!int.TryParse(input, out command))
{
command = 0;
}

int itemIdex = -1;
switch ((eBattleCommand)command)
{
case eBattleCommand.Attack:
case eBattleCommand.Run:
break;
case eBattleCommand.UseItem:
itemIdex = player.SelectItem();
break;
default:
Console.WriteLine("잘못된 커맨드입니다");
continue;

키워드

  • 가격1,900
  • 페이지수19페이지
  • 등록일2021.12.10
  • 저작시기2021.12
  • 파일형식기타(pptx)
  • 자료번호#1159613
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니