Advertisement
NekuSoul

SharpDX-Test

Nov 17th, 2012
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using NekuSoul.SharpDX_Engine;
  2. using NekuSoul.SharpDX_Engine.Objects;
  3. using System;
  4.  
  5. namespace NekuSoul.SharpDX_Test
  6. {
  7.     internal class Program
  8.     {
  9.         static Game _Game;
  10.  
  11.         [STAThread]
  12.         private static void Main()
  13.         {
  14.             _Game = new Game(1366, 768);
  15.             _Game.RunScene(new TestScene(_Game));
  16.             _Game.Run();
  17.         }
  18.     }
  19.  
  20.     class TestScene : Scene
  21.     {
  22.         float i = 0;
  23.         Game _Game;
  24.  
  25.         public TestScene(Game _Game)
  26.         {
  27.             this._Game = _Game;
  28.         }
  29.  
  30.         public override void Update()
  31.         {
  32.             i += 0.001f;
  33.             TestObject C = new TestObject();
  34.             C.Position.X = 30;
  35.             C.Position.Y = 748;
  36.             C.add += (float)Math.Tan(i);
  37.             DrawableObjectList.Add(C);
  38.         }
  39.     }
  40.  
  41.     class TestObject : DrawableObject
  42.     {
  43.         public float i = 1;
  44.         public float add = 0.05f;
  45.  
  46.         public override void Update()
  47.         {
  48.             i += add;
  49.             Position.X += ((35 * (float)Math.Sin(i)) + 0.6f);
  50.             Position.Y += ((35 * (float)Math.Cos(i)) - 0.35f);
  51.         }
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement