Exemplo n.º 1
0
        /*  public override Parameters.DynamicParameters GetParameters()
        {
            return _instanceParameters;
        }*/
        public static CharacterLogicController CreateCharacter(string __nameIsId, GameLevel __level, bool _needMC)
        {
            CharacterParameters parameters = StaticObjects.CharacterParameters[__nameIsId];

            GameCharacter myCharacter = new GameCharacter(parameters._levelObjectName, Matrix.Identity, __level);
            GameSimpleObject myHead = new GameSimpleObject(parameters._headObjectName,  __level, Engine.Logic.PivotObjectDependType.Head, false, false);
            CharacterLogicController result = new CharacterLogicController(__level, myCharacter, myHead, !_needMC);
            result._baseParameters = parameters;
            return result;
        }
Exemplo n.º 2
0
        public GameCharacter(string __aliveName, Matrix __aliveMatrix, GameLevel __level)
            : base(__level, true, true)
        {
            _levelObject = Engine.GameEngine.LoadObject(__aliveName, __aliveMatrix, true, true) as LevelObject;
            _levelObject.matrialType = PivotObjectMaterialType.DynamicHuman;
            _controllerAlive = (_levelObject.renderaspect as Engine.Render.AnimRenderObject).character;

            _isAlive = false;
            _onLevel = false;
        }
Exemplo n.º 3
0
        public static EffectLogicController CreateEffect(string __id, GameLevel __level, Vector3 __position, Vector3 __normal)
        {
            EffectParameters ep = StaticObjects.EffectParameters[__id];
            EffectLogicController res = new EffectLogicController(__level, ep);
            res._objects = new GameObject[ep._effectItems.Length];
            for (int i = 0; i < ep._effectItems.Length; i++)
            {
                EffectParameters.EffectItem item = ep._effectItems[i];
                switch (item._type)
                {
                    case EffectItemType.Object:
                        {
                            GameSimpleObject effectObject = new GameSimpleObject(ep._effectItems[i]._parameters["objectName"].ToString(), __level);
                            effectObject._object.SetGlobalPose(Matrix.CreateBillboard(__position + __normal * 0.02f, __position + __normal * 20, Vector3.Up, -__normal), true);
                            res._objects[i] = effectObject;
                        } break;
                    //TODO: other cases
                    case EffectItemType.Billboard:
                        {

                        }break;
                    case EffectItemType.ConstrainedBillboard:
                        {

                        } break;
                    case EffectItemType.Particles:
                        {
                            float size = Convert.ToSingle((ep._effectItems[i]._parameters["size"] as string).Replace('.', ','));
                            int count = Convert.ToInt32((ep._effectItems[i]._parameters["count"] as string).Replace('.',','));
                            float dispersion = Convert.ToSingle((ep._effectItems[i]._parameters["dispersion"] as string).Replace('.',','));
                            float gravity = Convert.ToSingle((ep._effectItems[i]._parameters["gravity"] as string).Replace('.',','));
                            float angledisp = Convert.ToSingle((ep._effectItems[i]._parameters["angledisp"] as string).Replace('.', ','));
                            float speed = Convert.ToSingle((ep._effectItems[i]._parameters["speed"] as string).Replace('.', ','));
                            float speeddisp = Convert.ToSingle((ep._effectItems[i]._parameters["speeddisp"] as string).Replace('.', ','));
                            GameParticleObject effectObject = new GameParticleObject(
                                ep._effectItems[i]._parameters["objectName"] as string,
                                __level,
                                new Vector3(size),
                                count,
                                __normal,
                                dispersion,
                                gravity,
                                angledisp,
                                speed,
                                speeddisp,
                                item._lifeTime);

                            effectObject._object.SetGlobalPose(Matrix.CreateTranslation(__position), true);
                            res._objects[i] = effectObject;
                        } break;
                }
            }
            return res;
        }
Exemplo n.º 4
0
        public CharacterLogicController(GameLevel __level, GameCharacter __hisObject, GameSimpleObject __hisHead, bool __isMe = false)
            : base(__level)
        {
            _hisHead = __hisHead;
            _hisObject = __hisObject;

            _isAlive = false;
            _isMe = __isMe;

            _hisObject._levelObject._needMouseCast = _hisObject._levelObject._needMouseCast && !_isMe;
            _hisHead._object._needMouseCast = _hisHead._object._needMouseCast && !_isMe;
            _hisObject._levelObject._gameObject = this;
        }
Exemplo n.º 5
0
        public TheGame(MyGame __game)
        {
            _engine = new GameEngine(__game);
            _staticData = StaticObjects.Instance();
            _level = new GameLevel(_engine.gameScene);

            _characters = new Dictionary<string, CharacterLogicController>();
               // _weapons = new Dictionary<string, WeaponLogicController>();

            _hotkeys = new List<HotKey>();
            _hotkeys.Add(new HotKey(new Keys[] { Keys.I }, SwichGunState));

            KeyboardManager.Manager.AddKeyboardUser(this);
        }
Exemplo n.º 6
0
 public GameSimpleObject(string __objectName, GameLevel __level, Engine.Logic.PivotObjectDependType __dependType = PivotObjectDependType.Body, bool __mouseRC = false, bool __bulletRC = false)
     : base(__level, __mouseRC, __bulletRC)
 {
     _object = Engine.GameEngine.LoadObject(__objectName, null, __mouseRC, __bulletRC, __dependType) as LevelObject;
 }
Exemplo n.º 7
0
 public BaseLogicController(GameLevel __level)
 {
     _itsLevel = __level;
     _itsLevel.AddController(this);
     _id = IdGenerator.StaticGenerator.NewId();
 }
Exemplo n.º 8
0
 public EffectLogicController(GameLevel __level, EffectParameters __parameters)
     : base(__level)
 {
     _baseParameters = __parameters;
 }