Example #1
0
 public ShellNormal( string name, IGameObj firer, Vector2 startPos, float startAzi, float speed )
 {
     this.name = name;
     this.firer = firer;
     sprite = new Sprite( BaseGame.RenderEngine, BaseGame.ContentMgr, Path.Combine( Directories.ContentDirectory, texPath ), true );
     sprite.SetParameters( new Vector2( 5, 0 ), startPos, 0.08f, startAzi, Color.White, LayerDepth.Shell, SpriteBlendMode.AlphaBlend );
     phiUpdater = new NonInertiasColUpdater( ObjInfo, startPos, MathTools.NormalVectorFromAzi( startAzi ) * speed, startAzi, 0f, new Sprite[] { sprite } );
     phiUpdater.OnOverlap += new OnCollidedEventHandler( phiUpdater_OnOverlap );
     phiUpdater.OnCollied += new OnCollidedEventHandler( phiUpdater_OnCollied );
 }
Example #2
0
        public ItemCommon( string name, string objClass, string script,
            string texPath, Vector2 texOrigin, float scale, Vector2[] keyPoints,
            Vector2 pos, float azi, Vector2 vel, float rotaVel )
        {
            this.name = name;
            objInfo = new GameObjInfo( objClass, script );
            sprite = new Sprite( BaseGame.RenderEngine, texPath, true );
            sprite.SetParameters( texOrigin, pos, scale, azi, Color.White, LayerDepth.GroundObj, SpriteBlendMode.AlphaBlend );
            sprite.UpdateTransformBounding();
            this.keyPoints = keyPoints;
            phiUpdater = new NonInertiasColUpdater( objInfo, pos, vel, azi, rotaVel, new Sprite[] { sprite } );

            phiUpdater.OnCollied += new OnCollidedEventHandler( phiUpdater_OnCollied );
            phiUpdater.OnOverlap += new OnCollidedEventHandler( phiUpdater_OnOverlap );
        }
Example #3
0
        public ShellNormal(string name, IGameObj firer, Vector2 startPos, float startAzi, float speed, string texPath, bool fromContent, Vector2 texOrignPos, float texScale)
        {
            this.name = name;
            this.firer = firer;

            if (fromContent)
            {
                sprite = new Sprite(BaseGame.RenderEngine, BaseGame.ContentMgr, texPath, true);
            }
            else
            {
                sprite = new Sprite(BaseGame.RenderEngine, texPath, true);
            }
            sprite.SetParameters(texOrignPos, startPos, texScale, startAzi, Color.White, LayerDepth.Shell, SpriteBlendMode.AlphaBlend);
            phiUpdater = new NonInertiasColUpdater(ObjInfo, startPos, MathTools.NormalVectorFromAzi(startAzi) * speed, startAzi, 0f, new Sprite[] { sprite });
            phiUpdater.OnOverlap += new OnCollidedEventHandler(phiUpdater_OnOverlap);
            phiUpdater.OnCollied += new OnCollidedEventHandler(phiUpdater_OnCollied);
        }
Example #4
0
 private void InitializePhisical(Vector2 pos, float azi)
 {
     phisicalUpdater = new NonInertiasColUpdater(objInfo, new Sprite[] { normalSprite });
     phisicalUpdater.OnCollied += new OnCollidedEventHandler(phisicalUpdater_OnCollied);
     phisicalUpdater.OnOverlap += new OnCollidedEventHandler(phisicalUpdater_OnOverlap);
 }