Exemple #1
0
        public ColumnViewer(int screenWidth, int screenHeight, int columnCount, double heightDistanceRatio, EcholocationCycle echolocationCycle, EcholocationBeeper echolocationBeeper)
        {
            this.screenWidth         = screenWidth;
            this.screenHeight        = screenHeight;
            this.columnCount         = columnCount;
            this.columnWidthPixel    = screenWidth / columnCount;
            this.heightDistanceRatio = heightDistanceRatio;
            this.echolocationCycle   = echolocationCycle;
            this.echolocationBeeper  = echolocationBeeper;

            this.rectangleCache = new Rectangle[columnCount];
            for (int i = 0; i < columnCount; i++)
            {
                this.rectangleCache[i]       = new Rectangle();
                this.rectangleCache[i].Width = columnWidthPixel;
            }
        }
Exemple #2
0
        public AppController()
        {
            mainSurface = Video.SetVideoMode(screenWidth, screenHeight, false, false, isFullScreen, true);

            idealRayTracerResolution = RayTracer.GetValidResolution(idealRayTracerResolution, screenWidth);
            rayTracer = new RayTracer(idealRayTracerResolution, fov, rayDistanceResolution);
            this.echolocationBeeper = new EcholocationBeeper(new SoundBackgroundBeeper());

            world = new World(random, monsterCount);
            ai    = new Ai(random, world.SpritePool.Count);

            this.echolocationCycle = new EcholocationCycle(targetFps,
                                                           echolocationCycleLengthMs,
                                                           idealRayTracerResolution,
                                                           isEcholocationBounceBack,
                                                           echolocationScanPointCount,
                                                           isEcholocationMirrorScanPoint,
                                                           1.0);

            gameViewer           = new GameViewer3D(mainSurface, screenWidth, screenHeight, rayTracer.ColumnCount, world.SpritePool, rayTracer.Fov, random, world.Map, isSoundOn, echolocationCycle, echolocationBeeper);
            screenCenterPosition = new Point(screenWidth / 2, screenHeight / 2);
        }
Exemple #3
0
        public GameViewer3D(Surface mainSurface, int screenWidth, int screenHeight, int columnCount, SpritePool spritePool, int fov, Random random, AbstractMap map, bool isSoundOn, EcholocationCycle echolocationCycle, EcholocationBeeper echolocationBeeper)
        {
            this.mainSurface = mainSurface;
            this.isSoundOn   = isSoundOn;
            this.random      = random;
            minimap          = new MiniMap(screenWidth, screenHeight, map);

            this.screenWidth  = screenWidth;
            this.screenHeight = screenHeight;

            this.gradient = new Gradient(screenWidth, screenHeight * 2);

            columnViewer = new ColumnViewer(this.screenWidth, this.screenHeight, columnCount, heightDistanceRatio, echolocationCycle, echolocationBeeper);
        }