public void Draw(SpriteBatch a_SpriteBatch)
 {
     for (int loop = 0; loop < SnakeManager.Instance().List.Count; loop++)
     {
         SnakeManager.Instance().List[loop].Draw(a_SpriteBatch);
     }
 }
 public override void LoadContent(ContentManager content)
 {
     grass = content.Load <Texture2D>(@"Asset\Grass");
     SnakeManager.Instance().LoadContent(content);
     Grass  = content.Load <Texture2D>(@"Asset\NGrass");
     DGrass = content.Load <Texture2D>(@"Asset\DGrass");
 }
 public void Update(GameTime a_GameTime)
 {
     for (int loop = 0; loop < SnakeManager.Instance().List.Count; loop++)
     {
         SnakeManager.Instance().List[loop].Update(a_GameTime);
     }
 }
Beispiel #4
0
        public static SnakeManager Instance()
        {
            if (m_Instance == null)
            {
                m_Instance = new SnakeManager();
            }

            return(m_Instance);
        }
        public static SnakeManager Instance()
        {
            if (m_Instance == null)
            {
                m_Instance = new SnakeManager();
            }

            return m_Instance;
        }
Beispiel #6
0
        protected override void LoadContent()
        {
            SnakeManager.Instance().Content = Content;
            ScoreManager.SmallFont = Content.Load <SpriteFont>(@"Small");
            ScoreManager.LargeFont = Content.Load <SpriteFont>(@"Large");

            EmitterManager.Sprite = Content.Load <Texture2D>(@"Particle\Pixel");

            manager.Initialize(graphics, Content);
            manager.AddState(new MainMenuState());
        }
        public override void LoadContent(ContentManager content)
        {
            SnakeManager.Instance().Content = content;

            m_MainMenuState = new MainMenuState();
            m_MainMenuState.LoadContent(content);
            m_MainMenuState.spriteBatch = spriteBatch;
            m_MainMenuState.Initialize();

            m_CreditsBackground = content.Load <Texture2D>(@"Asset\Snake");
        }
        private void iColor_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (iColor.Items[iColor.SelectedIndex].ToString())
            {
            case "Red":
                SnakeManager.Instance().LocalCustomTint = Color.Red;
                break;

            case "Blue":
                SnakeManager.Instance().LocalCustomTint = Color.Blue;
                break;

            case "Green":
                SnakeManager.Instance().LocalCustomTint = Color.Green;
                break;

            case "Yellow":
                SnakeManager.Instance().LocalCustomTint = Color.Yellow;
                break;

            case "Orange":
                SnakeManager.Instance().LocalCustomTint = Color.Orange;
                break;

            case "Purple":
                SnakeManager.Instance().LocalCustomTint = Color.Purple;
                break;

            case "Navy":
                SnakeManager.Instance().LocalCustomTint = Color.Navy;
                break;

            case "Pink":
                SnakeManager.Instance().LocalCustomTint = Color.Pink;
                break;

            case "LimeGreen":
                SnakeManager.Instance().LocalCustomTint = Color.LimeGreen;
                break;

            case "Gold":
                SnakeManager.Instance().LocalCustomTint = Color.Gold;
                break;

            case "Black":
                SnakeManager.Instance().LocalCustomTint = Color.Black;
                break;

            case "AliceBlue":
                SnakeManager.Instance().LocalCustomTint = Color.AliceBlue;
                break;
            }
        }
Beispiel #9
0
        public override void LoadContent(ContentManager content)
        {
            SnakeManager.Instance().Content = content;

            PlayState tempPlayState = new PlayState();

            tempPlayState.LoadContent(content);
            tempPlayState.spriteBatch = spriteBatch;

            m_Customize = new Customize();
            m_Customize.ShowDialog();

            manager.states.Remove(this);
            manager.states.Add(tempPlayState);
        }
Beispiel #10
0
        public void Draw(SpriteBatch spritebatch, int angle, Color tint, Vector2 position, GraphicType gtype)
        {
            int       gidx     = (int)gtype;
            int       closesta = int.MaxValue;
            FramePair current;
            int       i, j = 0;

            if (pairs == null || pairs.Length < 1)
            {
                return;
            }
            current = pairs[0];

            for (i = 0; i < pairs.Length; ++i)
            {
                if (Math.Max(pairs[i].deg, angle) - Math.Min(pairs[i].deg, angle) < closesta)
                {
                    closesta = Math.Max(pairs[i].deg, angle) - Math.Min(pairs[i].deg, angle);
                    current  = pairs[i];
                    j        = i;
                    if (closesta == 0)
                    {
                        break;
                    }
                }
            }
            System.Diagnostics.Trace.WriteLine(j);

            parts[gidx].invertHorizontal = current.flip;
            parts[gidx].gotoAndStop(current.frame);
            // TODO(xoorath): don't hard code 128*128
            parts[gidx].Draw(spritebatch, new Rectangle((int)position.X, (int)position.Y, 128, 128), tint, 0.0f);

            if (SnakeManager.Instance().DFont != null)
            {
                spritebatch.DrawString(SnakeManager.Instance().DFont, j.ToString() + " : " + angle.ToString(), position, Color.White);
            }
        }
Beispiel #11
0
 private void Awake()
 {
     instance = this;
     _cam     = FindObjectOfType <TopDownCamera>();
 }
 private void iName_TextChanged(object sender, EventArgs e)
 {
     SnakeManager.Instance().LocalName = iName.Text;
 }
        public Customize()
        {
            InitializeComponent();

            iName.Text = SnakeManager.Instance().LocalName;
        }