Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Geoffry_the_Deprogrammer

Pages: [1]
1
yeah, im not entirely sure what is and is not required... last time i posted a question i added too much code... im not sure how to gauge how much I need to show... none of my variables are null... im not entirely sure what the error message im getting actually means, even after hours of searching on the internet... i cant figure out what the error is...

2
is this sufficient...?

            if (correctLetter1 == true)
            {
                game.GatesCleared += 1;
            }

3
I am attempting to pass a integer variable into another class, and get it to increase on a condition, the code itself doesn't seem to have any problem, until I run the program, at which point I am met with the error "Object reference not set to an instance of an object" does anyone know what I might be doing wrong...?

4
General / Re: Trying to Figure out how to show a new Window
« on: November 04, 2014, 10:03:14 pm »
thanks, yeah, it was just the missing bracket... I should probably be more observant of my own code... Thanks for the help...  :)

5
General / Re: Trying to Figure out how to show a new Window
« on: November 03, 2014, 11:18:42 am »
yeah, i realise that, I were just Trying to replicate my earlier code for the first window, and yeah, sorry its not minimal, but im really not sure where i should be looking as I have no idea what im doing wrong...

6
General / Re: Trying to Figure out how to show a new Window
« on: November 03, 2014, 10:58:36 am »
does this help at all...?

public static class Program
    {
        private static bool isFullScreen = false;
        public static VideoMode screenRes = new VideoMode(400, 300);

        private static Game game;
        public static Game Game
        {
            get { return game; }
        }

        private static Encryption encryption;
        public static Encryption Encryption
        {
            get { return encryption; }
        }

        private static RenderWindow window;
        public static RenderWindow Window
        {
            get { return window; }
            set { window = value; }
        }

        private static RenderWindow windowencryipt;
        public static RenderWindow WindowEncyript
        {
            get { return windowencryipt; }
            set { windowencryipt = value; }
        }


        private static DateTime previousTick;
        public static DateTime PreviousTick
        {
            get { return previousTick; }
        }

        private static TimeSpan tickLength;
        /// Length of time between each update call
        /// </summary>
        public static TimeSpan TickLength
        {
            get { return tickLength; }
        }

        private static int fps;
        public static int FPS
        {
            get { return fps; }
        }

        private static float delta;

        static void Main(string[] args)
        {

            //Window = new RenderWindow(VideoMode.DesktopMode, "0", Styles.Fullscreen);
            game = new Game();
            encryption = new Encryption();
            if (isFullScreen)
            {
                screenRes = VideoMode.DesktopMode;
                window = new RenderWindow(screenRes, "0", Styles.Fullscreen);
                windowencryipt = new RenderWindow(screenRes, "0", Styles.Fullscreen);
            }
            else
                window = new RenderWindow(screenRes, "0", Styles.Default);
            windowencryipt = new RenderWindow(screenRes, "0", Styles.Default);

            WindowEncyript.Closed += new EventHandler(Exit);
            WindowEncyript.SetVerticalSyncEnabled(true);
            Window.Closed += new EventHandler(Exit);
            Window.SetVerticalSyncEnabled(true);

            SetFPS(60);
            Assets.Initialize();
            Game.Initialize();
            Encryption.Initialize();

            while (Window.IsOpen())
            {
                if (PreviousTick.Add(TickLength) <= DateTime.Now)
                {
                    Update();
                    Draw();
                }
            }

            while (WindowEncyript.IsOpen())
            {
                if (PreviousTick.Add(TickLength) <= DateTime.Now)
                {
                    Update();
                    Draw();
                }
            }
        }

        private static void Draw()
        {
            Window.Clear(Color.White);
            Game.Draw(Window, delta);
            Window.Display();

            WindowEncyript.Clear(Color.White);
            Encryption.Draw(WindowEncyript, delta);
            WindowEncyript.Display();

            //if (Game.Test == true)
            //{
            //    WindowEncyript.Display();
            //    //Window.Close();
            //}
            //Window.Display();
        }

        private static void Update()
        {
            // Launch all events
            Window.DispatchEvents();
            WindowEncyript.DispatchEvents();
            //Calculate delta time
            delta = (float)DateTime.Now.Subtract(previousTick).TotalSeconds;

            Game.Update(window, delta);
            Encryption.Update(windowencryipt, delta);

            previousTick = DateTime.Now;

            if (Keyboard.IsKeyPressed(Keyboard.Key.Escape))
                window.Close();
            windowencryipt.Close();
        }

        public static void Exit(object obj, EventArgs args)
        {
            Window.Close();
            WindowEncyript.Close();
        }

7
General / Re: Trying to Figure out how to show a new Window
« on: November 03, 2014, 09:53:52 am »
yeah, sorry, Im no good at communication with Humans, nonetheless I have attempted to make the question more simple, though I think ive just made it worse...

8
General / Trying to Figure out how to show a new Window
« on: November 02, 2014, 11:04:13 pm »
I am using SFML in C# and am having difficulties figuring out how to Display a second window in my program, there are no errors obvious with the code, as it runs fine, however it does not display the second window when commanded... I have no idea why, and I cant see any obvious issues having tried replicating the code for the first window...

If anyone has any idea what I might be doing wrong, or can tell me what I should try doing that would be much appreciated...  :)

9
General / Help with understanding the tutorials
« on: October 26, 2014, 12:47:18 am »
Im attemting to use SFML in C# (because windows 8 cant run XNA) however because of this the tutorials are difficult to understand as i have no experience in C++, most of all, all the tutorials refer to "sf::" what does this actually mean, and is there a similar method i could use instead...?

10
I apologise if this is difficult to make sense of, but i am having immense difficulty figuring out how to use spritesheets, as I am currently trying to take a portion of the spritesheet and make that the player sprite, however, i cannot figure out how to set a portion of an image as the sprite... thanks for any and all help...

11
Graphics / How do I use Spite Sheets to animate something in C# SFML
« on: September 05, 2014, 04:47:34 am »
I've created a sprite sheet, but I haven't got a clue as to how i'm supposed to implement it into my game, and all the Tutorials are for C++, thanks for any and all help...

12
General / why am I getting an error on Void...?
« on: August 27, 2014, 08:36:19 am »
it says "expected class, delegate, enum, interface, or struct" It was working before, I could have accidentally deleted something, but its Unlikely... I have no idea what this means... here is my code...


        public void Draw(RenderWindow window, float delta)
        {
            window.Draw(background);
            window.Draw(player);
            window.Draw(enemy);
            window.Draw(dead);

        }
    }

13
General / Re: im completely lost on Camera movement in SFML C#
« on: August 25, 2014, 12:15:49 am »
In your update method, do:

 
                if (Keyboard.IsKeyPressed(Keyboard.Key.W))
                {
                    View view = window.GetView();
                    view.Move(new Vector2f(0, -1));
                    window.SetView(view);
                }

Remember to set the modified view for window!

Thanks, this makes sense...   :)

14
General / im completely lost on Camera movement in SFML C#
« on: August 22, 2014, 04:39:47 am »
I cant seem to figure out how to make the camera move, ive read tutorials etc. and im lost... if i simply wanted to move the camera up, upon the press of the "W" key, what code do i need, and which class should i put it in...?

Pages: [1]
anything