示例#1
0
        protected override void Initialize()
        {
            // Sample texture, 1x1 pixel for testing.
            simpleTexture = new Texture2D(GraphicsDevice, 1, 1);
            simpleTexture.SetData(new[] { Color.White });

            // Initializes the accelerometer.
            initializeAccelerometer();

            // Databases
            tileDatabase = new TileDatabase();
            roomDatabase = new RoomDatabase();

            // Handlers
            songHandler      = new SongHandler();
            inventoryHandler = new InventoryHandler();
            eventHandler     = new EventHandler();
            locationHandler  = new LocationHandler();

            // Objects
            mapDefinition   = new Map();
            sadakoReference = new Sadako();
            playerReference = new Player();

            // M! game profiler for FPS and other related stuff
#if DEBUG
            Components.Add(new GameProfiler(this, Content));
#endif

            base.Initialize();
        }
示例#2
0
        public void PreparePlayer(Texture2D playerTextureGet, Texture2D buttonTexture, Vector2 positionGet, Texture2D lightTextureGet, Texture2D noLightTextureGet, Texture2D filmTextureGet, SongHandler songGet, LocationHandler locationHandler, InventoryHandler inventoryHandler)
        {
            inventory        = inventoryHandler;
            location         = locationHandler;
            songs            = songGet;
            playerTexture    = playerTextureGet;
            lightTexture     = lightTextureGet;
            noLightTexture   = noLightTextureGet;
            filmTexture      = filmTextureGet;
            position         = positionGet;
            life             = maxLife;
            hitBox           = new Rectangle(0, 0, 30, 30);
            flashLightHitbox = new Rectangle(0, 0, 150, 150);
            shadowHitBox     = new Rectangle(0, 0, 150, 150);
            presenceBox      = new Rectangle(0, 0, 90, 90);
            Vector2 buttonPosition = new Vector2(480, 160);

            playerController = new PlayerController(buttonTexture, this, location);
            direction        = new Vector2(0, 0);
            isFlashLightOn   = true;
            songs.playAmbient();
        }
示例#3
0
        public void Initialize(ContentManager Content, Vector2 startingPosition, Texture2D simpleTexture, SongHandler songHandler, LocationHandler locationHandler, InventoryHandler inventoryHandler)
        {
            // Load the content
            Texture2D lightTexture   = Content.Load <Texture2D>("light");
            Texture2D noLightTexture = Content.Load <Texture2D>("nolight");
            Texture2D filmTexture    = Content.Load <Texture2D>("film");
            Texture2D playerTexture  = Content.Load <Texture2D>("player");
            Texture2D buttonTexture  = Content.Load <Texture2D>("joystickhead");

            // TODO: Load the player's textures
            PreparePlayer(simpleTexture, buttonTexture, startingPosition, lightTexture, noLightTexture, filmTexture, songHandler, locationHandler, inventoryHandler);
        }
示例#4
0
 public void PreparePlayer(Texture2D playerTextureGet, Texture2D buttonTexture,Vector2 positionGet,Texture2D lightTextureGet,Texture2D noLightTextureGet, Texture2D filmTextureGet, SongHandler songGet, LocationHandler locationHandler, InventoryHandler inventoryHandler)
 {
     inventory = inventoryHandler;
     location = locationHandler;
     songs = songGet;
     playerTexture = playerTextureGet;
     lightTexture = lightTextureGet;
     noLightTexture = noLightTextureGet;
     filmTexture = filmTextureGet;
     position = positionGet;
     life = maxLife;
     hitBox = new Rectangle(0,0,30,30);
     flashLightHitbox = new Rectangle(0, 0, 150, 150);
     shadowHitBox = new Rectangle(0, 0,150, 150);
     presenceBox = new Rectangle(0, 0, 90, 90);
     Vector2 buttonPosition = new Vector2(480, 160);
     playerController = new PlayerController(buttonTexture,this,location);
     direction = new Vector2(0, 0);
     isFlashLightOn = true;
     songs.playAmbient();
 }
示例#5
0
        public void Initialize(ContentManager Content, Vector2 startingPosition, Texture2D simpleTexture, SongHandler songHandler, LocationHandler locationHandler, InventoryHandler inventoryHandler)
        {
            // Load the content
            Texture2D lightTexture = Content.Load<Texture2D>("light");
            Texture2D noLightTexture = Content.Load<Texture2D>("nolight");
            Texture2D filmTexture = Content.Load<Texture2D>("film");
            Texture2D playerTexture = Content.Load<Texture2D>("player");
            Texture2D buttonTexture = Content.Load<Texture2D>("joystickhead");

            // TODO: Load the player's textures
            PreparePlayer(simpleTexture, buttonTexture, startingPosition, lightTexture, noLightTexture, filmTexture, songHandler, locationHandler, inventoryHandler);
        }
示例#6
0
        protected override void Initialize()
        {
            // Sample texture, 1x1 pixel for testing.
            simpleTexture = new Texture2D(GraphicsDevice, 1, 1);
            simpleTexture.SetData(new[] { Color.White });

            // Initializes the accelerometer.
            initializeAccelerometer();

            // Databases
            tileDatabase = new TileDatabase();
            roomDatabase = new RoomDatabase();

            // Handlers
            songHandler = new SongHandler();
            inventoryHandler = new InventoryHandler();
            eventHandler = new EventHandler();
            locationHandler = new LocationHandler();

            // Objects
            mapDefinition = new Map();
            sadakoReference = new Sadako();
            playerReference = new Player();

            // M! game profiler for FPS and other related stuff
            #if DEBUG
            Components.Add(new GameProfiler(this, Content));
            #endif

            base.Initialize();
        }