コード例 #1
0
ファイル: Decoration.cs プロジェクト: olofn/db_public
 public Decoration(SpriteGrid spriteGrid, int animationSpeed, Rectangle dimension, Room.Layer layer, Color color)
 {
     X = dimension.X;
     Y = dimension.Y;
     Width = dimension.Width;
     Height = dimension.Height;
     this.layer = layer;
     this.animationSpeed = animationSpeed;
     this.color = color;
     animationGrid = spriteGrid;
 }
コード例 #2
0
ファイル: Fish.cs プロジェクト: olofn/db_public
        public Fish(string spriteGridName, int sprites, int x, int y, Room.Layer layer)
        {
            this.position.X = x*16;
            this.position.Y = y*16;

            TriggerNewSpeedTarget();
            this.layer = layer;
            this.sprites = sprites;
            animationGrid = new SpriteGrid(spriteGridName, sprites, 1);
            Width = animationGrid.FrameSize.X;
            Height = animationGrid.FrameSize.Y;
        }
コード例 #3
0
ファイル: Particle.cs プロジェクト: olofn/db_public
        public Particle(SpriteGrid spriteGrid, float framerate, Vector2 position, Vector2 velocity, Vector2 gravity, float damping, Color color, SpriteBlendMode blend, Room.Layer layer, float scale, int timeToLive)
        {
            this.spriteGrid = spriteGrid;
            this.framerate = framerate;
            this.position = position;
            this.velocity = velocity;
            this.gravity = gravity;
            this.damping = damping;
            this.color = color;
            this.blend = blend;
            this.layer = layer;
            this.timeToLive = timeToLive;

            CleanUpOnRoomLeft = true;

            Width = (int)(scale * spriteGrid.FrameSize.X);
            Height = (int)(scale * spriteGrid.FrameSize.Y);

            this.position.X -= Width / 2.0f;
            this.position.Y -= Height / 2.0f;

            X = (int)this.position.X;
            Y = (int)this.position.Y;
        }