Exemplo n.º 1
0
 public SolidBrick(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateSolidBrick();
     MyGame.Sprite = Sprite;
     this.Location = location;
 }
Exemplo n.º 2
0
 public HealPack()
 {
     sprite   = SpriteFactory.CreateSprite(this.GetType());
     heal     = 10;
     position = new Vector2(50, 50);
     Physics  = new Physics(new Vector2(0, -1), new Vector2(0, 0.1f));
 }
Exemplo n.º 3
0
 public HighPipe(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateHighPipe();
     MyGame.Sprite = Sprite;
     this.Location = location;
 }
        public override void OnPress(int key)
        {
            game.RemoveSprite(game.BlockBrick);
            game.RemoveSprite(game.BlockHidden);
            game.RemoveSprite(game.BlockItem);
            game.RemoveSprite(game.BlockQuestion);
            game.RemoveSprite(game.BlockUsed);
            game.RemoveSprite(game.Mushroom);
            game.RemoveSprite(game.Star);

            game.Mushroom = SpriteFactory.CreateMushroom(game);
            game.Star     = SpriteFactory.CreateStar(game);

            game.BlockBrick = SpriteFactory.CreateBrick(game);
            game.BlockBrick.SetPosition(450, 350);
            game.AddSprite(game.BlockBrick);

            game.BlockItem = SpriteFactory.CreateBrick(game);
            game.BlockItem.SetPosition(420, 350);
            game.BlockItem.SetItem(game.Mushroom);
            game.AddSprite(game.BlockItem);

            game.BlockHidden = SpriteFactory.CreateHiddenBlock(game);
            game.BlockHidden.SetPosition(500, 350);
            game.AddSprite(game.BlockHidden);

            game.BlockUsed = SpriteFactory.CreateUsedBlock(game);
            game.BlockUsed.SetPosition(550, 350);
            game.AddSprite(game.BlockUsed);

            game.BlockQuestion = SpriteFactory.CreateQuestionBlock(game);
            game.BlockQuestion.SetPosition(600, 350);
            game.AddSprite(game.BlockQuestion);
            game.BlockQuestion.SetItem(game.Star);
        }
Exemplo n.º 5
0
 public void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Exemplo n.º 6
0
        public static void Main(string[] args)
        {
            var playerInput = new PlayerInput();

            var wallTile        = new WallTile();
            var emptyTile       = new EmptyTile();
            var pelletTile      = new PelletTile();
            var tileTypeFactory = new TileTypeFactory(wallTile, emptyTile, pelletTile);

            var ghostTile      = new GhostTile();
            var ghostBehaviour = new RandomGhostBehaviour(ghostTile);

            var pacmanTile      = new PacmanTile();
            var pacmanBehaviour = new PacmanBehaviour(pacmanTile);

            var fileReader        = new FileReader();
            var mazeFactory       = new MazeFactory(fileReader, tileTypeFactory);
            var gameSettingLoader = new GameSettingLoader(fileReader);

            var gameLogicValidator = new GameLogicValidator();
            var gameEngine         = new GameEngine(gameLogicValidator);

            var display       = new Display();
            var spriteFactory = new SpriteFactory();
            var levelFactory  = new LevelFactory(tileTypeFactory, display, spriteFactory, gameLogicValidator, gameEngine, playerInput, pacmanBehaviour, ghostBehaviour);

            var game = new Game(levelFactory, gameSettingLoader, display, mazeFactory, playerInput);

            game.PlayGame();
        }
Exemplo n.º 7
0
        public static AnimatedMenuButton GlowingButton(Vector2 position)
        {
            AnimatedSprite glowingButton = SpriteFactory.GlowingButton(position);

            return(new AnimatedMenuButton("glowingbutton", glowingButton,
                                          functionality: () => Game1.gameConsole.Log("Hallo, von Button")));
        }
