Beispiel #1
0
        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]);
        }
Beispiel #2
0
 public LikeRogue(IGameObjectRenderer renderer)
 {
     _renderer = renderer;
 }