España (Español)
Canada (English)
Canada (Français)
Deutschland (Deutsch)
España (Español)
France (Français)
Italia (Italia)
United Kingdom (English)
United States (English)
日本 (日本語)
Foros
Hola:
Visitante
Iniciar sesión
Inicio
Guía de inicio rápido
Noticias
Suscripción
Juegos
Catálogo de juegos
Enviar juego
Revisar juego
Probar juego
Creadores
Mi perfil
Mi empresa
Comunidad
Foros
Temas destacados en la comunidad
Recursos de la comunidad
Educación
Introducción
Catálogo de contenido sobre educación
Packs de inicio
Utilidades
Recursos
Preguntas más frecuentes
Socios
Descargar
Comentarios
Sitio de prensa
foros de la comunidad
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 21/09/2009 20:43 by
Daniel Hanson
. 3 replies.
17/09/2009 23:32
ChrisCrawford
(0)
premium membership
Posts
2
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.
17/09/2009 23:54
In reply to
Daniel Hanson
(1152)
premium membership
Posts
687
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
21/09/2009 12:16
In reply to
zanders
(160)
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
21/09/2009 20:43
In reply to
Daniel Hanson
(1152)
premium membership
Posts
687
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
© 2009 Microsoft Corporation. Reservados todos los derechos.
Condiciones de uso
Declaración de privacidad
Código de conducta
Comentarios