Exemplo n.º 8
0
        public static AnimatedMenuButton DiscoButton(Vector2 position)
        {
            AnimatedSprite discoButton = SpriteFactory.DiscoButton(position);

            return(new AnimatedMenuButton("discobutton", discoButton,
                                          functionality: () => Game1.gameConsole.Log("Disco Button!")));
        }
Exemplo n.º 9
0
 public PipeToUnderground(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreatePipeToUnderground();
     MyGame.Sprite = Sprite;
     this.Location = location;
 }
Exemplo n.º 10
0
        public RiceFieldBuilder(XmlElement e) : base(e)
        {
            // pictures
            Picture picture = getPicture(e);

            XmlElement   pic    = (XmlElement)XmlUtil.selectSingleNode(e, "picture");
            int          offset = 0;
            XmlAttribute attr   = null;

            attr = pic.Attributes["offset"];
            if (attr != null)
            {
                offset = int.Parse(attr.Value);
            }
            Point         orig          = XmlUtil.parsePoint(pic.Attributes["origin"].Value);
            SpriteFactory spriteFactory = SpriteFactory.getSpriteFactory(e);

            Point pt = new Point(0, 0);
            Size  sz = new Size(32, 16 + offset);

            sprites       = new Sprite[3, 3];
            sprites[0, 0] = spriteFactory.createSprite(picture, pt, new Point(orig.X, orig.Y), sz);
            sprites[1, 0] = spriteFactory.createSprite(picture, pt, new Point(orig.X, orig.Y + 16), sz);
            sprites[2, 0] = spriteFactory.createSprite(picture, pt, new Point(orig.X + 32, orig.Y), sz);
            sprites[0, 1] = spriteFactory.createSprite(picture, pt, new Point(orig.X + 32, orig.Y + 16), sz);
            sprites[1, 1] = spriteFactory.createSprite(picture, pt, new Point(orig.X + 128, orig.Y + 16), sz);
            sprites[2, 1] = spriteFactory.createSprite(picture, pt, new Point(orig.X + 64, orig.Y + 16), sz);
            sprites[0, 2] = spriteFactory.createSprite(picture, pt, new Point(orig.X + 96, orig.Y), sz);
            sprites[1, 2] = spriteFactory.createSprite(picture, pt, new Point(orig.X + 96, orig.Y + 16), sz);
            sprites[2, 2] = spriteFactory.createSprite(picture, pt, new Point(orig.X + 64, orig.Y), sz);
        }
Exemplo n.º 11
0
 public Castle(Vector2 location)
 {
     Position = location;
     sprite   = SpriteFactory.CreateSprite(GetType().Name);
     sprite.SetLayer(Layers.CastleLayer);
     Physics = new Physics(Vector2.Zero, PhysicsConsts.ZeroGravity, PhysicsConsts.ZeroWeight);
 }
Exemplo n.º 12
0
 public BreakableHorizontalBrick(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateBreakableHorizonalBrick();
     MyGame.Sprite = Sprite;
     this.Location = location;
 }
Exemplo n.º 13
0
        protected override void LoadContent()
        {
            currentTime = 0;
            spriteBatch = new SpriteBatch(GraphicsDevice);

            SpriteLayer.CollisionLayer = new CollisionLayer(this);
            SpriteLayer.GameOverLayer  = new GameOverLayer(this);
            SpriteLayer.YouWinLayer    = new YouWinLayer(this);
            SpriteLayer.HuDLayer       = new HuDLayer(this);

            this.Layers = new List <SpriteLayer>();

            //Ideally, the layers are drawn in this order
            this.Layers.Add(SpriteLayer.BackgroundLayer);
            this.Layers.Add(SpriteLayer.CollisionLayer);
            this.Layers.Add(SpriteLayer.GameOverLayer);
            this.Layers.Add(SpriteLayer.YouWinLayer);
            this.Layers.Add(SpriteLayer.HuDLayer);

            LevelLoader.LoadLevel(this, LEVEL);

            SpriteLayer.CollisionLayer.AddSprite(this.Mario = SpriteFactory.CreateMario(this));

            this.backgroundSong     = Content.Load <Song>("Music/background");
            this.invincibleSong     = Content.Load <Song>("Music/invincible");
            this.spedBackgroundSong = Content.Load <Song>("Music/spedbackground");
            MediaPlayer.Play(this.backgroundSong);
            MediaPlayer.IsRepeating = true;
            MediaPlayer.Volume      = 0.3f;

            pointGenerator = new PointTextGenerator(this);
        }
