/// <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(); } }
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; }
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)); } }
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(); } }
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)); } }
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; }
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) { }
public Entity(NosamGame game, Level level) : base(game) { GameRef = game; inLevel = level; }
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); }