private Image RenderObject(GameState state, InGameObject gameObject, IGameObjectRenderer renderer) { if (renderer == null) { return(renderersSet.MissedTextureFactory.Invoke(gameObject.ObjectParameters.Size)); } var ticksPerFrame = (int)(InitialTicksPerFrame / Math.Sqrt(Math.Sqrt(state.Speed))); var frameNum = (int)(gameObject.LifetimeTicks % (ulong)(renderer.Frames.Length * ticksPerFrame)) / ticksPerFrame; return(renderer.Frames[frameNum]); }
public LikeRogue(IGameObjectRenderer renderer) { _renderer = renderer; }