예제 #1
0
        public Player(GameMain a_gameMain)
        {
            m_gameMain = a_gameMain;

            this.Name = "Player";
            m_fAngleStep = (float)(5.0*Math.PI/180);
            MemberName = "Ship";
            this.RegPoint = (this.Member.Size.ToEPointF()*0.5f).ToEPoint();

            #region Set up particle system (for thrusters)
            m_particleSystem = new Endogine.ParticleSystem.ParticleEmitter();
            //m_particleSystem.Parent = this;
            m_particleSystem.LocZ = LocZ-1;

            SortedList aColors = new SortedList();
            aColors.Add(0.0, System.Drawing.Color.FromArgb(255,255,0));
            aColors.Add(0.5, System.Drawing.Color.FromArgb(255,0,0));
            aColors.Add(1.0, System.Drawing.Color.FromArgb(0,0,0));
            m_particleSystem.SetColorList(aColors);

            SortedList aSizes = new SortedList();
            aSizes.Add(0.0, 1.0);
            aSizes.Add(1.0, 0.0);
            m_particleSystem.SetSizeList(aSizes);

            m_particleSystem.MaxParticles = 100;
            m_particleSystem.NumNewParticlesPerFrame = 0;

            m_fThrustParticles = 2;

            m_particleSystem.Gravity = 0;
            m_particleSystem.Speed = 5;
            m_particleSystem.SizeFact = 0.3f;

            m_particleSystem.ParticlePicRef = PicRef.GetOrCreate("Particle");
            m_particleSystem.SourceRect = new ERectangle(0,0,10,10);
            m_particleSystem.RegPoint = new EPoint(5,5);
            m_particleSystem.LocZ = 100;
            #endregion

            #region Keys setup
            m_keysSteering = new KeysSteering();
            this.m_keysSteering.AddKeyPreset(KeysSteering.KeyPresets.ArrowsSpace);
            this.m_keysSteering.AddKeyPreset(KeysSteering.KeyPresets.awsdCtrlShift);
            this.m_keysSteering.AddPair("left", "right");
            this.m_keysSteering.AddPair("up", "down");
            //m_keysSteering.ReceiveEndogineKeys(m_endogine);
            m_keysSteering.KeyEvent+=new KeyEventHandler(m_keysSteering_KeyEvent);
            #endregion
        }
예제 #2
0
        public Asteroid(GameMain a_gameMain, int a_nSize)
        {
            this.WrapRect = new ERectangleF(new EPointF(0,0), EndogineHub.Instance.Stage.Size.ToEPointF()) + new ERectangleF(-80,-80,160,160);

            m_gameMain = a_gameMain;
            m_gameMain.Asteroids.Add(this);
            m_nSize = a_nSize;

            Endogine.Animation.BhAnimator bh = new Endogine.Animation.BhAnimator();
            bh.FrameSet = "asteroid01";
            bh.Parent = this;
            bh.Animator.Mode = Endogine.Animation.Animator.Modes.Loop;

            this.Scaling = new EPointF(2,2)*(1f/(float)(4-m_nSize));
            //this.TextureFilter = TextureFilters.High;
        }
예제 #3
0
 public Shot(GameMain a_gameMain)
 {
     m_gameMain = a_gameMain;
     MemberName = "Particle";
 }