Exemplo n.º 14
0
 public QuestionMarkBrickToUsed(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateSolidBrickWithCrews3();
     MyGame.Sprite = Sprite;
     this.Location = location;
 }
Exemplo n.º 15
0
 public Cannon(Game1 game, Vector2 location)
 {
     MyGame        = game;
     Sprite        = SpriteFactory.CreateCannon();
     MyGame.Sprite = Sprite;
     this.Location = location;
     missleCounter = 0;
 }
Exemplo n.º 16
0
        public void TestSpriteFactoryBucket()
        {
            SpriteCommand command = new BucketCommand(1, 5, 'o');

            SpriteEntity sprite = SpriteFactory.GetSprite(command, Canvas);

            Assert.IsInstanceOfType(sprite, typeof(Bucket));
        }
Exemplo n.º 17
0
        public void TestSpriteFactoryRectangle()
        {
            SpriteCommand command = new RectangleCommand(1, 5, 1, 3);

            SpriteEntity sprite = SpriteFactory.GetSprite(command, Canvas);

            Assert.IsInstanceOfType(sprite, typeof(Rectangle));
        }
Exemplo n.º 18
0
 void OnTriggerStaySprite(SpriteFactory.SpriteCollider.CollisionData col)
 {
     if (col.otherColliderGameObject.name == "AttackCollider") {
         if (col.spriteColliderName == "DummyCol") {
             dummyRb.AddForce (new Vector2 (playerTrans.localScale.x * 4, 0), ForceMode2D.Impulse);
         }
     }
 }
Exemplo n.º 19
0
 public NormalState(IBlock block)
 {
     this.block = block;
     if (!(block is HiddenBlock))
     {
         block.Sprite = SpriteFactory.CreateSprite(block.GetType().Name);
     }
 }
Exemplo n.º 20
0
 public FactoryManager()
 {
     factoryDict.Add(FactoryType.UIPanelFactory, new UIPanelFactory());
     factoryDict.Add(FactoryType.UIFactory, new UIFactory());
     factoryDict.Add(FactoryType.GameFactory, new GameFactory());
     audioClipFactory = new AudioClipFactory();
     spriteFactory    = new SpriteFactory();
     runtimeAnimatiorControllerFactory = new RuntimeAnimatiorControllerFactory();
 }
Exemplo n.º 21
0
 public void FireExplosion()
 {
     AudioFactory.Instance.CreateSound(StringConsts.Kick).Play();
     sprite = SpriteFactory.CreateSprite(nameof(FireExplosion));
     sprite.SetLayer(itemLayer);
     Position += Locations.FireBallExplosionOffSet;
     ObjState  = ObjectState.NonCollidable;
     Explosion = true;
 }
Exemplo n.º 22
0
 public QuestionMarkBrick(Game1 game, Vector2 location, String item)
 {
     MyGame        = game;
     hasBeenUsed   = false;
     Sprite        = SpriteFactory.CreateQuestionMarkBrick();
     MyGame.Sprite = Sprite;
     this.Location = location;
     itemObject    = item;
 }
Exemplo n.º 23
0
 public Coin(Vector2 location)
 {
     Position = location;
     sprite   = SpriteFactory.CreateSprite(GetType().Name);
     sprite.SetLayer(Layers.CoinLayer);
     Physics = new Physics(PhysicsConsts.CoinInitialVelocity, PhysicsConsts.CoinGravity, itemWeight);
     Physics.ApplyGravity();
     /* Since Initally item does not have gravity for responding state */
 }
Exemplo n.º 24
0
 public UsedBlock(Vector2 location)
 {
     HasItem  = false;
     ObjState = ObjectState.Normal;
     Position = location;
     Physics  = new Physics(Vector2.Zero, PhysicsConsts.ZeroGravity, PhysicsConsts.ZeroWeight);
     State    = new BumpedState(this);
     Sprite   = SpriteFactory.CreateSprite(GetType().Name);
 }
Exemplo n.º 25
0
 public WinFlag(Vector2 location)
 {
     Position = location;
     ObjState = ObjectState.NonCollidable;
     sprite   = SpriteFactory.CreateSprite(GetType().Name);
     sprite.SetLayer(Layers.FlagLayer);
     Physics     = new Physics(PhysicsConsts.WinFlagVelocity, PhysicsConsts.ZeroGravity, PhysicsConsts.ZeroWeight);
     speedChange = Position.Y - Locations.WinFlagOffset;
 }
Exemplo n.º 26
0
 protected virtual void Initialize()
 {
     ObjState = ObjectState.Normal;
     sprite   = SpriteFactory.CreateSprite(PipeType);
     sprite.SetLayer(Layers.PipeLayer);
     Physics            = new Physics(Vector2.Zero, PhysicsConsts.ZeroGravity, PhysicsConsts.ZeroWeight);
     TransferedLocation = Vector2.Zero;
     TeleportDirection  = Direction.none;
     Teleported         = false;
 }
Exemplo n.º 27
0
        public void RegisterState(int sheetState, int spriteState, string texture)
        {
            if (!this.stateMap.ContainsKey(sheetState))
            {
                this.stateMap.Add(sheetState, new Dictionary <int, Texture2D>());
            }

            //Console.WriteLine("RegisterState for {0}: {1}, {2}, {3}", this.name, sheetState, spriteState, texture);
            stateMap[sheetState].Add(spriteState, SpriteFactory.loadTexture(this.game, texture));
        }
Exemplo n.º 28
0
 public PlayerStatusState(MarioGame game)
 {
     this.game           = game;
     game.IsMouseVisible = false;
     game.DisableController();
     graphicsDevice      = game.GraphicsDevice;
     spriteFont          = game.Content.Load <SpriteFont>(StringConsts.MarioFont);
     smallMarioSprite    = SpriteFactory.CreateSprite(nameof(SmallMario) + nameof(RightIdle));
     game.IsMouseVisible = false;
 }
Exemplo n.º 29
0
 public FireBall(Vector2 position, FireBallDirection direction)
 {
     Position = position;
     velocityDictionary.TryGetValue(direction, out Vector2 velocity);
     Physics = new Physics(velocity, PhysicsConsts.FireBallGravity, PhysicsConsts.FireBallWeight);
     Physics.ApplyGravity();
     sprite    = SpriteFactory.CreateSprite(GetType().Name);
     Explosion = false;
     AudioFactory.Instance.CreateSound(StringConsts.FireBall).Play();
 }
Exemplo n.º 30
0
            public void Bind(int position)
            {
                ItemView.SetBackgroundColor(new Android.Graphics.Color((int)Colors.Values[position % Colors.Values.Length]));
                ItemView.SetOnClickListener(new ClickListener(position));

                SpinStyle style    = SpinStyle.Values()[position & 15];
                Sprite    drawable = SpriteFactory.Create(style);

                _spinKitView.SetIndeterminateDrawable(drawable);
            }
        private UnityEngine.Texture2D FindFrameTexture(SpriteFactory.GameMasterSprite gameMasterSprite)
        {
            SpriteFactory.Editor.EditorMasterSpriteCore emsc = FileFinder.GetEditorMasterSprite(gameMasterSprite);
            if(emsc == null) throw new System.Exception("EditorMasterSprite could not be found!");

            SpriteFactory.Editor.EditorMasterSprite.Frame frame = emsc.data.GetEditorPreviewFrame();
            if(frame == null) return null; // no frame

            return frame.GetTexture();
        }
Exemplo n.º 32
0
 public FactoryManager()
 {
     // 实例化各工厂
     factoryDict.Add(FactoryType.UIPanel, new UIPanelFactory());
     factoryDict.Add(FactoryType.UI, new UIFactory());
     factoryDict.Add(FactoryType.GameObject, new GameFactory());
     audioClipFactory       = new AudioClipFactory();
     runtimeAnimatorFactory = new RuntimeAnimatorFactory();
     spriteFactory          = new SpriteFactory();
 }
Exemplo n.º 33
0
        public void Load(SpriteBatch spriteBatch, ContentManager Content)
        {
            sb = spriteBatch;
            Sprite logo = new SpriteFactory(Content.Load<Texture2D>("minecraft-text"), new Vector2(210, 5), spriteBatch).SetScale(new Vector2(0.2f, 0.2f)).Build();
            logo.UseCenterAsOrigin = false;
            Sprite singleplayer = new Sprite(Content.Load<Texture2D>("singleplayer"), new Vector2(340, 150), null);
            Sprite singleplayerhighlite = new SpriteFactory(Content.Load<Texture2D>("singleplayerhighlite"), new Vector2(340, 150), spriteBatch).SetScale(new Vector2(0f)).Build();
            Sprite multiplayer = new Sprite(Content.Load<Texture2D>("multiplayer"), new Vector2(270, 220), null);
            Sprite multiplayerhighlite = new Sprite(Content.Load<Texture2D>("multiplayerhighlite"), new Vector2(270, 220), null);
            Sprite options = new Sprite(Content.Load<Texture2D>("Options"), new Vector2(325, 310), null);
            Sprite optionsHighLite = new Sprite(Content.Load<Texture2D>("OptionsHighLite"), new Vector2(325, 310), null);
            Sprite controls = new Sprite(Content.Load<Texture2D>("Controls"), new Vector2(340, 150), null);

            stan = new TextSprite(spriteBatch, new Vector2(170, 220), Content.Load<SpriteFont>("SpriteFont1"), "Stan",  Color.Black);
            stan.Color = Color.Transparent;

            easy = new TextSprite(spriteBatch, new Vector2(250, 220), Content.Load<SpriteFont>("SpriteFont1"), "Easy", Color.Black);
            easy.Color = Color.Transparent;

            medium = new TextSprite(spriteBatch, new Vector2(330, 220), Content.Load<SpriteFont>("SpriteFont1"), "Medium", Color.Black);
            medium.Color = Color.Transparent;

            hard = new TextSprite(spriteBatch, new Vector2(445, 220), Content.Load<SpriteFont>("SpriteFont1"), "Hard", Color.Black);
            hard.Color = Color.Transparent;

            abe = new TextSprite(spriteBatch, new Vector2(525, 220), Content.Load<SpriteFont>("SpriteFont1"), "Abe", Color.Black);
            abe.Color = Color.Transparent;

            controls.Scale = new Vector2(0);
            Sprite controlsHighLite = new Sprite(Content.Load<Texture2D>("ControlsHighLite"), new Vector2(340, 150), null);
            controlsHighLite.Scale = new Vector2(0);
            font = Content.Load<SpriteFont>("SpriteFont1");
            location = new Vector2();
            spriteManager = new SpriteManager(spriteBatch, /*0*/logo, /*1*/singleplayer, /*2*/singleplayerhighlite, /*3*/multiplayer, /*4*/multiplayerhighlite, /*5*/options, /*6*/optionsHighLite, /*7*/controls, /*8*/controlsHighLite);

            multiplayer.Updated += new EventHandler(multiplayer_Updated);
            singleplayer.Updated += new EventHandler(singleplayer_Updated);
            options.Updated += new EventHandler(options_Updated);
            controls.Updated += new EventHandler(controls_Updated);
            easy.Updated += new EventHandler(easy_Updated);
            stan.Updated += new EventHandler(stan_Updated);
            medium.Updated += new EventHandler(medium_Updated);
            hard.Updated += new EventHandler(hard_Updated);
            abe.Updated += new EventHandler(abe_Updated);
        }
            // METHODS
            public static SpriteFactory.Editor.EditorMasterSpriteCore GetEditorMasterSprite(SpriteFactory.GameMasterSprite gameMasterSprite)
            {
                string emsSavePath = rootPath + editorMasterSpriteSavePath;

                string gmsFilePath = UnityEditor.AssetDatabase.GetAssetPath(gameMasterSprite);
                string gmsFileName = System.IO.Path.GetFileNameWithoutExtension(gmsFilePath);

                // convert GMS file name to EMS file name
                string gmsFileNameL = gmsFileName.ToLower();
                string gmsTypeCodeL = gameMasterSpriteTypeCode.ToLower();
                string sgTypeCodeL = spriteGroupTypeCode.ToLower();
                string emscFileName;

                if(gmsFileNameL.StartsWith(gmsTypeCodeL)) { // this is an ungrouped master sprite
                    emscFileName = editorMasterSpriteTypeCode + gmsFileName.Substring(gameMasterSpriteTypeCode.Length, gmsFileName.Length - (gameMasterSpriteTypeCode.Length * 2)) + editorMasterSpriteCoreTypeCode; // strip start and end type codes replacing with ~MS~, end MSC
                } else if(gmsFileNameL.StartsWith(sgTypeCodeL)) { // this is a grouped master sprite
                    emscFileName = gmsFileName.Substring(0, gmsFileName.Length - gameMasterSpriteTypeCode.Length) + editorMasterSpriteCoreTypeCode; // strip off end and replace with ems core version
                    emscFileName.Replace(fileNameDelimiter + gameMasterSpriteTypeCode + fileNameDelimiter, fileNameDelimiter + editorMasterSpriteTypeCode + fileNameDelimiter); // replace middle ~GMS~ with ems version
                } else {
                    throw new System.Exception("Error trying to parse MasterSprite file name!");
                }

                string emscFullPath = emsSavePath + directoryDelimiter + emscFileName + assetExtension;
                if(!System.IO.File.Exists(emscFullPath)) return null;

                SpriteFactory.Editor.EditorMasterSpriteCore emsc = (SpriteFactory.Editor.EditorMasterSpriteCore)UnityEditor.AssetDatabase.LoadAssetAtPath(emscFullPath, typeof(SpriteFactory.Editor.EditorMasterSpriteCore));
                return emsc;
            }
 void OnTriggerStaySprite(SpriteFactory.SpriteCollider.CollisionData col)
 {
     if (col.otherColliderGameObject.tag == "Enemy") {
         if (col.spriteColliderName == "PlayerCol") {
             if (!_invul)
                 StartCoroutine (Knockback (0.02f));
         }
     }
 }
