Beispiel #1
0
        public Shot(World world, Vector2 position, float rotation, int damage, DestroyMeHandler onDeathHandler)
        {
            this.mworld = world;
            this.mrotation = rotation;

            this.mposition.Y = (position.Y * MeterInPixels) - (float)Math.Round(48f * Math.Sin(rotation + 1.57079633));
            this.mposition.X = (position.X * MeterInPixels) - (float)Math.Round(48f * Math.Cos(rotation + 1.57079633));

            this.damage = damage;
            this.ondeathHandler = onDeathHandler;

            USERDATA = "standard:" + damage;
        }
Beispiel #2
0
        public Net(World world, Vector2 position, float rotation, DestroyMeHandler onDeathHandler)
        {
            base.mworld = world;

            base.mrotation = rotation;

            base.ondeathHandler = onDeathHandler;

            finalLinkIndex = trueLinkCount - linkIndexShift;

            Vector2 firstLinkPos = rotateVector(new Vector2(0.35f, 0), mrotation); //0.4

            for (int x = -linkIndexShift; x < finalLinkIndex; x++)
            {
                SpriteObjects.NetLink link = new NetLink(mworld, position+(x*firstLinkPos), mrotation, ondeathHandler); //change rotation
                netlinks.Add(link);
            }
        }
Beispiel #3
0
        public NetLink(World world, Vector2 position, float rotation, DestroyMeHandler onDeathHandler)
        {
            base.mworld = world;

            base.mrotation = rotation;

            base.mposition.Y = (position.Y * MeterInPixels) - (float)Math.Round(48f * Math.Sin(rotation + 1.57079633));
            base.mposition.X = (position.X * MeterInPixels) - (float)Math.Round(48f * Math.Cos(rotation + 1.57079633));

            base.ondeathHandler = onDeathHandler;

            USERDATA = "net:" + 0;

            base.setTotalFrames(totalframes);

            base.setFramesPerSec(framesPerSec);

            base.setSpriteSourceHeightAndWidth(spriteSourceHeight, spriteSourceWidth);
        }