Ejemplo n.º 1
0
 public Conveyor(float xpos, float ypos)
     : base(xpos, ypos)
 {
     this._sprite = new SpriteMap("stuff/conveyor", 14, 10);
     this._sprite.AddAnimation("convey", 0.1f, true, 0, 1, 2, 3, 4, 5, 6, 7);
     this._sprite.frame = Rando.Int(0, 7);
     this._sprite.SetAnimation("convey");
     this.graphic            = (Sprite)this._sprite;
     this.center             = new Vec2(7f, 5f);
     this.collisionOffset    = new Vec2(-7f, -4f);
     this.collisionSize      = new Vec2(14f, 8f);
     this.depth              = new Depth(0.5f);
     this._editorName        = nameof(Conveyor);
     this.thickness          = 100f;
     this.physicsMaterial    = PhysicsMaterial.Metal;
     this.editorOffset       = new Vec2(0.0f, 6f);
     this.hugWalls           = WallHug.Floor;
     this._editorImageCenter = true;
     this._killImpact        = ImpactedFrom.Top;
 }
Ejemplo n.º 2
0
 public Flare(float xpos, float ypos, FlareGun owner, int numFlames = 8)
     : base(xpos, ypos)
 {
     this._sprite = new SpriteMap("smallFire", 16, 16);
     this._sprite.AddAnimation("burn", (float)(0.200000002980232 + (double)Rando.Float(0.2f)), true, 0, 1, 2, 3, 4);
     this._sprite.SetAnimation("burn");
     this._sprite.imageIndex = Rando.Int(4);
     this.graphic            = (Sprite)this._sprite;
     this.center             = new Vec2(8f, 8f);
     this.collisionOffset    = new Vec2(-4f, -2f);
     this.collisionSize      = new Vec2(8f, 4f);
     this.depth          = new Depth(-0.5f);
     this.thickness      = 1f;
     this.weight         = 1f;
     this.breakForce     = 9999999f;
     this._owner         = owner;
     this.weight         = 0.5f;
     this.gravMultiplier = 0.7f;
     this._numFlames     = numFlames;
 }
Ejemplo n.º 3
0
 public ChestPlate(float xpos, float ypos)
     : base(xpos, ypos)
 {
     this._sprite       = new SpriteMap("chestPlateAnim", 32, 32);
     this._spriteOver   = new SpriteMap("chestPlateAnimOver", 32, 32);
     this._pickupSprite = new Sprite("chestPlatePickup");
     this._pickupSprite.CenterOrigin();
     this.graphic                  = this._pickupSprite;
     this.collisionOffset          = new Vec2(-6f, -4f);
     this.collisionSize            = new Vec2(11f, 8f);
     this._equippedCollisionOffset = new Vec2(-7f, -5f);
     this._equippedCollisionSize   = new Vec2(12f, 11f);
     this._hasEquippedCollision    = true;
     this.center             = new Vec2(8f, 8f);
     this.physicsMaterial    = PhysicsMaterial.Metal;
     this._equippedDepth     = 2;
     this._wearOffset        = new Vec2(1f, 1f);
     this._isArmor           = true;
     this._equippedThickness = 3f;
 }
Ejemplo n.º 4
0
        public MetalShield(float xpos, float ypos)
            : base(xpos, ypos)
        {
            // editor settings
            _editorName = "Metal Shield";

            // general settings
            sprite          = new SpriteMap(Mod.GetPath <EdoMod>("stuff\\props\\metalShield"), 11, 24);
            graphic         = sprite;
            center          = new Vec2(5f, 11.5f);
            collisionOffset = new Vec2(-5f, -11.5f);
            collisionSize   = new Vec2(11f, 24f);
            _holdOffset     = new Vec2(0f, 0f);
            depth           = -0.5f;
            thickness       = 10f;
            weight          = 10f;
            flammable       = 0f;
            friction        = 0.25f;
            physicsMaterial = PhysicsMaterial.Metal;
        }
 public BackgroundJets(float xpos, float ypos)
     : base(xpos, ypos)
 {
     this.graphic  = (Sprite) new SpriteMap("levelJetIdle", 32, 13);
     this._leftJet = new SpriteMap("jet", 16, 16);
     this._leftJet.AddAnimation("idle", 0.4f, true, 0, 1, 2);
     this._leftJet.SetAnimation("idle");
     this._leftJet.center = new Vec2(8f, 0.0f);
     this._leftJet.alpha  = 0.7f;
     this._rightJet       = new SpriteMap("jet", 16, 16);
     this._rightJet.AddAnimation("idle", 0.4f, true, 1, 2, 0);
     this._rightJet.SetAnimation("idle");
     this._rightJet.center = new Vec2(8f, 0.0f);
     this._rightJet.alpha  = 0.7f;
     this.center           = new Vec2(16f, 8f);
     this._collisionSize   = new Vec2(16f, 14f);
     this._collisionOffset = new Vec2(-8f, -8f);
     this.hugWalls         = WallHug.Ceiling;
     this._canFlip         = false;
 }
Ejemplo n.º 6
0
 public OldPistol(float xval, float yval)
     : base(xval, yval)
 {
     this.ammo                  = 2;
     this._ammoType             = (AmmoType) new ATShrapnel();
     this._ammoType.range       = 170f;
     this._ammoType.accuracy    = 0.8f;
     this._ammoType.penetration = 0.4f;
     this._type                 = "gun";
     this._sprite               = new SpriteMap("oldPistol", 32, 32);
     this.graphic               = (Sprite)this._sprite;
     this.center                = new Vec2(16f, 17f);
     this.collisionOffset       = new Vec2(-8f, -4f);
     this.collisionSize         = new Vec2(16f, 8f);
     this._barrelOffsetTL       = new Vec2(24f, 16f);
     this._fireSound            = "shotgun";
     this._kickForce            = 2f;
     this._manualLoad           = true;
     this._holdOffset           = new Vec2(2f, 0.0f);
 }
Ejemplo n.º 7
0
        public TeamSpawn(float xpos = 0.0f, float ypos = 0.0f)
            : base(xpos, ypos)
        {
            GraphicList graphicList = new GraphicList();

            for (int index = 0; index < 3; ++index)
            {
                SpriteMap spriteMap = new SpriteMap("duck", 32, 32);
                spriteMap.CenterOrigin();
                spriteMap.depth    = (Depth)(float)(0.899999976158142 + 0.00999999977648258 * (double)index);
                spriteMap.position = new Vec2((float)((double)index * 9.41176414489746 - 16.0 + 16.0), -2f);
                graphicList.Add((Sprite)spriteMap);
            }
            this.graphic         = (Sprite)graphicList;
            this._editorName     = "team spawn";
            this.center          = new Vec2(8f, 5f);
            this.collisionSize   = new Vec2(32f, 16f);
            this.collisionOffset = new Vec2(-16f, -8f);
            this._visibleInGame  = false;
        }
Ejemplo n.º 8
0
        public ScaleGun(float xpos, float ypos)
            : base(xpos, ypos)
        {
            // editor name
            _editorName = "Scale Gun";

            // collision & sprite settings
            sprite           = new SpriteMap(Mod.GetPath <EdoMod>("weapons\\rail_gun"), 23, 13);
            graphic          = sprite;
            _center          = new Vec2(11.5f, 6.5f);
            _collisionSize   = new Vec2(23f, 13f);
            _collisionOffset = new Vec2(-11.5f, -6.5f);
            _holdOffset      = new Vec2(-4f, -1f);
            _barrelOffsetTL  = new Vec2(21f, 5f);
            _laserOffsetTL   = new Vec2(22f, 5f);

            // weapon settings
            ammo    = 1;
            _weight = 3f;
        }
Ejemplo n.º 9
0
 public Phaser(float xval, float yval)
     : base(xval, yval)
 {
     this.ammo                = 30;
     this._ammoType           = (AmmoType) new ATPhaser();
     this._type               = "gun";
     this.graphic             = new Sprite("phaser");
     this.center              = new Vec2(7f, 4f);
     this.collisionOffset     = new Vec2(-7f, -4f);
     this.collisionSize       = new Vec2(15f, 9f);
     this._barrelOffsetTL     = new Vec2(14f, 3f);
     this._fireSound          = "laserRifle";
     this._fullAuto           = false;
     this._fireWait           = 0.0f;
     this._kickForce          = 0.5f;
     this._holdOffset         = new Vec2(0.0f, 0.0f);
     this._flare              = new SpriteMap("laserFlare", 16, 16);
     this._flare.center       = new Vec2(0.0f, 8f);
     this._phaserCharge       = new SpriteMap("phaserCharge", 8, 8);
     this._phaserCharge.frame = 1;
 }
Ejemplo n.º 10
0
 public RCController(float xval, float yval, RCCar car)
     : base(xval, yval)
 {
     this.ammo               = 99;
     this._ammoType          = (AmmoType) new ATLaser();
     this._ammoType.range    = 170f;
     this._ammoType.accuracy = 0.8f;
     this._type              = "gun";
     this._sprite            = new SpriteMap("rcController", 32, 32);
     this.graphic            = (Sprite)this._sprite;
     this.center             = new Vec2(16f, 16f);
     this.collisionOffset    = new Vec2(-6f, -4f);
     this.collisionSize      = new Vec2(12f, 9f);
     this._barrelOffsetTL    = new Vec2(26f, 14f);
     this._fireSound         = "smg";
     this._fullAuto          = true;
     this._fireWait          = 1f;
     this._kickForce         = 1f;
     this.flammable          = 0.8f;
     this._car               = car;
 }
Ejemplo n.º 11
0
 private void Init(float xpos, float ypos, DuckPersona who)
 {
     this.position.x = xpos;
     this.position.y = ypos;
     this.alpha      = 1f;
     this.hSpeed     = Rando.Float(6f) - 3f;
     this.vSpeed     = (float)((double)Rando.Float(2f) - 1.0 - 1.0);
     this._sprite    = who.featherSprite.CloneMap();
     this._sprite.SetAnimation("feather");
     this._sprite.frame = Rando.Int(3);
     if (Rando.Double() > 0.5)
     {
         this._sprite.flipH = true;
     }
     else
     {
         this._sprite.flipH = false;
     }
     this.graphic = (Sprite)this._sprite;
     this._rested = false;
 }
Ejemplo n.º 12
0
 public ExplosionPart(float xpos, float ypos, bool doWait = true)
     : base(xpos, ypos)
 {
     this._sprite = new SpriteMap("explosion", 64, 64);
     this._sprite.AddAnimation("explode", 1f, false, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10);
     this._sprite.SetAnimation("explode");
     this.graphic       = (Sprite)this._sprite;
     this._sprite.speed = 0.4f + Rando.Float(0.2f);
     this.xscale        = 0.5f + Rando.Float(0.5f);
     this.yscale        = this.xscale;
     this.center        = new Vec2(32f, 32f);
     this._wait         = Rando.Float(1f);
     this._smokeFrame   = Rando.Int(1, 3);
     this.depth         = new Depth(1f);
     this.vSpeed        = Rando.Float(-0.2f, -0.4f);
     if (doWait)
     {
         return;
     }
     this._wait = 0.0f;
 }
Ejemplo n.º 13
0
        public TunnelGrenade(float xval, float yval) : base(xval, yval)
        {
            this.ignoreCollisions      = true;
            this.ammo                  = 1;
            this._ammoType             = new ATShrapnel();
            this._ammoType.penetration = 0.4f;
            this._type                 = "gun";

            this._sprite = new SpriteMap(GetPath("weapons/TunnelGrenade"), 32, 32, true);
            base.graphic = this._sprite;
            _sprite.AddAnimation("animation", 1.6f, true, 0, 1, 2, 3, 4);


            this.center          = new Vec2(16f, 16f);
            this.collisionOffset = new Vec2(-4f, -5f);
            this.collisionSize   = new Vec2(8f, 10f);
            base.bouncy          = 0.4f;
            this.friction        = 0.05f;
            this._editorName     = "(non teleport) Tunnel Grenade";
            this._bio            = "Basically a better looking Grenade. Does not teleport.";
        }
Ejemplo n.º 14
0
        public TinyBubble(float xpos, float ypos, float startHSpeed, float minY, bool blue = false)
            : base(xpos, ypos)
        {
            this.alpha     = 0.7f;
            this._minY     = minY;
            this._gravMult = 0.0f;
            this.vSpeed    = -Rando.Float(0.5f, 1f);
            this.hSpeed    = startHSpeed;
            this.depth     = new Depth(0.3f);
            SpriteMap spriteMap = new SpriteMap("tinyBubbles", 8, 8);

            if (blue)
            {
                spriteMap = new SpriteMap("tinyBlueBubbles", 8, 8);
            }
            spriteMap.frame = Rando.Int(0, 1);
            this.graphic    = (Sprite)spriteMap;
            this.center     = new Vec2(4f, 4f);
            this._waveSize  = Rando.Float(0.1f, 0.3f);
            this.xscale     = this.yscale = 0.1f;
        }
Ejemplo n.º 15
0
 public DartGun(float xval, float yval)
     : base(xval, yval)
 {
     this.ammo               = 12;
     this._ammoType          = (AmmoType) new ATLaser();
     this._ammoType.range    = 170f;
     this._ammoType.accuracy = 0.8f;
     this._type              = "gun";
     this._sprite            = new SpriteMap("dartgun", 32, 32);
     this.graphic            = (Sprite)this._sprite;
     this.center             = new Vec2(16f, 16f);
     this.collisionOffset    = new Vec2(-8f, -4f);
     this.collisionSize      = new Vec2(16f, 9f);
     this._barrelOffsetTL    = new Vec2(29f, 14f);
     this._fireSound         = "smg";
     this._fullAuto          = true;
     this._fireWait          = 1f;
     this._kickForce         = 1f;
     this.flammable          = 0.8f;
     this._barrelAngleOffset = 8f;
     this.physicsMaterial    = PhysicsMaterial.Plastic;
 }
Ejemplo n.º 16
0
        public static void Main(string[] args)
        {
            string    file = File.ReadAllText(args[0]);
            SpriteMap map  = null;
            FlashFile v    = null;

            if (file.StartsWith("{\"ATLAS"))
            {
                map = JsonConvert.DeserializeObject <SpriteMap>(file);
            }
            else
            {
                v = JsonConvert.DeserializeObject <FlashFile>(file);
            }
            Console.WriteLine("Converting gaming");
            string xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";

            xml += "\n<TextureAtlas imagePath=\"" + (v == null ? map.Meta.Image : v.Meta.Image) + "\">";
            xml += "\n<!-- Created with Kades Custom Converter -->";
            if (map == null)
            {
                foreach (KeyValuePair <string, FrameValue> fv in v.Frames)
                {
                    xml +=
                        $"\n<SubTexture name=\"{fv.Key}\" x=\"{fv.Value.Frame.X}\" y=\"{fv.Value.Frame.Y}\" width=\"{fv.Value.Frame.W}\" height=\"{fv.Value.Frame.H}\" frameX=\"-{fv.Value.SpriteSourceSize.X}\" frameY=\"-{fv.Value.SpriteSourceSize.Y}\" frameWidth=\"{fv.Value.SpriteSourceSize.W}\" frameHeight=\"{fv.Value.SpriteSourceSize.H}\"/>";
                }
            }
            else
            {
                foreach (SpriteElement fv in map.Atlas.Sprites)
                {
                    xml +=
                        $"\n<SubTexture name=\"{fv.Sprite.Name}\" x=\"{fv.Sprite.X}\" y=\"{fv.Sprite.Y}\" width=\"{fv.Sprite.W}\" height=\"{fv.Sprite.H}\" frameX=\"-{fv.Sprite.X}\" frameY=\"-{fv.Sprite.Y}\" frameWidth=\"{fv.Sprite.W}\" frameHeight=\"{fv.Sprite.H}\"/>";
                }
            }

            xml += "\n</TextureAtlas>";
            File.WriteAllText((map == null ? v.Meta.Image.Split('.')[0] : map.Meta.Image.Split(('.'))[0]) + ".xml", xml);
        }
Ejemplo n.º 17
0
        public RussianRoulette(float xval, float yval) : base(xval, yval)
        {
            _editorName                       = "Last Spin";
            this.ammo                         = 25;
            this._ammoType                    = new AT9mm();
            this._ammoType.range              = 70f;
            this._ammoType.accuracy           = 1f;
            this._ammoType.penetration        = 0.4f;
            this._ammoType.immediatelyDeadly  = true;
            this._ammoType.barrelAngleDegrees = 135f;
            this._type                        = "gun";

            sprite               = new SpriteMap(GetPath("/weapons/Sadgun.png"), 32, 32);
            this.center          = new Vec2(16f, 16f);
            this.collisionOffset = new Vec2(-6f, -4f);
            this.collisionOffset = new Vec2(-6f, -4f);
            this.collisionSize   = new Vec2(12f, 8f);
            this._barrelOffsetTL = new Vec2(20f, 15f);
            this._fireSound      = GetPath("/sfx/revolverspin");
            this._kickForce      = 3;
            base.graphic         = sprite;
        }
Ejemplo n.º 18
0
        public FututreGan(float xval, float yval)
            : base(xval, yval)
        {
            CooldownBinding = new StateBinding("cooldown");

            _editorName = "Fututre Gan";
            _bio        = "For Fututre Use";

            ammo            = MaxAmmo;
            _type           = "gun";
            graphic         = sprite = new SpriteMap(DuckUtils.GetAsset("weapons/fututre_gan.png"), 16, 16);
            center          = new Vec2(7f, 9f);
            collisionOffset = new Vec2(-7f, -4f);
            collisionSize   = new Vec2(13f, 9f);
            _barrelOffsetTL = new Vec2(14f, 6f);
            _fullAuto       = false;
            _fireWait       = 0f;
            _kickForce      = 0.5f;
            _holdOffset     = new Vec2(0f, 0f);

            UpdateSprite();
        }
Ejemplo n.º 19
0
 public FireExtinguisher(float xval, float yval)
     : base(xval, yval)
 {
     this.ammo            = this._maxAmmo;
     this._type           = "gun";
     this.graphic         = new Sprite("extinguisher");
     this.center          = new Vec2(8f, 8f);
     this.collisionOffset = new Vec2(-3f, -8f);
     this.collisionSize   = new Vec2(6f, 16f);
     this._barrelOffsetTL = new Vec2(15f, 2f);
     this._fireSound      = "smg";
     this._fullAuto       = true;
     this._fireWait       = 1f;
     this._kickForce      = 1f;
     this._guage          = new SpriteMap("netGunGuage", 8, 8);
     this._holdOffset     = new Vec2(0.0f, 2f);
     if (!Network.isActive)
     {
         return;
     }
     this.ammo = 120;
 }
Ejemplo n.º 20
0
        public ClashShield(float xval, float yval)
            : base(xval, yval)
        {
            ActiveBinding    = new StateBinding("Active");
            LowChargeBinding = new StateBinding("LowCharge");

            _editorName = "Clash Shield";

            graphic    = spriteMap = new SpriteMap(DuckUtils.GetAsset("weapons/clash_shield.png"), 32, 32);
            lightning1 = new SpriteMap(DuckUtils.GetAsset("weapons/clash_shield_lightnings.png"), 12, 6);
            lightning2 = new SpriteMap(DuckUtils.GetAsset("weapons/clash_shield_lightnings.png"), 12, 6);

            depth = depth - 2;

            spriteMap.AddAnimation("idle", 0.4f, false, 0);
            spriteMap.AddAnimation("active", 0.2f, true, 1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2);
            spriteMap.AddAnimation("low", 0.2f, true, 1, 0, 2, 0, 0, 3, 4, 0, 5, 0, 6, 0, 7, 0, 5, 0, 4, 0, 3, 0, 2);

            lightning1.AddAnimation("idle", 0.4f, false, 0);
            lightning1.AddAnimation("active", 0.2f, true, LightningPattern1);
            lightning1.AddAnimation("low", 0.2f, true, 15, 0, 12, 0, 0, 3, 7, 0, 1, 0, 9, 0, 5, 0, 10, 0, 9, 0, 4);

            lightning2.AddAnimation("idle", 0.4f, false, 0);
            lightning2.AddAnimation("active", 0.2f, true, LightningPattern2);
            lightning2.AddAnimation("low", 0.2f, true, 5, 0, 7, 0, 0, 1, 8, 0, 12, 0, 11, 0, 8, 0, 3, 0, 2, 0, 4);

            sound = SFX.Get(DuckUtils.GetAsset("sounds/clash_shield.wav"), 1f, 0f, 0f, true);

            ammo            = 99;
            thickness       = 8.9f;
            weight          = 9f;
            center          = new Vec2(16f, 18f);
            collisionOffset = new Vec2(-3f, -18f);
            collisionSize   = new Vec2(16f, 27f);
            handOffset      = new Vec2(0f, 1000000f);
            _holdOffset     = new Vec2(-3f, 4f);
            _barrelOffsetTL = new Vec2(23f, 12f);
        }
Ejemplo n.º 21
0
        public FrogLauncher(float xval, float yval)
            : base(xval, yval)
        {
            AimAngleBinding = new StateBinding("aimAngle");
            StateBinding    = new StateBinding("stateIndex");

            _editorName = "Frog Launcher";
            _bio        = "This boy can fit " + MaxAmmo + " frogs innit!";

            ammo       = MaxAmmo;
            _type      = "gun";
            graphic    = baseSprite = new SpriteMap(DuckUtils.GetAsset("weapons/frog_launcher_base.png"), 24, 12);
            ammoSprite = new SpriteMap(DuckUtils.GetAsset("weapons/frog_launcher_ammo.png"), 26, 12);

            for (int i = 1; i <= 4; i++)
            {
                int rowStartIdx = (5 - i) * 4;
                ammoSprite.AddAnimation("idle" + i, 0.4f, false, rowStartIdx + 0);
                ammoSprite.AddAnimation("load" + i, 0.4f, false, rowStartIdx + 1, rowStartIdx + 2, rowStartIdx + 3);
            }

            ammoSprite.AddAnimation("empty", 0.4f, false, 21);
            ammoSprite.AddAnimation("idleOver", 0.4f, false, 0);
            ammoSprite.AddAnimation("loadOver", 0.4f, false, 1, 2, 3, 20);
            ammoSprite.SetAnimation("empty");

            center          = new Vec2(6f, 7f);
            collisionOffset = new Vec2(-6f, -4f);
            collisionSize   = new Vec2(16f, 8f);
            _barrelOffsetTL = new Vec2(25f, 4f);
            _laserOffsetTL  = new Vec2(22f, 4f);
            _fireSound      = "pistol";
            _kickForce      = 3f;
            _holdOffset     = new Vec2(-3f, 0f);
            _ammoType       = new ATGrenade();

            UpdateSprites();
        }
 public override void Update()
 {
     if (!this.inited)
     {
         this.inited = true;
         SpriteMap graphic = this.graphic as SpriteMap;
         if (!this.flipHorizontal && graphic.frame % 8 == 0)
         {
             if (Level.CheckPoint <BackgroundPyramid>(this.position + new Vec2(-16f, 0.0f)) != null)
             {
                 ++graphic.frame;
                 graphic.UpdateFrame();
             }
         }
         else if (!this.flipHorizontal && graphic.frame % 8 == 7)
         {
             if (Level.CheckPoint <BackgroundPyramid>(this.position + new Vec2(16f, 0.0f)) != null)
             {
                 --graphic.frame;
                 graphic.UpdateFrame();
             }
         }
         else if (this.flipHorizontal && graphic.frame % 8 == 0)
         {
             if (Level.CheckPoint <BackgroundPyramid>(this.position + new Vec2(16f, 0.0f)) != null)
             {
                 ++graphic.frame;
                 graphic.UpdateFrame();
             }
         }
         else if (this.flipHorizontal && graphic.frame % 8 == 7 && Level.CheckPoint <BackgroundPyramid>(this.position + new Vec2(-16f, 0.0f)) != null)
         {
             --graphic.frame;
             graphic.UpdateFrame();
         }
     }
     base.Update();
 }
Ejemplo n.º 23
0
        public TeleportPistol(float xval, float yval) : base(xval, yval)
        {
            _ammoType            = new ATLaser();
            _editorName          = "Telport Pistol";
            _bio                 = "Pew pew";
            this.ammo            = 3;
            this.center          = new Vec2(16f, 16f);
            this.collisionOffset = new Vec2(-6f, -4f);
            this.collisionSize   = new Vec2(12f, 8f);
            this._barrelOffsetTL = new Vec2(20f, 15f);
            _kickForce           = 0.2f;
            this._fireSound      = GetPath("/sfx/pewsound");
            physicsMaterial      = PhysicsMaterial.Wood;



            sprite       = new SpriteMap(GetPath("/weapons/TeleportPistol.png"), 32, 32);
            base.graphic = sprite;
            sprite.AddAnimation("3", 0.4f, true, 0, 1, 2, 3);
            sprite.AddAnimation("2", 0.4f, true, 4, 5, 6, 7);
            sprite.AddAnimation("1", 0.4f, true, 8, 9, 10, 11);
            sprite.AddAnimation("0", 0.4f, true, 12);
        }
Ejemplo n.º 24
0
        public Frog(float xpos, float ypos, bool direction)
            : base(xpos, ypos)
        {
            // _sprite.AddAnimation("frog", 1f, true, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
            //_sprite.SetAnimation("frog");
            graphic = new SpriteMap(DuckUtils.GetAsset("part/frog.png"), 16, 16);

            float scale = xscale = yscale = Rando.Float(0.5f, 0.8f);

            lifetime         = Rando.Float(3f, 6f);
            center           = new Vec2(8f, 7f);
            collisionOffset  = new Vec2(-6f, -5f);
            collisionSize    = new Vec2(11f, 14f * scale);
            depth            = -0.5f;
            bouncy           = 0.1f;
            friction         = 0.15f;
            thickness        = 2f;
            weight           = 1.4f;
            _impactThreshold = 0.01f;

            jumpDirection = direction ? 1 : -1;
            jumpTime      = Rando.Float(0f, 2f);
        }
Ejemplo n.º 25
0
 public MindControlRay(float xval, float yval)
     : base(xval, yval)
 {
     this.ammo               = 99;
     this._ammoType          = (AmmoType) new ATLaser();
     this._ammoType.range    = 170f;
     this._ammoType.accuracy = 0.8f;
     this._type              = "gun";
     this._sprite            = new SpriteMap("mindControlGun", 16, 16);
     this._sprite.frame      = 2;
     this.graphic            = (Sprite)this._sprite;
     this.center             = new Vec2(8f, 8f);
     this.collisionOffset    = new Vec2(-7f, -4f);
     this.collisionSize      = new Vec2(14f, 10f);
     this._hat               = new SpriteMap("mindControlHelmet", 32, 32);
     this._hat.center        = new Vec2(16f, 16f);
     this._barrelOffsetTL    = new Vec2(18f, 8f);
     this._fireSound         = "smg";
     this._fullAuto          = true;
     this._fireWait          = 1f;
     this._kickForce         = 1f;
     this.flammable          = 0.8f;
 }
 public PlasmaBlaster(float xval, float yval)
     : base(xval, yval)
 {
     this.ammo            = 99;
     this._ammoType       = (AmmoType) new ATPlasmaBlaster();
     this._type           = "gun";
     this.graphic         = new Sprite("plasmaBlaster");
     this.center          = new Vec2(8f, 8f);
     this.collisionOffset = new Vec2(-8f, -3f);
     this.collisionSize   = new Vec2(16f, 8f);
     this._barrelOffsetTL = new Vec2(18f, 6f);
     this._fireSound      = "plasmaFire";
     this._kickForce      = 1f;
     this.loseAccuracy    = 0.14f;
     this.maxAccuracyLost = 0.9f;
     this._bigFlare       = new SpriteMap("plasmaFlare", 32, 32);
     this._bigFlare.AddAnimation("idle", 1f, false, 0, 1, 2);
     this._bigFlare.center = new Vec2(0.0f, 16f);
     this._fullAuto        = true;
     this._bulletColor     = Color.Orange;
     this._bio             = "Originally found in a crater next to a burnt power suit. It's origin and mechanism of action are unknown, but tests indicate that it is seriously badass.";
     this._editorName      = "Plasma Blaster";
 }
Ejemplo n.º 27
0
 public NovaExp(float xpos, float ypos, bool doWait = true) : base(xpos, ypos)
 {
     _sprite = this.ReadyToRunWithFrames(tex_Effect_CrystalExplosionPurple, 36, 36);
     _sprite.AddAnimation("loop", 1f, false, new int[]
     {
         0,
         1,
         2,
         3,
         4,
         5,
         6,
         7,
         8,
         9,
         10,
         11,
         12,
         13,
         14,
         15,
         16,
         17,
         18,
     });
     _sprite.SetAnimation("loop");
     graphic       = _sprite;
     _sprite.speed = 0.6f;
     xscale        = 0.5f;
     yscale        = xscale;
     center        = new Vec2(18f, 18f);
     depth         = 1f;
     if (!doWait)
     {
         _wait = 0f;
     }
 }
