Example #1
0
        public void Initalize(bool _headless)
        {
            // Game
            this.Runner          = new Interpreter(this);
            this.GlobalScope     = new LInstance(this, (double)LVariableScope.Global);
            this.StaticScope     = new LInstance(this, (double)LVariableScope.Static);
            this.CurrentColor    = LColour.FromColor4(Color4.White);
            this.CirclePrecision = 24;

            // Window
            this.Headless = _headless;
            if (_headless == false)
            {
                this.Window              = new GameWindow(this.RoomWidth, this.RoomHeight);
                this.Window.Icon         = System.Drawing.Icon.ExtractAssociatedIcon(System.Reflection.Assembly.GetEntryAssembly().Location); // meh (big meh -sanae)
                this.Window.Title        = this.DisplayName;
                this.Window.Load        += OnLoad;
                this.Window.Closing     += OnClose;
                this.Window.UpdateFrame += OnUpdate;
                this.Window.RenderFrame += OnRender;
                Input.Initalize(this);
                this.Window.Run();
                VM.Timer.Start();
            }
            else
            {
                OnLoad(null, null);
            }
        }
Example #2
0
        public LRoomInstance(Game _assets, BinaryReader _reader)
        {
            this.X     = _reader.ReadInt32();
            this.Y     = _reader.ReadInt32();
            this.Index = _assets.ObjectMapping[_reader.ReadInt32()];
            this.ID    = _reader.ReadInt32();
            Int32 _creationIndex = _reader.ReadInt32();

            if (_creationIndex != -1)
            {
                this.CreationCode = _assets.CodeMapping[_creationIndex];
            }
            else
            {
                CreationCode = null;
            }
            this.ScaleX     = _reader.ReadSingle();
            this.ScaleY     = _reader.ReadSingle();
            this.ImageSpeed = _reader.ReadSingle();
            this.ImageIndex = _reader.ReadInt32();
            this.ImageBlend = new LColour(_reader.ReadInt32());
            this.Rotation   = _reader.ReadSingle();
            Int32 _createIndex = _reader.ReadInt32();

            if (_createIndex != -1)
            {
                this.PreCreate = _assets.CodeMapping[_createIndex];
            }
            else
            {
                this.PreCreate = null;
            }
        }