Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Diagnostics;
- using System.Windows;
- using Microsoft.Kinect;
- using System.Collections.Generic;
- //SharpDX
- using SharpDX;
- using SharpDX.D3DCompiler;
- using SharpDX.Direct3D;
- using SharpDX.Direct3D11;
- using SharpDX.DXGI;
- using SharpDX.Windows;
- using Buffer = SharpDX.Direct3D11.Buffer;
- using Device = SharpDX.Direct3D11.Device;
- using MapFlags = SharpDX.Direct3D11.MapFlags;
- using Vector4 = SharpDX.Vector4;
- namespace SkeletonDrawing
- {
- partial class Program
- {
- private void check_gamestate(Skeleton skeleton)
- {
- switch (gamestate)
- {
- case 0:
- Vector3 boxpos1 = new Vector3(skeleton.Position.X + 0.3f, skeleton.Position.Y + 0.3f, skeleton.Position.Z -3);
- Vector3 boxpos2 = new Vector3(skeleton.Position.X - 0.3f, skeleton.Position.Y + 0.3f, skeleton.Position.Z -3);
- makeCube(skeleton, 0.1f, boxpos1);
- makeCube(skeleton, 0.1f, boxpos2);
- if (isTouchingBox(skeleton, 0.1f, boxpos1))
- {
- gamestate = 1;
- f1 = 1;
- f2 = 1;
- f3 = 1;
- }
- if (isTouchingBox(skeleton, 0.1f, boxpos2))
- fader = 1;
- break;
- case 1:
- // Firefly Game
- Random rand = new Random();
- if (f1 == 1)
- {
- 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));
- makeCube(skeleton, 0.1f, firefly1);
- if (isTouchingBox(skeleton, 0.1f, firefly1))
- {
- fader = 0.3f;
- f1 = 0;
- }
- }
- if (f2 == 1)
- {
- 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));
- makeCube(skeleton, 0.1f, firefly2);
- if (isTouchingBox(skeleton, 0.1f, firefly2))
- {
- fader = 0.3f;
- f2 = 0;
- }
- }
- break;
- default:
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement