목차
I. 서론
II. 본론
▷ 게임 구성
▷ 게임 실행
III. 결론
▷ 참고문헌
▷ 전체소스
II. 본론
▷ 게임 구성
▷ 게임 실행
III. 결론
▷ 참고문헌
▷ 전체소스
본문내용
{
static class Program
{
static void Main(string[] args)
{
using (Game1 game = new Game1())
{
game.Run();
}
}
}
}
⑧Ending 소스
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace KeroroGame
{
public class Ending : Microsoft.Xna.Framework.DrawableGameComponent
{
GameObject m_Bg;
int W = 1024;
int H = 768;
GameObject m_Bg2;
GameObject m_BeforeButton;
Rectangle m_RectBefore = new Rectangle(460, 700, 100, 40);
Rectangle m_RectMouse = new Rectangle(0, 0, 4, 4);
MouseState premouseState = Mouse.GetState();
GameObject Font;
int m_Mill;
int m_Sec;
int m_Min;
int m_Energy;
bool m_Good;
public Ending(Game game, int Mill, int Sec, int Min, int Energy, bool Good)
: base(game)
{
m_Mill = Mill;
m_Sec = Sec;
m_Min = Min;
m_Energy = Energy;
m_Good = Good;
}
public override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
m_Bg = new GameObject(base.Game.Content.Load("EndingImage/Good"));
m_BeforeButton = new GameObject(base.Game.Content.Load("GameControl/ControlEnd"));
Font = new GameObject(base.Game.Content.Load("Font/Font1"));
m_Bg2 = new GameObject(base.Game.Content.Load("EndingImage/Bad"));
base.LoadContent();
}
public override void Update(GameTime gameTime)
{
MouseState mouseState = Mouse.GetState();
m_RectMouse.X = Mouse.GetState().X;
m_RectMouse.Y = Mouse.GetState().Y;
if (m_RectMouse.Intersects(m_RectBefore) && (mouseState.LeftButton == ButtonState.Pressed && premouseState.LeftButton == ButtonState.Released))
{
base.Game.Components.RemoveAt(0);
base.Game.Components.Add(new MainMenu(base.Game));
}
premouseState = mouseState;
base.Update(gameTime);
}
public override void Draw(GameTime gameTime)
{
SpriteBatch spriteBatch = new SpriteBatch(base.Game.GraphicsDevice);
spriteBatch.Begin();
if (m_Good == true)
{
spriteBatch.Draw(m_Bg.sprite, new Rectangle(0, 0, W, H), Color.White);
if (m_RectMouse.Intersects(m_RectBefore))
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.Blue);
}
else
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.White);
}
spriteBatch.DrawString(Font.font, "PlayTime = " + m_Min.ToString() + " : " + m_Sec.ToString() + " : " + m_Mill.ToString(), new Vector2(650, 50), Color.Black);
spriteBatch.DrawString(Font.font, "MoveBack = " + (3 - m_Energy).ToString(), new Vector2(650, 110), Color.Black);
}
else
{
spriteBatch.Draw(m_Bg2.sprite, new Rectangle(0, 0, W, H), Color.White);
if (m_RectMouse.Intersects(m_RectBefore))
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.Blue);
}
else
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.White);
}
}
spriteBatch.End();
}
}
}
static class Program
{
static void Main(string[] args)
{
using (Game1 game = new Game1())
{
game.Run();
}
}
}
}
⑧Ending 소스
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
namespace KeroroGame
{
public class Ending : Microsoft.Xna.Framework.DrawableGameComponent
{
GameObject m_Bg;
int W = 1024;
int H = 768;
GameObject m_Bg2;
GameObject m_BeforeButton;
Rectangle m_RectBefore = new Rectangle(460, 700, 100, 40);
Rectangle m_RectMouse = new Rectangle(0, 0, 4, 4);
MouseState premouseState = Mouse.GetState();
GameObject Font;
int m_Mill;
int m_Sec;
int m_Min;
int m_Energy;
bool m_Good;
public Ending(Game game, int Mill, int Sec, int Min, int Energy, bool Good)
: base(game)
{
m_Mill = Mill;
m_Sec = Sec;
m_Min = Min;
m_Energy = Energy;
m_Good = Good;
}
public override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
m_Bg = new GameObject(base.Game.Content.Load
m_BeforeButton = new GameObject(base.Game.Content.Load
Font = new GameObject(base.Game.Content.Load
m_Bg2 = new GameObject(base.Game.Content.Load
base.LoadContent();
}
public override void Update(GameTime gameTime)
{
MouseState mouseState = Mouse.GetState();
m_RectMouse.X = Mouse.GetState().X;
m_RectMouse.Y = Mouse.GetState().Y;
if (m_RectMouse.Intersects(m_RectBefore) && (mouseState.LeftButton == ButtonState.Pressed && premouseState.LeftButton == ButtonState.Released))
{
base.Game.Components.RemoveAt(0);
base.Game.Components.Add(new MainMenu(base.Game));
}
premouseState = mouseState;
base.Update(gameTime);
}
public override void Draw(GameTime gameTime)
{
SpriteBatch spriteBatch = new SpriteBatch(base.Game.GraphicsDevice);
spriteBatch.Begin();
if (m_Good == true)
{
spriteBatch.Draw(m_Bg.sprite, new Rectangle(0, 0, W, H), Color.White);
if (m_RectMouse.Intersects(m_RectBefore))
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.Blue);
}
else
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.White);
}
spriteBatch.DrawString(Font.font, "PlayTime = " + m_Min.ToString() + " : " + m_Sec.ToString() + " : " + m_Mill.ToString(), new Vector2(650, 50), Color.Black);
spriteBatch.DrawString(Font.font, "MoveBack = " + (3 - m_Energy).ToString(), new Vector2(650, 110), Color.Black);
}
else
{
spriteBatch.Draw(m_Bg2.sprite, new Rectangle(0, 0, W, H), Color.White);
if (m_RectMouse.Intersects(m_RectBefore))
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.Blue);
}
else
{
spriteBatch.Draw(m_BeforeButton.sprite, m_RectBefore, Color.White);
}
}
spriteBatch.End();
}
}
}
추천자료
교육과정 재구성과 교육과정 재구성의 필요성
캐릭터 산업에 대한 개념적 이해와 국내 캐릭터 산업 현황
[캐릭터산업][캐릭터상품]국내외 캐릭터 산업의 현황과 전망 및 캐릭터상품의 향후 경쟁력 제...
문화산업, 멀티미디어산업과 캐릭터, 캐릭터와 캐릭터산업, 캐릭터 유형,종류, 캐릭터 효용성...
[캐릭터][캐릭터산업][캐릭터상품]캐릭터산업의 정의, 캐릭터의 분류, 캐릭터의 기능, 캐릭터...
범죄의 재구성
식품구성탑 영양교육 수업지도안(편식은 NO!!! 골고루 먹어요.)
[엔터테인먼트산업][엔터테인먼트]엔터테인먼트산업의 특성과 엔터테인먼트산업의 구성요소, ...
[교육원리][교육원리와 자연주의][교육원리와 구성주의][교육자치][교육제도][교육개혁]교육...
[교수설계][문학교육][직업교육][자기조절학습][웹기반가상수업]교수설계 개념, 교수설계 기...
[고소설][고전소설]고소설(고전소설)과 동화, 고소설(고전소설)과 영화, 고소설(고전소설)과 ...
과학수업을 이끌어 나갈 때 구성학습을 위한 교사의 역할에 대해 구체적인 설명과 더불어 본...
소개글