Пример #1
0
 public void AddCollidableObjects(DynamicGameObject dgo)
 {
     if (collidableObjects.IndexOf(dgo) == -1)
     {
         collidableObjects.Add(dgo);
     }
 }
Пример #2
0
 public StarObject(World currentWorld)
     : base(currentWorld, 25/2)
 {
     this.SpriteName = "stars";
     this.IsGravityDisabled = true;
     rotatorObj = new DynamicGameObject(currentWorld);
     rotatorObj.IsGravityDisabled = true;
     rotatorObj.SpriteName = "rotator";
     rotatorObj.Rotation = (float) (RandomUtil.Random.NextDouble() * Math.PI * 2);
     rotatorObj.AngularVelocity = 0.15f;
     this.Type = ObjectType.Star;
     //InitAnimator();
 }
Пример #3
0
 private void OnHitStar(DynamicGameObject dgo)
 {
     stars++;
     if (dgo.Visible)
     {
         AddSparkle(dgo.Position);
     }
     dgo.Visible = false;
 }
Пример #4
0
 private void OnHitNest(DynamicGameObject dgo)
 {
     //this.AfterUpdateFuncDelegate = () =>
     //{
         ResetLevel();
         currentLevel++;
         if (currentLevel > 4) currentLevel = 1;
         LoadNextLevel();
     //};
 }
Пример #5
0
 private void OnHitBalance(DynamicGameObject dgo)
 {
     IStickOn stickOn = dgo as IStickOn;
     UpdateStickingData(stickOn);
     Vector2 np = dgo.CollisionDetector.FindExactCollidingPoint(bird.Shape);
     bird.UpdatePosition(np.X, np.Y);
 }
Пример #6
0
 public void RemoveCollidableObjects(DynamicGameObject dgo)
 {
     collidableObjects.Remove(dgo);
 }
Пример #7
0
 public static void AddObject(DynamicGameObject dgo, PlayScreen screen, float x, float y)
 {
     screen.ObjectManager.AddGameObject(dgo, PlayScreen.GAMEOBJ_BATCH);
     dgo.UpdatePosition(x, y);
     screen.AddCollidableObjects(dgo);
 }
Пример #8
0
 public WrapperCircle(DynamicGameObject gdo, float radius)
 {
     this.gdo = gdo;
     this.radius = radius;
     radiusOverriden = true;
 }
Пример #9
0
 public WrapperCircle(DynamicGameObject gdo)
 {
     this.gdo = gdo;
     radiusOverriden = false;
 }
Пример #10
0
        public WrapperLine(RectangleBlock rect, int side)
        {
            this.wrapObj = rect;
            this.side = side;

            start = new Vector2();
            end = new Vector2();

            Sync();
        }
Пример #11
0
 public WrapperLine(LineObject line)
 {
     wrapObj = line;
     this.side = -1;
 }
Пример #12
0
 public LineCollisionDetector(DynamicGameObject dgo, ILine line)
 {
     this.dgo = dgo;
     this.line = line;
 }
Пример #13
0
 public LineCollisionDetector(DynamicGameObject dgo)
 {
     this.dgo = dgo;
     line = dgo.Shape as ILine;
 }
Пример #14
0
 public CircleCollisionDetector(DynamicGameObject dgo, IShape shape)
 {
     this.dgo = dgo;
     circle = shape as ICircle;
 }