Exemplo n.º 1
0
 public virtual void deadenemyparticle(ParticleSystem deathparticles, int count)
 {
     for (int i = 0; i < count; i++)
     {
         deathparticles.addParticle();
     }
 }
Exemplo n.º 2
0
 public Level(Texture2D playermove, Texture2D portal, Song music)
 {
     this.music = music;
     this.portal = portal;
     this.playermove = playermove;
     particleSystem = new ParticleSystem(GameContent.hitparticle, 0f, .1f, Color.Red, new Vector2(-2, 2), new Vector2(-2, 2), new TimeSpan(0, 0, 0, 0, 500), 1f, 2f, 1f, 1f, new Vector2(150, 30), new TimeSpan(1000, 0, 1, 0, 0), true, .00015f);
 }
Exemplo n.º 3
0
 public Enemy(Texture2D txture, Vector2 pos, Rectangle[] sources, int damage, int health, ParticleSystem deadparticles, Dictionary<inventory.Item, Vector2> itemdrops, bool isAngry)
 {
     this.pos = pos;
     this.txture = txture;
     this.source = sources[0];
     this.sources = sources;
     this.damage = damage;
     this.health = health;
     this.deadparticles = deadparticles;
     this.isAngry = isAngry;
     deathtimer = deadparticles.lifetime - new TimeSpan(0, 0, 0, 0, 10);
     ori = new Vector2(source.Width / 2, source.Height / 2);
     Hitbox = new Rectangle((int)(pos.X), (int)(pos.Y), (int)(source.Width/2), (int)(source.Height/2));
     speedoffset.X = -6/15 + 1;
     speedoffset.Y = speedoffset.X;
     this.itemdrops = itemdrops;
 }
Exemplo n.º 4
0
        public L1(Texture2D playermove, Texture2D playerattack, Texture2D grass, Texture2D grassbarrier, Texture2D foamsword, Texture2D portal, Song song, Texture2D tooltiptxture, SpriteFont font, Texture2D keytxture, Texture2D keydown)
            : base(playermove, portal, song)
        {
            _grassbarrier = grassbarrier;
            _grass = grass;
            _foamsword = foamsword;
            sword = new ItemOnFloor(Items.GetItem("Foam Sword"), new Vector2(150, 30), 0.5f);
            particleSystems = new ParticleSystem(sword.item.texture, 0f, 1f, Color.White, new Vector2(-1, 1), new Vector2(-1, 1), new TimeSpan(0, 0, 3), 1f, 1f, 1f, 1f, new Vector2(150, 30), new TimeSpan(1000, 0, 1, 0, 0), true, 0.00002f);
            int dy = 50;
            float layerDepth = .2f;
            for (int i = 0; i < 8; i++)
            {
                grassBarriers.Add(new Sprite(_grassbarrier, new Vector2(75, dy), null, 0f, Vector2.Zero, 0.5f, SpriteEffects.None, layerDepth, Color.White, _grassbarrier.Width/2, _grassbarrier.Height/2));
                dy += 25;
                layerDepth += .001f;
            }

            dy = 50;
            layerDepth = .2f;
            for (int i = 0; i < 8; i++)
            {
                grassBarriers.Add(new Sprite(_grassbarrier, new Vector2(200, dy), null, 0f, Vector2.Zero, 0.5f, SpriteEffects.None, layerDepth, Color.White, _grassbarrier.Width/2, _grassbarrier.Height/2));
                dy += 25;
                layerDepth += .001f;
            }

            background = new Background(_grass);
            player = new Player(playermove, playerattack, new Vector2(145, 250));
            portalobj = new Portal(portal, new Vector2(155, 250));
            spinning = false;

            //movetip\\
            List<ToolTipObj> objects = new List<ToolTipObj>();
            objects.Add(new Text(.3f, new Vector2(110, 17), .91f, font, "Use WASD to move"));
            List<Key> keys = new List<Key>();
            keys.Add(new Key(.3f, new Vector2(50, 25), .911f, font, 'W', keytxture, keydown));
            keys.Add(new Key(.3f, new Vector2(50, 25), .91f, font, 'A', keytxture, keydown));
            keys.Add(new Key(.3f, new Vector2(50, 25), .91f, font, 'S', keytxture, keydown));
            keys.Add(new Key(.3f, new Vector2(50, 25), .91f, font, 'D', keytxture, keydown));
            ToolTipPlayer tooltipPlayer = new ToolTipPlayer(playermove, playerattack, new Vector2(80, 25), .91f, 1f/5.5f, Direction.Down);
            objects.Add(tooltipPlayer);
            movetipkeyanim = new KeyAnimation(keys, tooltipPlayer);
            foreach (Key thekey in keys)
            {
                objects.Add(thekey);
            }
            movetip = new ToolTip(tooltiptxture, objects);
            movetip.enabled = !movetip.enabled;
            movetip.velocity = new Vector2(0, 0f);

            //pickuptip\\
            List<ToolTipObj> pickupobjects = new List<ToolTipObj>();
            pickupobjects.Add(new Text(.25f, new Vector2(85, 20), .91f, font, "Press K to pick up items and drops"));
            List<Key> pickupkeys = new List<Key>();
            pickupkeys.Add(new Key(.3f, new Vector2(40, 25), .91f, font, 'K', keytxture, keydown));
            pickupkeys.Add(new Key(.3f, new Vector2(40, 25), .91f, font, 'K', keytxture, keydown));
            pickuptipkeyanim = new KeyAnimation(pickupkeys);
            foreach (Key thekey in pickupkeys)
            {
                pickupobjects.Add(thekey);
            }
            pickuptip = new ToolTip(tooltiptxture, pickupobjects);
            pickuptip.enabled = false;
        }