Example #1
0
 static int SetValue(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         ProgressSprite obj  = (ProgressSprite)ToLua.CheckObject(L, 1, typeof(ProgressSprite));
         float          arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.SetValue(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #2
0
    static int set__progress(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ProgressSprite         obj  = (ProgressSprite)o;
            UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 2, typeof(UnityEngine.GameObject));
            obj._progress = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index _progress on a nil value" : e.Message));
        }
    }
Example #3
0
    static int get__mode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ProgressSprite obj = (ProgressSprite)o;
            ProgressSprite.ProgressMode ret = obj._mode;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index _mode on a nil value" : e.Message));
        }
    }
Example #4
0
    static int get__progress(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ProgressSprite         obj = (ProgressSprite)o;
            UnityEngine.GameObject ret = obj._progress;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index _progress on a nil value" : e.Message));
        }
    }
Example #5
0
    static int set__mode(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            ProgressSprite obj = (ProgressSprite)o;
            ProgressSprite.ProgressMode arg0 = (ProgressSprite.ProgressMode)ToLua.CheckObject(L, 2, typeof(ProgressSprite.ProgressMode));
            obj._mode = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index _mode on a nil value" : e.Message));
        }
    }
Example #6
0
        /// <summary>
        ///
        /// </summary>
        public GameModel()
        {
            GameModel.XDistanceBetweenSprites    = 100;
            GameModel.YDistanceBetweenSprites    = 300;
            GameModel.YDistanceBetweenStars      = 50;
            GameModel.YDistanceBetweenStars      = 200;
            GameModel.YDistanceBetweenBlueStars  = 50;
            GameModel.YDistanceBetweenSmallStars = 200;
            GameModel.LeftDisplayBorder          = 50;
            GameModel.RightDisplayBorder         = 200;
            GameModel.BottomDisplayBorder        = 140;

            _background = new Background();

            _enemies[0] = new Enemy1(4, 3);
            _enemies[1] = new Enemy2(4, 3);
            _enemies[2] = new Enemy3(4, 3);
            _enemies[3] = new Enemy4(4, 3);

            _spaceShip = new AnimatedSprite(5, 4);

            for (int i = 0; i < _meteors.Length; i++)
            {
                _meteors[i] = new Meteor(9, 8);
            }

            for (int i = 0; i < _stars.Length; i++)
            {
                _stars[i]       = new Star(15, 7);
                _stars[i].Speed = new Vector2(0, 0.5f);
            }

            for (int i = 0; i < _fastStars.Length; i++)
            {
                _fastStars[i]       = new Star(15, 10);
                _fastStars[i].Speed = new Vector2(0, 1f);
            }

            _InitializeLives();

            _progress = new ProgressSprite();
        }