/// <summary> /// This is called when the game should draw itself. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(Color.DarkGray); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.AnisotropicClamp, DepthStencilState.Default, RasterizerState.CullCounterClockwise, null, Camera.Transform); for (int i = 0; i < WeightSistems.Count; i++) { if (WeightSistems[i] != null) { WeightSistems[i].Draw(spriteBatch, gameTime); } } Graf.Draw(spriteBatch, gameTime, GraphicsDevice); New.Draw(spriteBatch, gameTime); ClearAll.Draw(spriteBatch, gameTime); ResetAll.Draw(spriteBatch, gameTime); spriteBatch.End(); // TODO: Add your drawing code here base.Draw(gameTime); }
public override void __Init__() { base.__Init__(); this.Allocate = this.__Factory__.Get <Allocate>(typeof(Microsoft.Quantum.Intrinsic.Allocate)); this.Release = this.__Factory__.Get <Release>(typeof(Microsoft.Quantum.Intrinsic.Release)); this.ResetAll = this.__Factory__.Get <ResetAll>(typeof(Microsoft.Quantum.Intrinsic.ResetAll)); }
public PrettyForm() { InitializeComponent(); KeyPreview = true; buttonExit.Click += (s, e) => Close(); buttonRun.Click += (s, e) => AutoStart?.Invoke(s, e); buttonStop.Click += (s, e) => AutoStop?.Invoke(s, e); buttonReset.Click += (s, e) => ResetAll?.Invoke(s, e); buttonStep.Click += (s, e) => OneStep?.Invoke(s, e); }
/// <summary> /// Allows the game to run logic such as updating the world, /// checking for collisions, gathering input, and playing audio. /// </summary> /// <param name="gameTime">Provides a snapshot of timing values.</param> protected override void Update(GameTime gameTime) { if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) { Exit(); } MouseState = Mouse.GetState(); KeyboardState = Keyboard.GetState(); New.Update(gameTime); ClearAll.Update(gameTime); ResetAll.Update(gameTime); if (!GoneFullScreen && KeyboardState.IsKeyDown(Keys.F12)) { GoneFullScreen = true; graphics.PreferredBackBufferWidth = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width; graphics.PreferredBackBufferHeight = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height; graphics.ToggleFullScreen(); graphics.ApplyChanges(); } Camera.UpdateCamera(GraphicsDevice.Viewport); MousePosition = Vector2.Transform(MouseState.Position.ToVector2(), Matrix.Invert(Camera.Transform)); for (int i = 0; i < Program.Executing.Count; i++) { if (Program.Executing[i] != null) { Program.Executing[i](); } } TimeSinceLastUpdate += gameTime.ElapsedGameTime.TotalMilliseconds; /*if (TimeSinceLastUpdate > 100 || true) * {*/ for (int i = 0; i < WeightSistems.Count; i++) { if (WeightSistems[i] != null) { WeightSistems[i].Update(gameTime); } } //} Graf.Update(gameTime); base.Update(gameTime); }
// Use this for initialization void Start() { theResetAll = FindObjectOfType <ResetAll>(); // TO LOCK (EXCEPT LVL -1) ALL THE LEVELS BEFOR EXPORT THE GAME // DeleteAll(); if (ButtonSetting.releaseLevelStatic >= level) { LevelUnlocked(); } else { LevelLocked(); } }
public static void OnResetAll() { ResetAll?.Invoke(); }
void Start() { instance = this; }
private void ResetAll_TSM_Click(object sender, EventArgs e) { ResetAll?.Invoke(); }
void RaiseResetAll() { ResetAll?.Invoke(); }