public void Lancer() { while (mContinuer) { mFenetre.DispatchEvents(); if (Keyboard.IsKeyPressed(Keyboard.Key.Escape)) { mContinuer = false; break; } else if (Keyboard.IsKeyPressed(Keyboard.Key.Left) && mToucheActive) { Start(); pos--; if (pos == -1) { pos = 11; } mRegle = Ins.GetSpriteRegles((TypeRegles)pos); mRegle.Position = new Vector2f(0, 0); float X = (float)VideoMode.DesktopMode.Width / (float)mRegle.Texture.Size.X; float Y = (float)VideoMode.DesktopMode.Height / (float)mRegle.Texture.Size.Y; mRegle.Scale = new Vector2f(X, Y); } else if (Keyboard.IsKeyPressed(Keyboard.Key.Right) && mToucheActive) { Start(); pos++; if (pos == 12) { pos = 0; } mRegle = Ins.GetSpriteRegles((TypeRegles)pos); mRegle.Position = new Vector2f(0, 0); float X = (float)VideoMode.DesktopMode.Width / (float)mRegle.Texture.Size.X; float Y = (float)VideoMode.DesktopMode.Height / (float)mRegle.Texture.Size.Y; mRegle.Scale = new Vector2f(X, Y); } Dessiner(); } }
public Regles() { Ins = RessourceGraphique.Instance; mFenetre = Ins.Fenetre; mRegle = Ins.GetSpriteRegles((TypeRegles)pos); mRegle.Position = new Vector2f(0, 0); float X = (float)VideoMode.DesktopMode.Width / (float)mRegle.Texture.Size.X; float Y = (float)VideoMode.DesktopMode.Height / (float)mRegle.Texture.Size.Y; mRegle.Scale = new Vector2f(X, Y); }