public void AddCollidableObjects(DynamicGameObject dgo) { if (collidableObjects.IndexOf(dgo) == -1) { collidableObjects.Add(dgo); } }
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(); }
private void OnHitStar(DynamicGameObject dgo) { stars++; if (dgo.Visible) { AddSparkle(dgo.Position); } dgo.Visible = false; }
private void OnHitNest(DynamicGameObject dgo) { //this.AfterUpdateFuncDelegate = () => //{ ResetLevel(); currentLevel++; if (currentLevel > 4) currentLevel = 1; LoadNextLevel(); //}; }
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); }
public void RemoveCollidableObjects(DynamicGameObject dgo) { collidableObjects.Remove(dgo); }
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); }
public WrapperCircle(DynamicGameObject gdo, float radius) { this.gdo = gdo; this.radius = radius; radiusOverriden = true; }
public WrapperCircle(DynamicGameObject gdo) { this.gdo = gdo; radiusOverriden = false; }
public WrapperLine(RectangleBlock rect, int side) { this.wrapObj = rect; this.side = side; start = new Vector2(); end = new Vector2(); Sync(); }
public WrapperLine(LineObject line) { wrapObj = line; this.side = -1; }
public LineCollisionDetector(DynamicGameObject dgo, ILine line) { this.dgo = dgo; this.line = line; }
public LineCollisionDetector(DynamicGameObject dgo) { this.dgo = dgo; line = dgo.Shape as ILine; }
public CircleCollisionDetector(DynamicGameObject dgo, IShape shape) { this.dgo = dgo; circle = shape as ICircle; }