示例#1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     Program.RNG = new Random();
     using (NosamGame game = new NosamGame())
     {
         game.Run();
     }
 }
示例#2
0
 public Entity(NosamGame game, Level level, Vector2 size, Vector2 velocity, Vector2 location, float rotation, int health, int power)
     : this(game, level)
 {
     Size      = size;
     Location  = location;
     Velocity  = velocity;
     Rotation  = rotation;
     Health    = health;
     MaxHealth = health;
     Power     = power;
 }
示例#3
0
文件: Level.cs 项目: Mason11987/Nosam
        public Level(NosamGame game)
            : base(game)
        {
            GameRef = game;

            Player = new Player(game, this);
            Entities.Add(Player);

            for (int i = 0; i < 50; i++)
            {
                Entities.Add(new Enemy(0, new Vector2(0, -1 * (i * 10)), game, this));
            }
        }
示例#4
0
 public Explosion(Vector2 location, bool isBig, NosamGame game, Level level) : base(game, level)
 {
     Location   = location;
     this.isBig = isBig;
     if (isBig)
     {
         Size = new Vector2(32, 32);
         GameRef.bigExplosionSound.Play();
     }
     else
     {
         Size = new Vector2(15, 15);
         GameRef.smallExplosionSound.Play();
     }
 }
示例#5
0
        public StarHandler(NosamGame game, Level level) : base(game)
        {
            GameRef = game;
            inLevel = level;
            Stars   = new List <StarParticle>();
            for (int i = 0; i < 1000; i++)
            {
                Stars.Add(
                    new StarParticle(
                        new Vector2(Program.RNG.Next(0, GameRef.screenWidth), Program.RNG.Next(0, GameRef.screenHeight)),
                        Program.RNG.Next(1, StarParticle.maxDepth)));
            }
            GameRef.starTexture = new Texture2D(GameRef.GraphicsDevice, 1, 1);
            GameRef.starTexture.SetData(new Color[] { Color.White });

            StarParticle.Colors = new List <Color>();
            int factor = 0;

            for (int i = 0; i < StarParticle.maxDepth; i++)
            {
                factor = 120 + (int)(125f / StarParticle.maxDepth * i);
                StarParticle.Colors.Add(Color.FromNonPremultiplied(factor, factor, factor, 255));
            }
        }
示例#6
0
 public Enemy(int enemyType, Vector2 location, NosamGame game, Level level)
     : base(game, level, new Vector2(31, 30), new Vector2(0, 10), location, 0.0f, 100, 10)
 {
     EnemyType = enemyType;
 }
示例#7
0
 public Player(NosamGame game, Level level)
     : base(game, level, new Vector2(48, 33), Vector2.Zero, new Vector2(game.screenWidth / 2 - (48) / 2, game.screenHeight - (33) - 30), 0.0f, 100, 50)
 {
 }
示例#8
0
 public Entity(NosamGame game, Level level)
     : base(game)
 {
     GameRef = game;
     inLevel = level;
 }
示例#9
0
 public Bullet(int bulletType, Vector2 velocity, Vector2 location, float rotation, int health, int power, bool isFriendly, NosamGame game, Level level)
     : base(game, level, new Vector2(BulletTextureBounds[bulletType].Width, BulletTextureBounds[bulletType].Height), velocity, location, rotation, health, power)
 {
     BulletType      = bulletType;
     this.isFriendly = isFriendly;
     GameRef.eShotSound.Play();
     //particleEngine = new ParticleEngine(ParticleEngine.AllParticleTextures,
     //                                    ParticleEmitterLocation,
     //                                    100,
     //                                    3,
     //                                    MathHelper.PiOver2,
     //                                    MathHelper.PiOver4,
     //                                    .1f,
     //                                    .2f);
 }