Ejemplo n.º 28
0
        public MusicNote(float xpos, float ypos, Vec2 dir)
            : base(xpos, ypos)
        {
            this._sprite       = new SpriteMap("notes", 8, 8);
            this._sprite.frame = Rando.Int(1);
            this._sprite.CenterOrigin();
            int num1 = Rando.ChooseInt(0, 1, 2, 3);

            if (num1 == 0)
            {
                this._color = Color.Violet;
            }
            if (num1 == 1)
            {
                this._color = Color.SkyBlue;
            }
            if (num1 == 2)
            {
                this._color = Color.Wheat;
            }
            if (num1 == 4)
            {
                this._color = Color.GreenYellow;
            }
            this._dir = dir;
            float num2 = 1f;

            if ((double)Rando.Float(1f) <= 0.5)
            {
                num2 = -1f;
            }
            this._sin   = new SinWave(0.03f + Rando.Float(0.1f), num2 * 6.283185f);
            this._size  = 3f + Rando.Float(6f);
            this._speed = 0.8f + Rando.Float(1.4f);
            this.depth  = new Depth(0.95f);
            this.scale  = new Vec2(0.1f, 0.1f);
        }
Ejemplo n.º 29
0
        public override void Update()
        {
            if (netEquippedDuck != null && !Playing)
            {
                sound.Play();
                Playing = true;
            }

            if (Playing)
            {
                Timer  += Maths.IncFrameTimer();
                graphic = pickupSprite = _sprite = new SpriteMap(DuckUtils.GetAsset("hats/imstuff.png"), 129, 153);

                if (Timer > 18.2f)
                {
                    Explosion.Create(this, position, ExplosionShrapnel);

                    netEquippedDuck = null;
                    Level.Remove(this);
                }
            }

            base.Update();
        }
Ejemplo n.º 30
0
        public VoteGun(float xval, float yval)
            : base(xval, yval)
        {
            PlayBinding = new StateBinding("Playing");

            _bio        = "Golosovanie!";
            _editorName = "Vote Gun";

            ammo      = LoopTimingsAmount;
            _ammoType = new ATGrenade();
            _type     = "gun";

            sprite = new SpriteMap(DuckUtils.GetAsset("weapons/dubstep_gun.png"), 16, 16);
            sprite.AddAnimation("anim", Maths.IncFrameTimer() * 4f, true, 0, 1, 2, 3);
            sprite.SetAnimation("anim");
            graphic = sprite;
            center  = new Vec2(8f, 10f);

            sound = SFX.Get(DuckUtils.GetAsset("sounds/vote_loop.wav"), 1f, 0f, 0f, false);

            collisionOffset = new Vec2(-8f, -6f);
            collisionSize   = new Vec2(16f, 11f);
            _barrelOffsetTL = new Vec2(16f, 6f);
            _kickForce      = 3f;
            _holdOffset     = new Vec2(-1f, 0f);
            loseAccuracy    = 0.1f;
            maxAccuracyLost = 2f;
            physicsMaterial = PhysicsMaterial.Metal;

            _ammoType       = new ATShotgun();
            _ammoType.range = 100f;
            _type           = "gun";

            _kickForce         = 10f;
            _numBulletsPerFire = 7;
        }
Ejemplo n.º 31
0
    void Awake()
    {
        map = SpriteMapLoader.Load();

        //pathSprites = LoadSprites("Path"); //Resources.LoadAll<Sprite>("Path");
        //buildingSprites = Resources.LoadAll<Sprite>("Building");
        //doorSprites = Resources.LoadAll<Sprite>("Door");
        //envirSprites = Resources.LoadAll<Sprite>("Environment");
        sprites[SpriteLayer.Path] = LoadSprites("Path");
        sprites[SpriteLayer.Building] = LoadSprites("Building");
        sprites[SpriteLayer.Door] = LoadSprites("Door");
        sprites[SpriteLayer.Environment] = LoadSprites("Environment");
        tileParent = TransformPath.Get("Tiles");
    }
Ejemplo n.º 32
0
 public static void Save(SpriteMap map)
 {
     Serializer.SaveToFile(SpriteMapFilePath, JsonConvert.SerializeObject(map.GetData()));
 }