public static void Setup(IAssetLibrary assetLibrary, GameSpecification specification, GraphicsDeviceManager graphics, string devContentPath) { SoundEffectPlayer = new SoundEffectPlayer(specification.settings); Assets = assetLibrary; FileSystem = new MachinaFileSystem(specification.gameTitle, devContentPath); Graphics = graphics; }
public MachinaRuntime(MachinaGame game, GameSpecification specification, IPlatformContext platformContext, Painter painter) { this.specification = specification; this.game = game; this.platformContext = platformContext; this.Painter = painter; }
public void Setup(MachinaRuntime runtime, GameSpecification specification) { if (!this.hasBeenSetup) { BuildSceneLayers(runtime); CurrentGameCanvas.BuildCanvas(runtime.Painter); runtime.platformContext.OnCartridgeSetup(this, runtime.WindowInterface); runtime.WindowInterface.Resized += (size) => CurrentGameCanvas.SetWindowSize(size); OnGameLoad(specification, runtime); this.hasBeenSetup = true; } }
public MachinaGame(GameSpecification specification, GameCartridge gameCartridge, IPlatformContext platformContext, string devContentPath = "") { this.specification = specification; this.gameCartridge = gameCartridge; this.platformContext = platformContext; Content.RootDirectory = "Content"; var graphics = new GraphicsDeviceManager(this) { HardwareModeSwitch = false }; MachinaClient.Setup(new AssetLibrary(this), this.specification, graphics, devContentPath); this.platformContext.OnGameConstructed(this); }
/// <summary> /// This is executed right after the loading screen finishes. This is your "Main" function. /// </summary> /// <param name="specification"></param> /// <param name="runtime"></param> public abstract void OnGameLoad(GameSpecification specification, MachinaRuntime runtime);