예제 #1
0
        private void SetVY(double time, double vy)
        {
            this.vy = vy;
            vyf     = IntegrableFunction <double, double> .SplitAt(vyf, time, (PolyFunc <double, double>) vy, false);

            yp = t => y0 + vyf.FI(t);
        }
예제 #2
0
        private void SetVX(double time, double vx)
        {
            this.vx = vx;
            vxf     = IntegrableFunction <double, double> .SplitAt(vxf, time, (PolyFunc <double, double>) vx, false);

            xp = t => x0 + vxf.FI(t);
        }
예제 #3
0
        public static void Main()
        {
            PolyFunc <double, double>           l1    = new PolyFunc <double, double>(1);
            PolyFunc <double, double>           l2    = new PolyFunc <double, double>(2);
            IntegrableFunction <double, double> split = IntegrableFunction <double, double> .SplitAt(l1, 2, l2, false);

            for (double d = 0; d < 5; d += 0.1)
            {
                Console.WriteLine("<{0},{1},{2},{3},{4}>", d, l1.F(d), l2.F(d), split.F(d), split.FI(d));
            }
            Console.ReadKey();
        }
예제 #4
0
 public Game(MainChar m)
 {
     pm        = new PhysicsManager(this);
     renderman = new RenderManager();
     entities  = //new AdvancedEntityManager(128,64,32,16,8,4,2,1,0.5);
                 new AdvancedEntityManager(pm, renderman, 128, 64, 32, 16, 8, 4, 2, 1, 0.5);
     events   = new GameEventManager(this, 1000, 100, 10, 1);
     mainChar = m;
     //entities = new ListEntityManager();
     gameTimer    = new BulletHell.Time.Timer();
     curTimeRate  = 1;
     timeRateFunc = new PolyFunc <double, double>(curTimeRate);
     timeFunc     = timeRateFunc.FI;
     Add(m);
 }
예제 #5
0
        public MainChar(Drawable d, BulletStyle sty, double x0, double y0, double s = 20, GraphicsStyle g = null) : base(0, null, d, new Point(2), new EntityClass("MainChar", "Character"), null, g)
        {
            speed    = s;
            this.x0  = x0;
            this.y0  = y0;
            vxf      = new PolyFunc <double, double>(0);
            vyf      = new PolyFunc <double, double>(0);
            xp       = t => x0;
            yp       = t => y0;
            Position = new Particle(t => xp(t), t => yp(t));
            BulletEmission em = new BulletEmission(0, 0.25,
                                                   sty,
                                                   TrajectoryFactory.SimpleVel(2, -40, 5),
                                                   TrajectoryFactory.SimpleVel(-2, -40, -5)
                                                   );

            BulletPattern pat = new BulletPattern(new EntityClass("MainCharBullet", "Bullet"), em);

            Emitter = new BulletEmitter(-1, pat);
            Time    = 0;
        }
예제 #6
0
 public void ResetTime()
 {
     gameTimer.Reset();
     timeRateFunc = new PolyFunc <double, double>(curTimeRate);
     timeFunc     = timeRateFunc.FI;
 }