예제 #1
0
 public void Initialize(ContentManager Content, Vector2 sadakoStartingPosition, SongHandler songHandler, Player playerReference, LocationHandler locationHandler)
 {
     Texture2D sadakoTexture = Content.Load<Texture2D>("image");
     Texture2D grabTexture = Content.Load<Texture2D>("waifu");
     Texture2D bloodTexture = Content.Load<Texture2D>("blood");
     PrepareSadako(new Vector2(240, -300), sadakoTexture, playerReference, songHandler, grabTexture, bloodTexture, locationHandler);
 }
예제 #2
0
 public Item(ItemType typeGet, Player playerGet, Sadako sadakoGet, Rectangle hitBoxGet)
 {
     type = typeGet;
     player = playerGet;
     sadako = sadakoGet;
     hitBox = hitBoxGet;
 }
예제 #3
0
 public override Boolean Touch(Player p)
 {
     if (base.Touch(p))
     {
         // TODO: Add noise to player
     }
     return false;
 }
예제 #4
0
 public ShadowHandler(Texture2D textureGet, Player playerGet, Vector2 positionGet, Texture2D squareTextureGet)
 {
     texture = textureGet;
     player = playerGet;
     position = positionGet;
     squareTexture = squareTextureGet;
     rectangle = new Rectangle((int)position.X,(int)position.Y,32,32);
 }
예제 #5
0
 public override void Update(GameTime gameTime, Player p)
 {
     elapsedTime += gameTime.ElapsedGameTime.Milliseconds;
     if (p.hitBox.Intersects(hitbox))
         currentDrawIndex = getIndex();
     else
         currentDrawIndex = sprite;
 }
예제 #6
0
 public void Initialize(Player playerGet, Sadako sadakoGet, Map mapGet, SongHandler songsGet, EventHandler eventsGet)
 {
     songs = songsGet;
     events = eventsGet;
     player = playerGet;
     sadako = sadakoGet;
     map = mapGet;
     currentLocation = new Vector2(0, 0);
     currentRoom = map.getRoom(currentLocation);
     sadakoRoom = currentRoom;
     sadako.disable = true;
     entryPoint = player.position;
 }
예제 #7
0
        public new void Interact(Player p)
        {
            if (itemStatus == ItemStatus.OnFloor && hitbox.Intersects(p.hitBox))
            {
                // Show image of item first
            }
            else if (itemStatus == ItemStatus.OnHand)
            {
                // Interacting again should close
            }
            else if (itemStatus == ItemStatus.InInventory)
            {

            }
        }
예제 #8
0
        public PlayerController(Texture2D textureGet, Player playerGet,LocationHandler locationGet)
        {
            texture = textureGet;
            location = locationGet;

            initialPosition = new Vector2(720, 400);
            currentPosition = new Vector2(720, 400);
            player = playerGet;
            totalPlayField = playFieldWidth + 40;
            controllerarea = new Rectangle(800 - 160, 480 - 150, 150, 150);
            buttonarea = new Rectangle(640, 270, 76, 60);

            flashLightArea = new Rectangle(650,200,75,70);
            flashLightPosition = new Vector2(650, 218);

            initializeBeat();
        }
예제 #9
0
 public void PrepareSadako(Vector2 positionGet, Texture2D sadakoTexture, Player playerGet, SongHandler songGet, Texture2D captureTexture, Texture2D bloodTextureGet, LocationHandler locationHandler) 
 {
     songs = songGet;
     position = positionGet;
     texture = sadakoTexture;
     player = playerGet;
     speed = lurkSpeed;
     hitBox = new Rectangle(0, 0, 30, 30);
     lurkHere = positionGet;
     direction = new Vector2(0, 0);
     player.sadako = this;
     wayPoints = new List<Vector2>();
     lurking = true;
     grabTexture = captureTexture;
     bloodTexture = bloodTextureGet;
     location = locationHandler;
 }
예제 #10
0
 public void Initialize(ContentManager Content, Texture2D bgGet, Sadako sadakoGet, Player playerGet)
 {
     headTurn = Content.Load<Texture2D>("facebacksheet");
     falling = Content.Load<Texture2D>("falling");
     falldown = Content.Load<Texture2D>("falldown");
     backgroundTexture = Content.Load<Texture2D>("peek");
     sadakoFar = Content.Load<Texture2D>("sadakoFar");
     sadakoFarNone = Content.Load<Texture2D>("sadakoFarNone");
     headLeft = Content.Load<Texture2D>("headLeft");
     bodyRight = Content.Load<Texture2D>("bodyRight");
     headRight = Content.Load<Texture2D>("headRight");
     bodyLeft = Content.Load<Texture2D>("bodyLeft");
     cabinetPeek = Content.Load<Texture2D>("cabinetPeek");
     bg = bgGet;
     sadako = sadakoGet;
     player = playerGet;
     sadako.setEvent(this);
 }
예제 #11
0
 public void Interact(Player p)
 {
 }
예제 #12
0
 public override void Interact(Player p)
 {
     base.Interact(p);
 }
예제 #13
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();
        }
