Beispiel #1
0
 public override void OnKeyboardDown(CGameEngine game, KeyboardEventArgs e)
 {
     switch (e.Key) {
         case Key.Escape:
         case Key.Q:
             Events.QuitApplication();
             break;
         case Key.UpArrow:
             m_CurrentMap.Avatar.moveup = true;
             break;
         case Key.DownArrow:
             m_CurrentMap.Avatar.movedown = true;
             break;
         case Key.LeftArrow:
             m_CurrentMap.Avatar.moveleft = true;
             break;
         case Key.RightArrow:
             m_CurrentMap.Avatar.moveright = true;
             break;
         case Key.F5:
             Video.Screen.SaveBmp("screenshot.bmp");
             break;
         case Key.Backspace:
             for (int i = 0; i < 10; i++)
                 m_CurrentMap.Actors.AddLast(new CActorCivilian(m_CurrentMap, 26, 13));
             m_CurrentMap.Actors.AddLast(new CActorMonster(m_CurrentMap, 15, 15));
             break;
         case Key.Space:
             int top = m_CurrentMap.Avatar.Top;
             int left = m_CurrentMap.Avatar.Left;
             m_CurrentMap.Weapons.AddLast(new CActorBullet(m_CurrentMap, left, top, m_CurrentMap.Avatar.Direction));
             break;
     }
 }
Beispiel #2
0
 public override void Update(CGameEngine game)
 {
     if (fader.Alpha > 0) {
         fader.Alpha = (byte)(fader.Alpha - 1);
         fader.AlphaBlending = true;
     }
 }
Beispiel #3
0
 public override void OnKeyboardDown(CGameEngine game, KeyboardEventArgs e)
 {
     switch (e.Key) {
         case Key.Escape:
         case Key.Q:
             Events.QuitApplication();
             break;
         case Key.Space:
             game.ChangeState(CPlayState.Instance());
             break;
     }
 }
Beispiel #4
0
 public override void OnKeyboardUp(CGameEngine game, KeyboardEventArgs e)
 {
     switch (e.Key) {
         case Key.UpArrow:
             m_CurrentMap.Avatar.moveup = false;
             break;
         case Key.DownArrow:
             m_CurrentMap.Avatar.movedown = false;
             break;
         case Key.LeftArrow:
             m_CurrentMap.Avatar.moveleft = false;
             break;
         case Key.RightArrow:
             m_CurrentMap.Avatar.moveright = false;
             break;
     }
 }
Beispiel #5
0
 static void Main(string[] args)
 {
     CGameEngine.run(new WinServerStart());
 }
Beispiel #6
0
 public virtual void Update(CGameEngine game)
 {
 }
Beispiel #7
0
 public virtual void OnMouseMotion(CGameEngine game, MouseMotionEventArgs e)
 {
 }
Beispiel #8
0
 public virtual void OnMouseButtonDown(CGameEngine game, MouseButtonEventArgs e)
 {
 }
Beispiel #9
0
 public virtual void OnKeyboardUp(CGameEngine game, KeyboardEventArgs e)
 {
 }
Beispiel #10
0
 public virtual void Draw(CGameEngine game)
 {
 }
Beispiel #11
0
 public override void Draw(CGameEngine game)
 {
     Video.Screen.Blit(bg);
     if (fader.Alpha != 0)
         Video.Screen.Blit(fader);
 }
Beispiel #12
0
 public override void Draw(CGameEngine game)
 {
     Video.Screen.Fill(Color.White);
     m_CurrentMap.Draw(Video.Screen, Video.Screen.Rectangle);
 }
Beispiel #13
0
 public override void Update(CGameEngine game)
 {
     m_CurrentMap.Update();
 }