示例#1
0
 public CopSpawner(World world, McgLayer layer, Vector2 location, TimeSpan spawnRate, SpriteBasis copSpriteBasis, SpriteBasis bulletSpriteBasis, Vector2 playerPosition, int spawnRateFuzzMillis = 0)
 {
     this.layer = layer;
     this.world = world;
     this.spawnRate = spawnRate;
     this.location = location;
     this.copSpriteBasis = copSpriteBasis;
     this.spawnRateFuzzMillis = spawnRateFuzzMillis;
     this.playerPosition = playerPosition;
     this.bulletSpriteBasis = bulletSpriteBasis;
 }
示例#2
0
        public CopController( World w, Vector2 r0, CopSprite sprite, McgLayer bulletLayer, SpriteBasis bulletSpriteBasis, Vector2 playerPosition )
        {
            _world = w;

            this.bulletLayer = bulletLayer;

            _fsBody = w.NewBody();
            _fsBody.BodyType = BodyType.Dynamic;
            _fsBody.Position = r0;

            copSprite = sprite;

            MakeLivingFixture();

            shootTimer = TimeSpan.FromSeconds(VERGEGame.rand.Next(3, 10));

            this.bulletSpriteBasis = bulletSpriteBasis;
            this.playerPosition = playerPosition;
        }
示例#3
0
 public McgNode( RenderDelegate act, McgLayer l, int start_x, int start_y, int? end_x, int? end_y, int? delay)
 {
     OnDraw = act;
     _Node( l, start_x, start_y, end_x, end_y, delay );
 }
示例#4
0
 public McgNode(RenderDelegate act, McgLayer l, int start_x, int start_y)
     : this(act, l, start_x, start_y, null, null, null)
 {
 }
示例#5
0
 public McgNode( Sprite s, McgLayer l, int start_x, int start_y, int? end_x, int? end_y, int? delay )
 {
     sprite = s;
     s.visible = true;
     _Node( l, start_x, start_y, end_x, end_y, delay );
 }
示例#6
0
 public McgNode( Sprite s, McgLayer l, int start_x, int start_y )
     : this(s, l, start_x, start_y, null, null, null)
 {
 }
示例#7
0
 public McgNode( Texture2D im, Rectangle bounds, McgLayer l, int start_x, int start_y, int? end_x, int? end_y, int? delay)
 {
     image = im;
     im_bounds = bounds;
     _Node( l, start_x, start_y, end_x, end_y, delay );
 }
示例#8
0
 public McgNode(Texture2D im, Rectangle bounds, McgLayer l, int start_x, int start_y)
     : this(im, bounds, l, start_x, start_y, null, null, null)
 {
 }
示例#9
0
 public McgLayer AddLayer( string name )
 {
     McgLayer l = new McgLayer(this, name);
     layers.Add( l );
     return l;
 }
示例#10
0
        private void _Node( McgLayer l, int start_x, int start_y, int? end_x, int? end_y, int? delay)
        {
            layer = l;

            this.start_x = start_x;
            this.start_y = start_y;

            if( end_x == null ) {
                cur_x = final_x = start_x;
                cur_y = final_y = start_y;
                tick_y = tick_x = delay = final_time = null;
                isMoving = false;
            } else {
                /*
                cur_x = start_x;
                cur_y = start_y;
                final_x = (float)end_x;
                final_y = (float)end_y;
                this.delay = delay;
                tick_x = ( final_x - cur_x ) / (float)delay;
                tick_y = ( final_y - cur_y ) / (float)delay;
                final_time = layer.stack.systime + delay;
                isMoving = true;
                */

                SetNewMovement( start_x, start_y, end_x.Value, end_y.Value, delay.Value );
            }
        }
示例#11
0
 private void _Node( McgLayer l, int start_x, int start_y )
 {
     _Node(l, start_x, start_y);
 }
示例#12
0
 public McgNode( IDrawableThing d, McgLayer l, int start_x, int start_y )
 {
     _idt = d;
     _Node( l, start_x, start_y, start_x, start_y, 0 );
 }
示例#13
0
        public McgNode( Texture2D im, Rectangle? bounds, McgLayer l, int start_x, int start_y, int? end_x, int? end_y, int? delay )
        {
            image = im;

            if( bounds == null ) {
                im_bounds = new Rectangle( start_x, start_y, im.Width, im.Height );
            } else {
                im_bounds = bounds.Value;
            }

            _Node( l, start_x, start_y, end_x, end_y, delay );
        }