Hi, I managed to compile a poker game in visual studio in which to animate the dealing of cards I used a timer in the designer. Alas, in XNA this doesnt seem to be an option (as far as im aware).
When I run this all cards appear on screen at the same time, not very realistic.
How do I create a timer to draw the cards at seperate intervals?
//playercard contains card images Texture2D[] playercard = new Texture2D[4]; SpriteBatch[] playcard = new SpriteBatch[4]; { GraphicsDevice.Clear( spriteBatch.Begin( { playcard[i].Begin( } { playcard[i].Draw(playercard[i], cardposition = cardposition + 100; } cardposition = 550; { playcard[i].Draw(playercard[i], cardposition = cardposition + 100; } for (int i = 0; i < 2; i++) new Vector2(cardposition, 50), Color.White); for (int i = 2; i < 4; i++) new Vector2(cardposition, 300), Color.White); protected override void Draw(GameTime gameTime) Color.CornflowerBlue); SpriteBlendMode.AlphaBlend); for (int i = 0; i < 4; i++) SpriteBlendMode.AlphaBlend);
You don't need the designer to add a timer, in fact adding one in the designer is kind of ridiculous. I can't see any reason why you can't use a timer in XNA, I just expect you need to create it in code.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)