예제 #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;
 }