Exemplo n.º 36
0
        public void Load(SpriteBatch spriteBatch, ContentManager Content, Viewport viewport, bool useCustTexture, Texture2D custTexture)
        {
            SpriteFactory ballBuilder = new SpriteFactory(Content.Load<Texture2D>("PongCircle"), new Vector2(370, 180), spriteBatch).SetUpdateParamaters(new UpdateParamaters(true, true, false));
            ball = ballBuilder.Build();
            Sprite p1 = new SpriteFactory(useCustTexture ? custTexture : Content.Load<Texture2D>("PongSprite1"), new Vector2(0, 160), spriteBatch).SetScale(useCustTexture ? new Vector2(80f / custTexture.Width, 80f / custTexture.Height) : new Vector2(1, 1)).Build();
            Sprite p2 = new Sprite(Content.Load<Texture2D>("PongSprite2"), new Vector2(720, 160), spriteBatch);
            bullet = Content.Load<Texture2D>("bullet");
            p2gun = new Sprite(Content.Load<Texture2D>("gun"), new Vector2(viewport.Width - 150, 150 + p2.Height - 40), spriteBatch);
            p2gun.Scale /= 3;
            p2gun.UseCenterAsOrigin = false;
            p1gun = new Sprite(Content.Load<Texture2D>("gun"), new Vector2(10, 150 + p1.Height - 40), spriteBatch);
            p1gun.Scale /= 3;
            p1gun.UseCenterAsOrigin = false;

            p1gun2 = new Sprite(Content.Load<Texture2D>("gun2"), new Vector2(10, 150 + p1.Height - 40), spriteBatch);
            p2gun2 = new Sprite(Content.Load<Texture2D>("gun2"), new Vector2(viewport.Width - 150, 150 + p2.Height - 40), spriteBatch);

            p1gun2.Color = Color.Transparent;
            p2gun2.Color = Color.Transparent;

            p1gun2.UseCenterAsOrigin = false;
            p2gun2.UseCenterAsOrigin = false;

            p1gun3 = new Sprite(Content.Load<Texture2D>("gun3"), new Vector2(10, 150 + p1.Height - 40), spriteBatch);
            p2gun3 = new Sprite(Content.Load<Texture2D>("gun3"), new Vector2(viewport.Width - 150, 150 + p2.Height - 40), spriteBatch);

            p1gun3.Color = Color.Transparent;
            p2gun3.Color = Color.Transparent;

            p1gun3.UseCenterAsOrigin = false;
            p2gun3.UseCenterAsOrigin = false;

            p1gun3.Scale /= 1;
            p2gun3.Scale /= 1;

            p1healthbar = new Sprite(Content.Load<Texture2D>("full healf"), new Vector2(0), spriteBatch);
            p1healthempty = new Sprite(Content.Load<Texture2D>("healftempty"), new Vector2(0), spriteBatch);

            p2healthbar = new Sprite(Content.Load<Texture2D>("full healf"), new Vector2(605, 0), spriteBatch);
            p2healthempty = new Sprite(Content.Load<Texture2D>("healftempty"), new Vector2(605, 0), spriteBatch);

            p2healthbar.UseCenterAsOrigin = false;
            p2healthempty.UseCenterAsOrigin = false;

            p1healthbar.UseCenterAsOrigin = false;
            p1healthempty.UseCenterAsOrigin = false;

            p1healthbar.Color = Color.Transparent;
            p1healthempty.Color = Color.Transparent;

            p2healthbar.Color = Color.Transparent;
            p2healthempty.Color = Color.Transparent;

            p1gun.Color = Color.Transparent;
            p1gun.Updated += new EventHandler(gun_Updated);
            p2gun.Updated += new EventHandler(gun_Updated);
            p2gun.Color = Color.Transparent;

            ball.Updated += new EventHandler(ball_Updated);
            p1.Updated += new EventHandler(p1_Updated);
            p1.Move += new SpriteMoveEventHandler(p1_Move);
            p2.Updated += new EventHandler(p2_Updated);
            p2.Move += new SpriteMoveEventHandler(p2_Move);
            p2gun.Effect = SpriteEffects.FlipHorizontally;

            gameOver = new TextSprite(spriteBatch, new Vector2(170, 220), Content.Load<SpriteFont>("SpriteFont1"), "GAME OVER", Color.Black);
            gameOver.Color = Color.Transparent;

            _spriteManager = new SpriteManager(spriteBatch, ball, p1, p2, p2gun, p1gun, p1healthempty, p1healthbar, p2healthempty, p2healthbar, p1gun2, p2gun2, p1gun3, p2gun3);

            _viewport = viewport;

            resetTimer = new TimeSpan(0, 0, 0, 0, 500);
            elapsedTime = new TimeSpan(0, 0, 0, 0, 0);

            gun = Content.Load<Song>("Truth of the Legend");
            song = Content.Load<Song>("Cut and Run");

            state = GameState.Play;
        }