Created
July 22, 2012 15:00
-
-
Save Bocom/3159917 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public override void HandleInput(GameTime gameTime) | |
| { | |
| if (InputManager.IsActionTriggered(InputManager.Action.GameMenu)) | |
| ScreenManager.AddScreen(new PauseMenuScreen()); | |
| else | |
| { | |
| // input logic | |
| } | |
| } | |
| public override void Update(GameTime gameTime, bool otherScreenHasFocus, | |
| bool coveredByOtherScreen) | |
| { | |
| if (!coveredByOtherScreen || !otherScreenHasFocus) | |
| { | |
| camera.Update(gameTime); | |
| map.Update(gameTime, camera, World.Player.CollisionBounds); | |
| World.Player.Update(gameTime, map); | |
| foreach (Entity ent in entities) | |
| { | |
| ent.Update(gameTime, map); | |
| if (World.Player.InEntityCollisionRange(ent)) | |
| { | |
| World.Player.ResolveEntityCollision(map, ent); | |
| } | |
| /*if (World.Player.InActivationRange(ent)) | |
| Console.WriteLine("ACTIVATE!");*/ | |
| } | |
| drawOrder.Sort(delegate(Entity e1, Entity e2) | |
| { | |
| return -e1.Position.Y.CompareTo(e2.Position.Y); | |
| }); | |
| Portal p; | |
| if (World.Player.PortalCollision(map, out p)) | |
| ChangeMap(p); | |
| } | |
| base.Update(gameTime, otherScreenHasFocus, coveredByOtherScreen); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment