Пример #1
0
 public void PLAYER_NORMAL()
 {
     spriteLoader.sprite s = mainLoader.GetSprite("player");
     player.Image    = s.frames[0];
     player.Location = new Point(CENTER_X - s.size.Width, CENTER_Y - s.size.Height);
     mainAnim.ChangeSprite(player, s);
 }
Пример #2
0
 public void ChangeSpeed(int newTime)
 {
     for (int i = 0; i < pB.Count; i++)
     {
         spriteLoader.sprite x = S[i];
         x.frameratetime           = newTime;
         dispose_timer[i].Interval = newTime;
         S[i] = x;
         return;
     }
 }
Пример #3
0
 public void ChangeSprite(PictureBox box, spriteLoader.sprite newSprite)
 {
     for (int i = 0; i < pB.Count; i++)
     {
         if (pB[i] == box)
         {
             S[i]     = newSprite;
             box.Size = newSprite.size;
             return;
         }
     }
 }
Пример #4
0
 public void NewAnimator(PictureBox box, spriteLoader.sprite sprite)
 {
     pB.Add(box);
     pB[pB.Count - 1].Tag = 0;
     box.Size             = sprite.size;
     S.Add(sprite);
     if (sprite.frames.Count > 1)
     {
         Timer x = new Timer();
         x.Tick    += new EventHandler(timeelapse);
         x.Tag      = S.Count - 1;
         x.Interval = sprite.frameratetime;
         x.Enabled  = true;
         dispose_timer.Add(x);
     }
     else
     {
         box.Image = sprite.frames[0];
     }
 }
Пример #5
0
 public void createInfinitRoad(int x, int y)
 {
     roads    = new PictureBox[2];
     roads[0] = new PictureBox();
     roads[1] = new PictureBox();
     spriteLoader.sprite s = mainLoader.GetSprite("road");
     roads[0].Size     = roads[1].Size = s.size;
     roads[0].Location = new Point(x, y);
     roads[1].Location = new Point(roads[0].Location.X + roads[0].Width, y);
     roads[0].Visible  = roads[1].Visible = false;
     roads[0].Image    = roads[1].Image = s.frames[0];
     mainfrm.Controls.Add(roads[0]);
     mainfrm.Controls.Add(roads[1]);
     drawList.Add(roads[0]);
     drawList.Add(roads[1]);
     road_timer = new Timer()
     {
         Interval = 10,
         Enabled  = true
     };
     road_timer.Tick += new EventHandler(road_move);
     System.Diagnostics.Debug.WriteLine("[EVENT] road created!");
 }
Пример #6
0
 public void createThePlayer()
 {
     spriteLoader.sprite s = mainLoader.GetSprite("player");
     player = AddDrawObject_Animated(mainLoader.GetSprite("player"), new Point(CENTER_X - s.size.Width, CENTER_Y - s.size.Height));
     System.Diagnostics.Debug.WriteLine("[EVENT] player created!");
 }