public static bool PlayerAndTextureCollision(Vector3 playerPos, BoardTexture tex, bool playerDuck) { // If we had been in the determination per plate if if (playerPos.Z <= tex.PosZ + tex.scaleZ && playerPos.Z >= tex.PosZ - tex.scaleZ) { if (playerDuck) { // Check whether the hit in the Box if (Collision.BoundingBox2D(new Vector2(playerPos.X, playerPos.Y), Vector2.One * 0.1f, new Vector2(tex.Pos.X, tex.Pos.Y), new Vector2(tex.Scale.X, tex.Scale.Y))) { // (Not against the wall), which is hitting the texture return false; } } // (And against the walls) that do not hit the texture return true; } // Is not in contact with the wall return false; }
//--------------------------// // 関数名 InitShadow // // Function name InitShadow // 機能 影の初期化 // // Initialization function of shadow // 引数 なし // // No argument // 戻り値 なし // // No return value //--------------------------// private void InitShadow() { // Instantiation of shadow shadow = new BoardTexture(); // Initialization of shadow shadow.Pos = new Vector3(player.PosX, -1.0f, player.PosZ); shadow.Scale = Vector3.One * 2.0f; shadow.rotationX = -90.0f; shadow.alpha = 0.5f; }