United States (English)
Canada (English)
Canada (Français)
Deutschland (Deutsch)
España (Español)
France (Français)
Italia (Italia)
United Kingdom (English)
United States (English)
日本 (日本語)
Forums
Hi,
Visitor
Sign In
Home
Quick Start Guide
News
Membership
Games
Games Catalog
Submit Game
Review Game
Playtest Game
Creators
My Profile
My Business
Community
Forums
Community Spotlight
Community Resources
Education
Getting Started
Education Catalog
Starter Kits
Utilities
Academia
Developer Talk Series
Resources
FAQ
Partners
Download
Feedback
Press Site
Meet the Team
community forums
XNA Community Forums
»
General
»
Game Algorithms
»
Locking Frame Rate In 2D Tile Engine
More Search Options
|
My Discussions
|
Active Topics
|
Not Read
Page 1 of 1 (4 items)
Sort Posts:
Oldest to newest
Newest to oldest
Previous
Next
Locking Frame Rate In 2D Tile Engine
Last post 9/21/2009 8:43 PM by
Daniel Hanson
. 3 replies.
9/17/2009 11:32 PM
ChrisCrawford
(2)
premium membership
Posts
5
Locking Frame Rate In 2D Tile Engine
Reply
Quote
I'm curious as to what is the best (easiest?) way to lock the framerate in a 2d side-scroller using a tile engine. Ideally, I would like to lock both the Update() and Draw() methods at 30 updates a second. Any suggestions? Thanks in advance.
9/17/2009 11:54 PM
In reply to
Daniel Hanson
(1292)
premium membership
Posts
727
Re: Locking Frame Rate In 2D Tile Engine
Answer
Reply
Quote
The frame rate, by default, is already locked at 60 fps. No extra work is required.
Previously known as "Rainault".
Twitter -
me
,
Jade Vault Games
Announcing
ASCII Quest
, a Roguelike under development for Xbox LIVE Indie Games
9/21/2009 12:16 PM
In reply to
zanders
(0)
Posts
129
Re: Locking Frame Rate In 2D Tile Engine
Reply
Quote
You can change this by changing the Game.IsFixedTimeStep and Game.TargetElapsedTime in the Game() constructor.
To set the game to 30fps, do this in the game constructor:
this.TargetElapsedTime = new TimeSpan(0, 0, 0, 0, 32);
Graphics Programmer,Sandswept Studios.http://www.sandswept.net
9/21/2009 8:43 PM
In reply to
Daniel Hanson
(1292)
premium membership
Posts
727
Re: Locking Frame Rate In 2D Tile Engine
Reply
Quote
I would prefer this, as it is more readable.
this.TargetElapsedTime = TimeSpan.FromSeconds(1.0 / 30.0);
Previously known as "Rainault".
Twitter -
me
,
Jade Vault Games
Announcing
ASCII Quest
, a Roguelike under development for Xbox LIVE Indie Games
Page 1 of 1 (4 items)
Previous
Next
© 2010 Microsoft Corporation. All rights reserved.
Terms of Use
Privacy Statement
Code of Conduct
Feedback