Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.70 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Diagnostics;
  4. using System.Windows;
  5. using Microsoft.Kinect;
  6. using System.Collections.Generic;
  7.  
  8. //SharpDX
  9. using SharpDX;
  10. using SharpDX.D3DCompiler;
  11. using SharpDX.Direct3D;
  12. using SharpDX.Direct3D11;
  13. using SharpDX.DXGI;
  14. using SharpDX.Windows;
  15. using Buffer = SharpDX.Direct3D11.Buffer;
  16. using Device = SharpDX.Direct3D11.Device;
  17. using MapFlags = SharpDX.Direct3D11.MapFlags;
  18. using Vector4 = SharpDX.Vector4;
  19.  
  20.  
  21. namespace SkeletonDrawing
  22. {
  23.     partial class Program
  24.     {
  25.        
  26.         private void check_gamestate(Skeleton skeleton)
  27.         {
  28.             switch (gamestate)
  29.             {
  30.                 case 0:
  31.                     Vector3 boxpos1 = new Vector3(skeleton.Position.X + 0.3f, skeleton.Position.Y + 0.3f, skeleton.Position.Z -3);
  32.                     Vector3 boxpos2 = new Vector3(skeleton.Position.X - 0.3f, skeleton.Position.Y + 0.3f, skeleton.Position.Z -3);
  33.                     makeCube(skeleton, 0.1f, boxpos1);
  34.                     makeCube(skeleton, 0.1f, boxpos2);
  35.                     if (isTouchingBox(skeleton, 0.1f, boxpos1))
  36.                     {
  37.                         gamestate = 1;
  38.                         f1 = 1;
  39.                         f2 = 1;
  40.                         f3 = 1;
  41.                     }
  42.                     if (isTouchingBox(skeleton, 0.1f, boxpos2))
  43.                         fader = 1;
  44.                     break;
  45.                 case 1:
  46.                 // Firefly Game
  47.                     Random rand = new Random();
  48.                     if (f1 == 1)
  49.                     {
  50.                         Vector3 firefly1 = new Vector3(skeleton.Position.X + (float)System.Math.Cos(time * 5), skeleton.Position.Y + 0.6f, -1*skeleton.Position.Z + (float)System.Math.Sin(time * 5));
  51.                         makeCube(skeleton, 0.1f, firefly1);
  52.                         if (isTouchingBox(skeleton, 0.1f, firefly1))
  53.                         {
  54.                             fader = 0.3f;
  55.                             f1 = 0;
  56.                         }
  57.                     }
  58.                     if (f2 == 1)
  59.                     {
  60.                         Vector3 firefly2 = new Vector3(skeleton.Position.X + (float)System.Math.Cos(time * 5), skeleton.Position.Y + 0.4f, -1* skeleton.Position.Z+ (float)System.Math.Sin(time * 5));
  61.                         makeCube(skeleton, 0.1f, firefly2);
  62.                         if (isTouchingBox(skeleton, 0.1f, firefly2))
  63.                         {
  64.                             fader = 0.3f;
  65.                             f2 = 0;
  66.                         }
  67.                     }
  68.                     break;
  69.                 default:
  70.                     break;
  71.             }
  72.            
  73.         }
  74.     }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement