示例#1
0
        public MainForm()
        {
            InitializeComponent(); // The InitializeComponent() call is required for Windows Forms designer support.
            InitDisplay(); //Set se Resolution
            EstablishConnection();

            Map = new Map();
            SideMenu = new SideMenu();

            //Map
            this.Controls.Add(Map.FrameLabel);
            Map.FrameLabel.BringToFront();
            Map.FrameLabel.MouseUp += OnMoveMap;
            Map.FrameLabel.MouseDown += OnMoveMap;
            Map.RedrawImage();
            //Places
            Places = new Locations(SendMoveRequest);
            InitControlGroup(Places.Menu);
            foreach(Place p in Places.AllPlaces.Values)
            {
                this.Controls.Add(p.ClickLabel);
                p.ClickLabel.Parent = Map.FrameLabel;
                p.ClickLabel.BringToFront();
            }
            OnMoveMap(Map.FrameLabel, new MouseEventArgs(MouseButtons.None, 0, 0, 0, 0));
            Map.FrameLabel.MouseDown += delegate
            {
                foreach (Place p in Places.AllPlaces.Values)
                    p.ClickLabel.Visible = false;
            };

            //Players
            UpdatePlayerLocation();

            //Sidemenu
            InitControlGroup(SideMenu);
            SideMenu.Visible = true;
            foreach (RelativeLabel c in SideMenu.Controls)
                c.Click += SideMenuButtonClick;
            InitControlGroup(SideMenu.LogMenu);

            //FIXME: debug... REMOVE!
            Quests[0] = new Quest("Quest 1", new int[2] {1,2},new Resources(2,3,1,4),2,3,new Item[0]);
            Quests[1] = new Quest("Quest 1", new int[2] {1,2},new Resources(2,3,1,4),2,3,new Item[0]);
            Quests[2] = new Quest("Quest 1", new int[2] {1,2},new Resources(2,3,1,4),2,3,new Item[0]);
            //END
        }
示例#2
0
文件: Game1.cs 项目: Wertix/poksy
        protected override void Initialize()
        {
            graphics.PreferredBackBufferWidth = 800;
            graphics.PreferredBackBufferHeight = 600;
            graphics.IsFullScreen = false;
            graphics.ApplyChanges();
            Window.Title = Title;
            map = new Map();
            map.ReadSpriteData(); //wczytaj plik spritedata
            map.DrawData(); //losuj dane
            player = new Player();
            viewport = new MyViewport();

            player.pos_x = 6;
            player.pos_y = 6;
            player.direction = 1;

            viewport.Width = 800;
            viewport.Height = 600;
            viewport.Pos_X = 0;
            viewport.Pos_Y = 0;
            base.Initialize();
        }
示例#3
0
 public Form1()
 {
     InitializeComponent();
     map = new Map(10);
     myTank = new Tank(new Parser(map));
 }
示例#4
0
 public Parser(Map map)
 {
     this.map = map;
 }