예제 #1
0
 /// <summary>
 /// constructor
 /// </summary>
 public GameView(EventManager eventManager)
 {
     if (eventManager == null)
     {
         throw new ArgumentNullException("eventManager");
     }
     eventManager.OnMapBuiltEvent += new EventHandler<MapBuiltEventArgs>(Subscribe);
     eventManager.OnEntityPlaceEvent += new EventHandler<EntityPlaceEventArgs>(Subscribe);
     eventManager.OnEntityMoveEvent += new EventHandler<EntityMoveEventArgs>(Subscribe);
     Events.Tick += new EventHandler<TickEventArgs>(this.Tick);
     Events.Quit += new EventHandler<QuitEventArgs>(this.Quit);
     this.width = 424;
     this.height = 440;
     this.backSprites = new ArrayList();
     this.frontSprites = new ArrayList();
     if (File.Exists(Path.Combine(dataDirectory, "boing.wav")))
     {
         filePath = "";
     }
     try
     {
         this.sound = new Sound(Path.Combine(filePath, Path.Combine(dataDirectory, "boing.wav")));
     }
     catch (SdlException)
     {
         // Linux audio problem
     }
 }
예제 #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="eventManager"></param>
 public Game(EventManager eventManager)
 {
     this.gameStatus = GameStatus.Preparing;
     this.eventManager = eventManager;
     this.players = new ArrayList();
     this.players.Add(new Player(eventManager));
     this.map = new Map(eventManager);
 }
예제 #3
0
 public static void Run()
 {
     //if (CheckInstance() == null)
     //{
     EventManager eventManager = new EventManager();
     InputController inputController =
         new InputController(eventManager);
     Game game = new Game(eventManager);
     game.Start();
     inputController.Go();
     //}
 }
예제 #4
0
 /// <summary>
 /// constructor
 /// </summary>
 public Player(EventManager eventManager)
 {
     this.entityList = new ArrayList();
     this.entityList.Add(new Entity(eventManager));
 }
예제 #5
0
파일: Map.cs 프로젝트: erin100280/Zelda.NET
 /// <summary>
 /// 
 /// </summary>
 /// <param name="eventManager"></param>
 public Map(EventManager eventManager)
 {
     this.eventManager = eventManager;
     this.sectors = new Sector[9];
 }
예제 #6
0
 /// <summary>
 /// constructor
 /// </summary>
 public InputController(EventManager eventManager)
 {
     this.eventManager = eventManager;
 }