Beispiel #1
0
        public override void Render(MyWindow window)
        {
            window.Draw(BackGround);
            window.Draw(Back);


            for (int i = 0; i < 5; i++)
            {
                window.Draw(Sav[i]);
            }
        }
Beispiel #2
0
        public override void Render(MyWindow window)
        {
            if (ObjectsBank.ParallelThread != null)
            {
                ObjectsBank.ParallelThread.Abort();
            }

            if (ObjectsBank.MovingThread != null)
            {
                ObjectsBank.MovingThread.Abort();
            }
            window.Close();// just close the window
        }
Beispiel #3
0
        public Menu(MyWindow window)
        {
            BackImage = new Texture("Res/Menu/Image.png");
            BackSite  = new Sprite(BackImage);
            settings  = new Settings(BackSite, this);
            newPlayer = new NewPlayer(this);
            loading   = new Loading(BackSite, this);


            NewGame = new Button(new Vector2f(20, 20), new Vector2f(250, 50), new Color(0, 250, 255), new Color(0, 152, 155), ObjectsBank.MyFont, "New Game", 30, newPlayer, 1);
            Load    = new Button(new Vector2f(20, 90), new Vector2f(250, 50), new Color(0, 250, 255), new Color(0, 152, 155), ObjectsBank.MyFont, "Load", 30, loading, 1);
            Options = new Button(new Vector2f(20, 160), new Vector2f(250, 50), new Color(0, 250, 255), new Color(0, 152, 155), ObjectsBank.MyFont, "Settings", 30, settings, 1);
            Exit    = new Button(new Vector2f(20, 230), new Vector2f(250, 50), new Color(0, 250, 255), new Color(0, 152, 155), ObjectsBank.MyFont, "Exit", 30, exit, 1);

            Load.AddingAdditionalFunction(loading.CheckFiles);// this always will check if thetre is a save
        }
Beispiel #4
0
        private void Onclose(object sender, EventArgs e)//need to add warning and save window
        {
            MyWindow window = (MyWindow)sender;

            if (ObjectsBank.ParallelThread != null)
            {
                ObjectsBank.ParallelThread.Abort();
            }

            if (ObjectsBank.MovingThread != null)
            {
                ObjectsBank.MovingThread.Abort();
            }

            window.Close();
        }
Beispiel #5
0
        public static float clockmeasure;        //
        static void Main(string[] args)
        {
            MyWindow window = new MyWindow(new VideoMode(1800, 900), "GAME");

            MenuObj = new Menu(window);

            ObjectsBank.LoadAll();// load all textures

            window.CheckSomeEents     = MenuObj.CheckEvents;
            window.RenderSomeElements = MenuObj.Render;
            window.SetFramerateLimit(120);

            ObjectsBank.ParallelThread = new Thread(ObjectsBank.EndlessFuncForThreadWithoutTime);
            ObjectsBank.ParallelThread.Start();

            ObjectsBank.MovingThread = new Thread(ObjectsBank.EndlassFuncForThreat);
            ObjectsBank.MovingThread.Start();

            while (window.IsOpen)
            {
                MyWindow.UpdateTickTAck();


                window.Clear();
                window.DispatchEvents();


                window.RenderSomeElements.Invoke(window);
                window.CheckSomeEents.Invoke(window);
                ObjectsBank.CheckInfoWindowList();

                ObjectsBank.CheckMouseLeftButton();

                window.Display();


                if (ObjectsBank.ClockPause == false)
                {
                    ObjectsBank.ElapsedTime += clock.ElapsedTime.AsSeconds();// everything based on time need to be connected with this variable
                }
                clock.Restart();
            }
        }// Main
Beispiel #6
0
 public override void CheckEvents(MyWindow window)// function for checking events
 {
 }
Beispiel #7
0
 public override void CheckEvents(MyWindow window)
 {
     // nothing to check
 }
Beispiel #8
0
 public override void CheckEvents(MyWindow window)
 {
 }
Beispiel #9
0
 public override void Render(MyWindow window)
 {
     window.Draw(BackSite);
     window.Draw(Back);
 }
Beispiel #10
0
        public abstract void Render(MyWindow window);// function for rendering all obiects

        public abstract void CheckEvents(MyWindow window);
Beispiel #11
0
 public abstract void Render(MyWindow window);// function for rendering all obiects