public BuracoDeCor(Cena cena, float posicaoX, float posicaoY) : base(Assets.buraco, new Vector2(posicaoX * MyGame.instance.GraphicsDevice.Viewport.Width, posicaoY * MyGame.instance.GraphicsDevice.Viewport.Height), cena) { escala = new Vector2(escalaX * MyGame.instance.GraphicsDevice.Viewport.Width / frameSize.X, escalaY * MyGame.instance.GraphicsDevice.Viewport.Height / frameSize.Y); }
public Fila(Cena cena, int indice) : base(Assets.fila, new Vector2(posicaoX * MyGame.instance.GraphicsDevice.Viewport.Width, (1 + indice)/13f * MyGame.instance.GraphicsDevice.Viewport.Height), cena) { indexCor = 0; indexCorrecao = 0; escala = new Vector2(escalaX * MyGame.instance.GraphicsDevice.Viewport.Width / frameSize.X, escalaY * MyGame.instance.GraphicsDevice.Viewport.Height / frameSize.Y); if (indice != 11) { for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { correcao[i, j] = new BuracoDeCorrecao(cena, posicaoX + escalaX * (7 + 2 * j) / 20, (3 + i * 2 + indice * 4) / 52f); cena.RegistarAnimacao(correcao[i, j], 2); } } } else sequence = true; for (int i = 0; i < 4; i++) { cores[i] = new BuracoDeCor(cena, 1 / 8f + 3 / 40f + (i * 3 / 20f), (1 + indice) / 13f); cena.RegistarAnimacao(cores[i], 3); if (indice == 11 && MyGame.instance.player == 2) this.textura = null; } }
public Animacao(Texture2D textura, Vector2 posicao, int colunas, int linhas, float frameDuration, Cena cena) { this.textura = textura; this.colunas = colunas; if (colunas > 1 || frameDuration <= 0) updatable = true; this.linhas = linhas; frameSize = new Vector2(textura.Width / colunas, textura.Height / linhas); origem = frameSize / 2; escala = Vector2.One; SetCenter(posicao); this.frameDuration = frameDuration; this.spriteBatch = MyGame.instance.SpriteBatch; this.cena = cena; }
public Tabuleiro(Cena cena) : base(Assets.wood, new Vector2(0.5f * MyGame.instance.GraphicsDevice.Viewport.Width, 0.5f * MyGame.instance.GraphicsDevice.Viewport.Height), cena) { for (int i = 0; i < 10; i++) { filas[i] = new Fila(cena, i); cena.RegistarAnimacao(filas[i], 1); } sequencia = new Fila(cena, 11); cena.RegistarAnimacao(sequencia, 1); //escala = new Vector2(MyGame.instance.GraphicsDevice.Viewport.Width / frameSize.X, // MyGame.instance.GraphicsDevice.Viewport.Height / frameSize.Y); escala = new Vector2(1,1); }
public Animacao(Texture2D textura, Vector2 posicao, Cena cena) : this(textura, posicao, 1, 1, 0, cena) { }
protected override void LoadContent() { instance = this; cenaAtual = SplashScene.instance = new SplashScene(); }
public void Restart() { gaming = false; CenaAtual = SplashScene.instance; }