Jump to content
  • Advertisement

Bruno Filip

Member
  • Content Count

    36
  • Joined

  • Last visited

Community Reputation

153 Neutral

About Bruno Filip

  • Rank
    Member
  1. Bruno Filip

    XNA array problem

    Okay I fixed it, so basiclly I just had to remove else staments that restored CanGobla bools, and just set them to true, so  they are always true and if player will have collision with rectangle one variable will be set to false, and when no collision will take place bool will be back to true becouse its how it is in game1.cs , thanks:D
  2. Bruno Filip

    XNA array problem

    Okaay I made some changes now, here is my RectangleCollision class: static class RectangleCollision { public static bool TouchTop(this Rectangle oneRect, Rectangle anotherRect) { if (oneRect.Bottom >= (anotherRect.Top - 2) && // - 2 becouse they should not intersect becouse of bug issues oneRect.Top <= anotherRect.Top && oneRect.Left < anotherRect.Right && oneRect.Right > anotherRect.Left) { return true; } else return false; } public static bool TouchBot(this Rectangle oneRect, Rectangle anotherRect) { if (oneRect.Top <= (anotherRect.Bottom + 2) && // + 2 becouse they should not intersect becouse of bug issues oneRect.Bottom >= anotherRect.Bottom && oneRect.Left < anotherRect.Right && oneRect.Right > anotherRect.Left) { return true; } else return false; } public static bool TouchLeft(this Rectangle oneRect, Rectangle anotherRect) { if (oneRect.Top < anotherRect.Bottom && oneRect.Bottom > anotherRect.Top && oneRect.Right >= (anotherRect.Left - 2) && // - 2 becouse they should not intersect becouse of bug issues oneRect.Left < anotherRect.Left) { return true; } else return false; } public static bool TouchRight(this Rectangle oneRect, Rectangle anotherRect) { if (oneRect.Top <= anotherRect.Bottom && oneRect.Bottom >= anotherRect.Top && oneRect.Left <= (anotherRect.Right + 2) && // + 2 becouse they should not intersect becouse of bug issues oneRect.Right > anotherRect.Right) { return true; } else return false; } } and then In my player class I did this: public void Collision(Rectangle rect) { if (playerRectangle.TouchTop(rect)) CanGoBot = false; else CanGoBot = true; if (playerRectangle.TouchBot(rect)) CanGoTop = false; else CanGoTop = true; if (playerRectangle.TouchLeft(rect)) CanGoRight = false; else CanGoRight = true; if (playerRectangle.TouchRight(rect)) CanGoLeft = false; else CanGoLeft = true; } and last bit, in Game1.cs: foreach(Entity entity in entities) { player.Collision(entity.EntityRect); } And still my problem remains the same, Collision is working only with one rectangle... So how can I not reset values of those CanGoBot CanGoTop etc bools?  What should I do?
  3. Bruno Filip

    XNA array problem

    Well, It can, becouse we are on an Y axis.   The top of the Screen is 0 and bottom is idk lets say 1000.   lets say enemy.Rect.Bottom = 500; and enemy.Rect.Top = 450; (Top is less becouse we are on the Y axis, not X) So if player,Rect.Bottom is >= 450 && player.Rectangle.Top <= 50, Then that means, that if Player is going to move right or left, he will at some point intersect with enemyRectangle. The Collision logic is good, I made it working, My problem here is, as the  thread title says: Array problem. I have written everything above, and again, I am experiencing a strange thing.   Now I moved my CollisionLogic away from player or entity classes, I made a public static class RectangleCollision with static method called CollisionAmong() that takes 2 arguments -> 2 rectangles that might intersect, and then if they do the player wont be able to move. public static class RectangleCollision { public static void CollisionAmong(Rectangle oneRect, Rectangle anotherRect) { if (oneRect.Bottom >= (anotherRect.Top - 2) && // - 2 becouse they should not intersect becouse of bug issues oneRect.Top <= anotherRect.Top && oneRect.Left < anotherRect.Right && oneRect.Right > anotherRect.Left) { Player.CanGoBot = false; } else Player.CanGoBot = true; if (oneRect.Top <= (anotherRect.Bottom + 2) && // + 2 becouse they should not intersect becouse of bug issues oneRect.Bottom >= anotherRect.Bottom && oneRect.Left < anotherRect.Right && oneRect.Right > anotherRect.Left) { Player.CanGoTop = false; } else Player.CanGoTop = true; if (oneRect.Top < anotherRect.Bottom && oneRect.Bottom > anotherRect.Top && oneRect.Right >= (anotherRect.Left - 2) && // - 2 becouse they should not intersect becouse of bug issues oneRect.Left < anotherRect.Left) { Player.CanGoRight = false; } else Player.CanGoRight = true; if (oneRect.Top <= anotherRect.Bottom && oneRect.Bottom >= anotherRect.Top && oneRect.Left <= (anotherRect.Right + 2) && // + 2 becouse they should not intersect becouse of bug issues oneRect.Right > anotherRect.Right) { Player.CanGoLeft = false; } else Player.CanGoLeft = true; } } CollisionChecking on its own is correct, tested it a lot and was struggling with it for some time and I finally made it good, I like it the way it is now and I dont want to change it, it is not a problem.   The problem comes now:   As I said, In my Game1.cs class I made player and 2 things, barrier and enemy. Entity[] entites; protected override void Initialize() { player = new Player(50, 300); entites = new Entity[2]; entites[0] = new Entity("enemy",ObjectType.Enemy, 400, 300); // enemy entites[1] = new Entity("barrier", ObjectType.Object, 150, 200); // barrier DrawLowTxt = true; base.Initialize(); } and I will post this draw method here as well: protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.DimGray); spriteBatch.Begin(); map.DrawMap(spriteBatch); player.Draw(spriteBatch); foreach (Entity entity in entites) { entity.Draw(spriteBatch); } spriteBatch.End(); base.Draw(gameTime); }  Okay now everything works great, there are player barrier and enemy drawn. (and map but it has nothing to do with anything and is not  important right now).   So now, In  Game1.cs Update()method I call Collison() method. Collision method is a method in Game1.cs class which I want to have for Collision Checks, and now, my Collision() method looks like this: private void Collision() { RectangleCollision.CollisionAmong(player.playerRectangle, entities[0].EntityRect); // 1st statment RectangleCollision.CollisionAmong(player.playerRectangle, entities[1].EntityRect); // 2nd statemnt } As I said many times before, Now when I build and run my game, player will have Collision stuff with barrier only, not enemy cause barrier is on 2nd stament (as I said before, I dont know why but only second statement is executed in game, and 1st statment is not working <--- THIS IS THE PROBLEM).   Again, If that Collision method looked like this: private void Collision() { RectangleCollision.CollisionAmong(player.playerRectangle, entities[1].EntityRect); // now 1st stament is checking for collision with entities[1] RectangleCollision.CollisionAmong(player.playerRectangle, entities[0].EntityRect); // other way around than when it was like above } Now player will have Collision with enemy, not barrier, becouse, enemy is on 2nd stament, and Collision wont work on barrier.   I hope that now you guys can realize what is my problem, and maybe someone knows why this is happening :/
  4. Bruno Filip

    XNA array problem

    Okay, I have now made some changes, but the issue didnt get fixed. So first I will post code, this is the code from my Player class now public void CollisionWith(Rectangle anotherRect) { if (playerRectangle.Bottom >= (anotherRect.Top - 2) && // - 2 becouse they should not intersect becouse of bug issues playerRectangle.Top <= anotherRect.Top && playerRectangle.Left < anotherRect.Right && playerRectangle.Right > anotherRect.Left) { CanGoBot = false; } else CanGoBot = true; if (playerRectangle.Top <= (anotherRect.Bottom + 2) && // + 2 becouse they should not intersect becouse of bug issues playerRectangle.Bottom >= anotherRect.Bottom && playerRectangle.Left < anotherRect.Right && playerRectangle.Right > anotherRect.Left) { CanGoTop = false; } else CanGoTop = true; if (playerRectangle.Top < anotherRect.Bottom && playerRectangle.Bottom > anotherRect.Top && playerRectangle.Right >= (anotherRect.Left - 2) && // - 2 becouse they should not intersect becouse of bug issues playerRectangle.Left < anotherRect.Left) { CanGoRight = false; } else CanGoRight = true; if (playerRectangle.Top <= anotherRect.Bottom && playerRectangle.Bottom >= anotherRect.Top && playerRectangle.Left <= (anotherRect.Right + 2) && // + 2 becouse they should not intersect becouse of bug issues playerRectangle.Right > anotherRect.Right) { CanGoLeft = false; } else CanGoLeft = true; } and CanGoBot, CanGoTop, CanGoLeft and CanGoRight are normal public variablesdeclared in the beginning of the Player class.   Now in my Game1.cs I declare Entity[] entites array, and then Game1.cs Inizialize method looks like this: protected override void Initialize() { player = new Player(50, 300); entites = new Entity[2]; entites[0] = new Entity("enemy",ObjectType.Enemy, 400, 300); // enemy entites[1] = new Entity("barrier", ObjectType.Object, 150, 200); // barrier DrawLowTxt = false; base.Initialize(); } this is Game1.cs Update(): protected override void Update(GameTime gameTime) { if (Keyboard.GetState().IsKeyDown(Keys.Escape)) this.Exit(); player.Update(); Collision(); base.Update(gameTime); } and Collision method: private void Collision() { player.CollisionWith(entites[0].EntityRect); // 1st statment player.CollisionWith(entites[1].EntityRect); // 2nd stament } Now the Collision system is only applied to 2nd statment of Collision() method if I would switch array indexes of those 2 staments, the Collision will be applied only to the rectangle of an object thats on the 2nd stament, whatever the object is, and 1st statment will not be working :/   Draw() method works cause everything is drawn perfectly :/   So now there are no static variables or methods, so idk :/
  5. Bruno Filip

    XNA array problem

    I declared public static bools CanGoBot, top, right left in entity class, and used them for checking in player class if player can go bot then do this and so on,  and the bla bla part is not a problem, it is working good, the problem is the part above my last edit, somehow for some reason in game1.cs Collision method only the last code statement is executed, if I switch indexes as shown above, no matter what, only the 2nd statment in Collision method is going to be working in my game :/
  6. Bruno Filip

    XNA array problem

    Hi everyone, so there is this problem I have, and I dont know why it is happening.   So first off I made a class called Entity and I made entites array(images) with 2 elemetns Entity entites = new Entity[2] in my game1.cs, I also made collision detection system. So now In my Game1.cs class in Update() method I call a Collision() method, and a Collision() method goes like this: private void Collision() { entites[0].CollisionWithPlayer(player.playerRectangle); entites[1].CollisionWithPlayer(player.playerRectangle); } now when I run the game, Collision is not applied to entites[0], it is applied just to enitites[1], BUT private void Collision() { entites[1].CollisionWithPlayer(player.playerRectangle); // now enitites[1] is first and 0 is second, reversed as in code above entites[0].CollisionWithPlayer(player.playerRectangle); } Note that I have switched Array Indexes, And now when I build it and run the game, Collision is not applied to entites[1], it is applied just to enitites[0].   Why is that so, how can that be? How to fix this?   Thanks in advanced :/   Oh btw, here is my Coliision method in Entity Class, if it would be of any importance: public void CollisionWithPlayer(Rectangle playerRectangle) { if (blablabla) { CanGoBot = false; } else CanGoBot = true; if (blablabla) { CanGoTop = false; } else CanGoTop = true; if (blablabla) { CanGoRight = false; } else CanGoRight = true; if (blablabla) { CanGoLeft = false; } else CanGoLeft = true; }
  7. Bruno Filip

    Xna 2D Camera Problem

    IT IS FIXED. I simply had to remove this line from my Draw():  GraphicDevice.Clear(Color.White); Does anyone know if it is a right thing to remove this line completley from my game? Will it maybe produce some negative effects or no?
  8. Bruno Filip

    Xna 2D Camera Problem

    Thanks a lot for some explanations.   One weird thing yeh I forgot to put cam.Update(); in  my Game1.cs Update() method hahah, but after doing that the problem was still there.   Well and I replaced my code for camera update with yours, and I made one DrawHelper() function in my camera class which draws the position X and Y of my player, and camera uses right position values, so nothing wrong about that. graphics.PreferredBackBufferHeight = 600; graphics.PreferredBackBufferWidth = 800; This were my screen W & H, but I guess it doesn't matter now cause I use your Camera Update() now.   I will now guide you through my code creation:   1. I made an EntityAnimation class and putted all animation related stuff there - works fine. 2. I made a Player class, in which there is all logic about my player movement 3. I made Stats interface that contains Stamina class and does stamina-related stuff     and In my Game1.cs I draw stamina bar in seperate spriteBatch than the one that camera uses.(code in the post above)       So the stamina is shown, but the player is not. 4. After that Stats and Stamina I created Camera class, and well then the problem started, and well     if I put player.PlayerAnimation.PlayerDraw(spriteBatch); in DrawHud() I can see him, if it stays in spriteBatch that camera is in( in Draw() ),     then I dont. 5. Again, the player position that I am passing to cam.transform are correct, and I know this becouse I made one Draw method in Camera class that    outputs used player.position variables in a text, and they change when when I walk, and the start position is the same.   I dont know what else would be usefull information to you guys to help me. here is how my Camera class looks like right now: class Camera { protected float zoom; protected Matrix transform; protected Viewport viewport; public Matrix Transform { get { return transform; } set { transform = value; } } public Camera(Viewport viewport) { zoom = 1.0f; this.viewport = viewport; } public void Update() { transform = Matrix.CreateTranslation(-Player.playerPos.X, -Player.playerPos.Y, 0) * Matrix.CreateScale(zoom, zoom, 0) * Matrix.CreateTranslation(this.viewport.Width / 2, this.viewport.Height / 2, 0); } public void DrawHelpers(SpriteBatch sp) { sp.DrawString(StatManager.statMessage, "Player.X:" + Player.playerPos.X + "Player.Y:" + Player.playerPos.Y, new Vector2(50, 90), Color.Black); } } and again, I have camera Initialized and Updated in my Game1.cs, and well ofcourse Drawn xD but yeah I cant see nothing. :(   PS. I didnt copy those using  System.blabla  and  Microsoft.Xna.blabla  so the code would be shorter but it is there in my code ofc, Im looking forward your help, good people ;)
  9. Hy everyone, so I made this Camera class, and can't find nothing wrong with it, so please take a quick look at it: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; namespace Killer { class Camera { protected float zoom; protected Matrix transform; protected Viewport viewport; Vector2 center; public Matrix Transform { get { return transform; } set { transform = value; } } public Camera(Viewport viewport) { zoom = 1.0f; this.viewport = viewport; } public void Update() { // Center - center of window, with player in center of window, window size: 800x600 center = new Vector2(Player.playerPos.X + (EntityAnimation.rectangle.Width / 2) - 400, Player.playerPos.Y + (EntityAnimation.rectangle.Height / 2) - 300); // center.X = playerposition.X + frameWidth/2 - 400 // center.X = 100 + 24 - 400 // center.Y = playerposition.Y + frameHeight/2 - 300 // center.Y = 100 + 24 - 300 transform = Matrix.CreateScale(new Vector3(zoom, zoom, 0)) * Matrix.CreateTranslation(new Vector3(-center.X, -center.Y, 0)); } } } I putted some comments so you would know what values are at first when game is freshly run, now in my  Game1.cs (main XNA game file) I made a simple global variable: Camera cam; And in Game1.cs Initialize() method: cam = new Camera(GraphicsDevice.Viewport); and last but not least, here are my 2 draw methods in Game1.cs: protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.White); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, cam.Transform); // Player player.PlayerAnimation.PlayerDraw(spriteBatch); spriteBatch.End(); DrawHud(gameTime); base.Draw(gameTime); } protected void DrawHud(GameTime gameTime) { spriteBatch.Begin(); // Player Related Drawing -------------------------------------------------------------------- player.playerStamina.DrawStatHelpers(spriteBatch, gameTime); // Stamina Help Messages, also Player.X and Player.Y player.playerStamina.DrawBar(spriteBatch); // Stamina Health Bar //-------------------------------------------------------------------------------------------- spriteBatch.End(); } Now, when I build and run, I cant see my player, just my HUD, BUT if I put player.PlayerAnimation.PlayerDraw(spriteBatch); in DrawHud() I can see him.   I dont know what is wrong with my Camera, please help if you can :)
  10. Bruno Filip

    XNA coordinate drawing

    Okay now I added this DrawHud method, and: protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.CornflowerBlue); DrawHud(spriteBatch, gameTime); // calling DrawHud spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null,null, Cam.transform); spriteBatch.Draw(bckgndT, bckgndR, null, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 1); katrina.Draw(spriteBatch); if (HelpTxtVisible) spriteBatch.DrawString(font, ("X:" + katrina.position.X + "\nY:" + katrina.position.Y), new Vector2(katrina.position.X, katrina.position.Y - 70),Color.White); spriteBatch.End(); base.Draw(gameTime); } public void DrawHud(SpriteBatch spriteBatch2, GameTime gameTime) { spriteBatch2.Begin(SpriteSortMode.FrontToBack, BlendState.AlphaBlend); spriteBatch.DrawString(font, ("Test"), new Vector2(10, 10), Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0); spriteBatch2.End(); base.Draw(gameTime); } It works, the Text is always in 1 place, but my bckgnd image is on top of Test string, I messed around with layerdepth but cant get it right :/ ?
  11. Hy everyone, take a look at this pitcure please:   [attachment=32472:Screenshot_2.png]   Well how do I make my camera stop at where my map ends?   Here is my Camera class: using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Input; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Katrina { class Camera { public float scale = 1f; public Matrix transform; Viewport view; Vector2 centar; public Camera(Viewport _view) { view = _view; } public void Update(GameTime gameTime, Animated kat) { centar = new Vector2(kat.position.X + (kat.kR.Width / 2) - 400, kat.position.Y + (kat.kR.Height / 2) - 300); // kat is player transform = Matrix.CreateScale(new Vector3(scale, scale, 0)) * Matrix.CreateTranslation(new Vector3(-centar.X, -centar.Y, 0)); if(Keyboard.GetState().IsKeyDown(Keys.A)) { scale += 0.001f; }else if(Keyboard.GetState().IsKeyDown(Keys.D)) { scale -= 0.001f; } } } } So how could I make camera stop when I want it to stop, lets say top left corner x:0 y:0 is the last point it can show on the top left side :/
  12. Hy everyone.   I have this problem, I have a background pic that is like idk 1200 x 1600 an my xna window is lik idk 500 x 400 so this bckgnd pic is basiclly a small map for my game, and I made an animated sprite and camera that follows her anywhere on the map.   Now, I'm printing some helpful text that when I press tab I should see her coordinates on left top corner of my screen BUT here is the problem,  lets say I did something like this: spriteBatch.DrawString(font, ("X:" + katrina.position.X + "\nY:" + katrina.position.Y), new Vector2(10, 10),Color.White); Now ofcourse the text will always stay in that left top corner of the map, but not my window, cause If i move to like idk 1000x1000 my camera will be showing my player and I wont be able to see text thats on x:10, y:10   So my question is: How do I make this Helpful text always stay on top left corner of the window and not on specific coordinates of my 'map' :/ ?
  13. Bruno Filip

    XNA Menu release problem

    OKAY NEW POST:   I know my code looks bad so I cleaned it up a bit, and now the place where I should Unload Play and Quit button textures is here in my Game1 Draw() method that looks like this:  protected override void Draw(GameTime gameTime) { total_frames++; spriteBatch.Begin(); switch(currentGameState) { case GameState.MainMenu: { menu.Draw(spriteBatch); }break; case GameState.GamePlay: { GraphicsDevice.Clear(Color.CornflowerBlue); MediaPlayer.Stop(); menu = null; menu.Play.buttonTxd.Dispose(); menu.Quit.buttonTxd.Dispose(); recentAction("Shit cleaned up!"); } break; } spriteBatch.Draw(curTexture, cursorRect, Color.Red); DrawHelp(); spriteBatch.End(); base.Draw(gameTime); } So I have came to conclusion that no matter where in my code I want to dispose or set to null my Play or Quit button the game will always freeze, if GameState.GamePlay would look like this: case GameState.GamePlay: { GraphicsDevice.Clear(Color.CornflowerBlue); MediaPlayer.Stop(); menu = null; // menu.Play.buttonTxd.Dispose(); // no button // menu.Quit.buttonTxd.Dispose(); // disposal works fine whyyy? recentAction("Shit cleaned up!"); } break; then It would work perfectly, but I want to know why I cant clean those textures :( also putting texture disposal before menu = null; will do the same (Some might say: you set menu to null, garbage collector cleans it, it cant clean those textures then)   Why is that so that I can clean up my menu instance but can those textures that I loaded in menu class why can't I unload them, well actually I mean I probably can but what am I doing wrong here? 
  14. Hy everyone, so I've being trying to understand how can I release my Main Menu from memory and screen and so on when the game is started. So far I have done this, so in my Menu class I have a class called MenuButton and it looks like this: public class MenuButton { public Texture2D buttonTxd; public Rectangle buttonRect; public int ButtonHeight; public int ButtonWidth; public bool isClicked() { if (Game1.GetCursorRect().Intersects(buttonRect) && Mouse.GetState().LeftButton == ButtonState.Pressed) { return true; } else return false; } public bool isHovered() { if (Game1.GetCursorRect().Intersects(buttonRect)) { return true; } else return false; } } This is inside Menu class and Menu class also dosen't contain a constructor becouse I am mainly doing all the work inside Menu class.   Now after MenuButton class I create 2 new instances of that Class, one is called Play and one is called  Quit .    Then I have Initialize and Load Content functions, which yous initialize buttons and some Menu variables and well Load Content loads Textures soundEffect and a Song.   Now at the end of my Menu class I have these 3 functions:   // Menu Release public void Dispose() { Play = null; // Button Quit = null; // Button hButtonSnd = null; // Sound played when button is hovered GC.Collect(); } public bool isDefined(MenuButton mb1) // isDefined 1 arg { if (mb1 == null) { return false; } else return true; } public bool isDefined(MenuButton mb1, MenuButton mb2) // isDefined 2 args { if (mb1 == null || mb2 == null) { return false; } else return true; } Between that and Load Content() are ofcourse my Update and Draw methods, now here is an Update one: public void Update() { if((Play.isHovered() || Quit.isHovered()) && isDefined(Play, Quit)) // As you can see I also checked if // Play and Quit weren't null { if (EnableHoverSound) { hButtonSnd.Play(); EnableHoverSound = false; } } else EnableHoverSound = true; if (Play.isClicked()) { PlayGame = 1; MediaPlayer.Stop(); Dispose(); // Sets buttons and a sound to NULL and GC.Collect() } } Now ofcourse I have to show you some code from my Game1.cs file, at the beggining of Game1 I declare a new instance of Menu menu = new Menu();  ,called menu.Initialize() in Game1 Initialize method and also menu.LoadContent(Content), in LoadContent() method, and now this is how my Game1 Update() looks like: protected override void Update(GameTime gameTime)         {             if (menu.PlayGame == 1) // this is the same as menu.Play.isClicked()             {                 if (fade.A == 1) // related to cursor fading if Play is clicked                     fade.A++;                 else fade.A--;             }               elapsed_time += (float)gameTime.ElapsedGameTime.TotalMilliseconds;             if (elapsed_time >= 1000.0f)             {                 fps = total_frames;                 total_frames = 0;                 elapsed_time = 0;             }               if (menu.Quit.isClicked() && menu.isDefined(menu.Quit) || Keyboard.GetState().IsKeyDown(Keys.Escape))             {                 this.Exit();                 MediaPlayer.Stop();             }             cursorRect = new Rectangle(Mouse.GetState().X, Mouse.GetState().Y, curText.Width, curText.Height);               if (menu.isDefined(menu.Play, menu.Quit))             {                 menu.Update();             }             base.Update(gameTime);        } And finally I have to show you just my Draw() method here: protected override void Draw(GameTime gameTime) { total_frames++; GraphicsDevice.Clear(fade); spriteBatch.Begin(); if (menu.isDefined(menu.Play, menu.Quit)) { menu.Draw(spriteBatch); } spriteBatch.Draw(curText, cursorRect, fade); DrawHelp(); spriteBatch.End(); base.Draw(gameTime); } Now after showing you all this code here is what my game does:   1.I enter the game, I hear my Song playing, all good 2. I hover my Play and Quit buttons and they play a sound like they should 3. If I Click Quit button the game will quit 4. If I Click Play button The Song will stop, sounds also, no more Play and Quit buttons thats what I want, BUT THEN THE GAME FREEZES I cant move moouse cursor, it wont minimize, I have to do Start + L to get to that chose user Screen to get back in and shut the thing with taskmgr.exe   This might be a long post but I wanted to post all relevant code so that some good guys could just read it quickly and say aha here is your mistake. Hahah, thanks in advanced :)
  15. Bruno Filip

    XNA Width And Height Problem

    Thanks everyone  ^_^
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!