コード例 #1
0
        public void update(GameTime gameTime, TouchCollection locations)
        {
            if (!sadako.grabbed)
            {
                playerController.update(gameTime, location.getCurrentRoom(), locations);
            }

            flashLightHandler();
            shadowHandler();
            filmHandler();

            // DARREN! Put an offset of -15 for the orientation
            hitBox.X = (int)position.X - 15;
            hitBox.Y = (int)position.Y - 15;

            flashLightHitbox.X  = (int)flashLightLocation.X;
            flashLightHitbox.Y  = (int)flashLightLocation.Y;
            shadowHitBox.X      = (int)shadowLocation.X;
            shadowHitBox.Y      = (int)shadowLocation.Y;
            presenceBox.X       = (int)position.X - 40;
            presenceBox.Y       = (int)position.Y - 40;
            filmLocation        = new Vector2(400 - rand.Next(-50, 50), 240 - rand.Next(-50, 50));
            filmDegree          = MathHelper.ToRadians(rand.Next(-180, 180));
            flashLightIntensity = location.currentRoom.getFlashlight();
            // darren: check if player has left hiding spot
            if (currentHidingSpot != null && !currentHidingSpot.getHitBox().Intersects(hitBox))
            {
                isHidden = false;
                currentHidingSpot.setActivated(false);
            }
            wayPointHandler(gameTime);
        }
コード例 #2
0
 private void wallCheckHandler()
 {
     wallCollide = false;
     foreach (Rectangle rect in location.getCurrentRoom().getWalls())
     {
         if (rect.Intersects(hitBox))
         {
             wallCollide = true;
         }
     }
 }
コード例 #3
0
        private void ObjectInitializations()
        {
            // Sadako starting position
            Vector2 sadakoStartingPosition = new Vector2(240, -300);
            // Player starting position
            Vector2 startingPosition = new Vector2(400, 180);


            playerReference.Initialize(Content, startingPosition, simpleTexture, songHandler, locationHandler, inventoryHandler);
            sadakoReference.Initialize(Content, sadakoStartingPosition, songHandler, playerReference, locationHandler);

            Entity.Initialize(Content);
            Item.Initialize(Content);


            // HARD CODE: Sadako hard code to teleport to current room
            sadakoReference.teleport(locationHandler.getCurrentRoom());
        }