コード例 #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
コード例 #2
0
 public Projectile(string name, Rectangle rect, float _speed, Color c, Game1 _game)
 {
     picName = name;
     pos = new Vector2((float)rect.X, (float)rect.Y);
     scale = 1f;
     width = rect.Width; height = rect.Height;
     picRect = rect;
     rotation = 0.0f;
     speed = _speed;
     power = 1.0f;
     color = c;
     game = _game;
     origin = new Vector2(width / 2f, height / 2f);
 }
コード例 #3
0
 public Projectile(Texture2D _pic, Rectangle _picRect, float _rotation, int _velocity, float _power, float _speed, Color _color, Game1 _game)
 {
     pic = _pic;
     pos = new Vector2((float)_picRect.X, (float)_picRect.Y);
     width = _picRect.Width; height = _picRect.Height;
     scale = (((float)width / pic.Width) + ((float)height / pic.Height)) / 2.0f;
     picRect = new Rectangle((int)pos.X, (int)pos.Y, width, height);
     rotation = _rotation;
     speed = _speed;
     power = _power;
     color = _color;
     game = _game;
     origin = new Vector2(pic.Width / 2f, pic.Height / 2f);
 }
コード例 #4
0
 public Projectile(Texture2D _pic, Rectangle rect, float _speed, Color c, Game1 _game)
 {
     pic = _pic;
     pos = new Vector2((float)rect.X, (float)rect.Y);
     width = rect.Width; height = rect.Height;
     scale = (((float)width / pic.Width) + ((float)height / pic.Height)) / 2.0f;
     picRect = new Rectangle((int)pos.X, (int)pos.Y, width, height);
     rotation = 0.0f;
     speed = _speed;
     power = 1.0f;
     color = c;
     game = _game;
     origin = new Vector2(pic.Width / 2f, pic.Height / 2f);
 }
コード例 #5
0
 public Projectile(float x, float y, Texture2D _pic, float _speed, Game1 _game)
 {
     //defaults
     pic = _pic;
     pos = new Vector2(x, y);
     scale = 1;
     picRect = new Rectangle((int)x,(int) y, pic.Width, pic.Height);
     //prevPicRect = new Rectangle(x, y, 50, 50); ?????
     rotation = 0.0f;
     speed = _speed;
     power = 1.0f;
     color = Color.White;
     game = _game;
     origin = new Vector2(pic.Width / 2f, pic.Height / 2f);
 }
コード例 #6
0
 public Projectile(float x, float y, string name, float _speed,int _width, int _height, Game1 _game)
 {
     picName = name;
     pic = null;
     pos = new Vector2(x, y);
     width = _width; height = _height;
     scale = 1f;
     picRect = new Rectangle((int)pos.X, (int)pos.Y, width, height);
     rotation = 0.0f;
     speed = _speed;
     power = 1.0f;
     color = Color.White;
     game = _game;
     origin = new Vector2(width / 2f, height / 2f);
 }