예제 #14
0
        /// <summary>
        /// This initializes a new map given a rectangle which has
        /// the starting X and Y locations of the player and the 
        /// width and size of the map (not the room).
        /// </summary>
        /// <param name="init"></param>
        public void Initialize(Game game, Player playerReference, ContentManager Content, Rectangle init, Texture2D tileTexture, List<Texture2D> mapDebuggingTextures, RoomDatabase roomDatabaseReference, TileDatabase tileDatabaseReference)
        {
            gameReference = game;
            this.shadowTexture = Content.Load<Texture2D>("shadow");
            this.playerReference = playerReference;
            mapDefinition = init;
            debugTextures = mapDebuggingTextures;
            this.roomDatabaseReference = roomDatabaseReference;
            // Generate rooms
            int width = init.Width;
            int height = init.Height;
            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    Room r = new Room(gameReference, x, y, shadowTexture, tileDatabaseReference, playerReference, tileTexture);
                    listOfRooms.Add(r);

#if !KRUSKAL
                    r.Initialize();
#else
                    kruskalRooms.Add(r);
                    
                    // In Kruskal's, each room has a set of their own.
                    List<Room> list = new List<Room>();
                    list.Add(r);
                    sets.Add(list);
#endif

                }
            }

            // Generate maze
            int destination_x = random.Next(width);
            int destination_y = random.Next(height);
            endLocation.X = destination_x;
            endLocation.Y = destination_y;
#if KRUSKAL
            generateMaze();
#else
            generateMaze(destination_x, destination_y, null);
#endif

        }
예제 #15
0
 public virtual void Interact(Player p)
 {
 }
예제 #16
0
        public void Initialize(Player player,Sadako sadako, ContentManager Content)
        {
            backgroundTexture = Content.Load<Texture2D>("horror_inventoryScreen");
            itemTexture = Content.Load<Texture2D>("itemlist");
            itemGetTexture = Content.Load<Texture2D>("itemget");
            this.player = player;
            this.sadako = sadako;

            rectGet = new Rectangle(0, 330, 150, 150);
            // debug disabled D!
            //itemGet = new Item(ItemType.HealingSalve, player, sadako);
            vSlot1 = new Vector2(-250, 75);
            vSlot2 = new Vector2(-250, 75);
            vSlot3 = new Vector2(-250, 75);
            vSlot4 = new Vector2(-250, 220);
            vSlot5 = new Vector2(-250, 220);
            vSlot6 = new Vector2(-250, 220);

            rSlot1 = new Rectangle(-250, 75, 150, 150);
            rSlot2 = new Rectangle(-250, 75, 150, 150);
            rSlot3 = new Rectangle(-250, 75, 150, 150);
            rSlot4 = new Rectangle(-250, 220, 150, 150);
            rSlot5 = new Rectangle(-250, 220, 150, 150);
            rSlot6 = new Rectangle(-250, 220, 150, 150);
        }
예제 #17
0
        /****************
         * Methods
         ****************/

        public Room(Game game, int X, int Y, Texture2D shadowTexture, TileDatabase tileDatabaseReference, Player playerReference, Texture2D tileTexture)
            : base(game)
        {
            gameReference = game;
            location.X = X;
            location.Y = Y;
            this.shadowTexture = shadowTexture;
            this.playerReference = playerReference;
            this.tileDatabaseReference = tileDatabaseReference;
            this.tileTexture = tileTexture;
            Random r = new Random();
            roomBrightnessType = r.Next(10);
            if (roomBrightnessType >= 4)
                roomBrightnessType = REGULAR;
            else if (roomBrightnessType >= 2)
                roomBrightnessType = DARKER;
            else
                roomBrightnessType = BRIGHT;

        }
예제 #18
0
 public virtual void Update(GameTime gameTime, Player p)
 {
     /*
     elapsedMilliseconds += gameTime.ElapsedGameTime.Milliseconds;
     if (elapsedMilliseconds > 2000)
     {
         currentDrawIndex = (currentDrawIndex == 0) ? 1 : 0;
         elapsedMilliseconds = 0;
     }
      */
 }
예제 #19
0
 public virtual Boolean Touch(Player p)
 {
     if (isActivated) return false;
     else if (p.hitBox.Intersects(hitbox))
     {
         currentDrawIndex = activatedDrawIndex;
         return isActivated = true;
     }
     return false;
 }
예제 #20
0
        public virtual void Interact(Player p)
        {
            if (magnetHitBox.Intersects(p.hitBox))
            {
                // Current location of player
                Vector2 player = p.position;
                // Center the player in the hiding spot
                Vector2 destination = new Vector2(position.X + 32, position.Y + 48);
                isActivated = true;

                if (elapsedTime >= 1500)
                {
                    p.position = destination;
                    p.isHidden = true;
                    elapsedTime = 0;
                }
                else
                {

                    Vector2 force = Vector2.Zero;
                    if (player.X < destination.X)
                        force.X += magnetPulseMagnitude;
                    else
                        force.X -= magnetPulseMagnitude;

                    if (player.Y < destination.Y)
                        force.Y += magnetPulseMagnitude;
                    else
                        force.Y -= magnetPulseMagnitude;

                    p.position += force;
                }
            }
            else if (isActivated)
            {
                isActivated = false;
                p.isHidden = false;
                elapsedTime = 0;
            }
        }
예제 #21
0
 public override void Interact(Player p)
 {
     // Beds cannot be used.
     // base.Interact(p);
 }