public OutputLine() { base.location = new Point(0, SCREEN_HEIGHT - LINE_HEIGHT); // register for collisions checks CollisionsSystem.RegisterItemForCollision(this); }
public Reward(eRewardType reward, Point position) { this.RewardType = reward; base.location = position; Random random = new Random(DateTime.Now.Millisecond); this.verticalMovement = CONST_VERTICAL_MOVEMENT + random.Next(4); string path = ConfigurationManager.AppSettings["pathImages"]; switch (reward) { case eRewardType.WidePad: base.image = Image.FromFile(path + "Reward_WidePad.png", false); break; case eRewardType.FirePad: base.image = Image.FromFile(path + "Reward_FirePad.png", false); break; case eRewardType.SlowBall: base.image = Image.FromFile(path + "Reward_SlowBall.png", false); break; case eRewardType.DemolitionBall: base.image = Image.FromFile(path + "Reward_DemolitionBall.png", false); break; case eRewardType.DoubleBall: base.image = Image.FromFile(path + "Reward_DoubleBall.png", false); break; case eRewardType.TripleBall: base.image = Image.FromFile(path + "Reward_TipleBall.png", false); break; case eRewardType.WinLevel: base.image = Image.FromFile(path + "Reward_WinLevel.png", false); break; } CollisionsSystem.RegisterItemForCollision(this); }
public void DoubleBallEvent(object sender, EventArgs e) { Ball ball = new Ball((int)inputType, balls[0].Location, Ball.eOriginalDirection.UpperRight); Balls.balls.Add(ball); // register for collisions checks (ball allways in first place within the list) CollisionsSystem.RegisterItemForCollision(ball, 0); }
public Balls(eInputType inputType) { this.inputType = inputType; Ball ball = new Ball((int)this.inputType); Balls.balls = new List <Ball>(); Balls.balls.Add(ball); // register for collisions checks (ball allways in first place within the list) CollisionsSystem.RegisterItemForCollision(ball, 0); }
public void Fire() { if (shotingPadTime > 0) { if (Board.shots.Count == 0) { Shot oShot = new Shot(new Point(this.Location.X + (this.GetWidth() / 2) - (Shot.SHOT_WIDTH / 2), this.Location.Y)); Board.AddShot(oShot); CollisionsSystem.RegisterItemForCollision(oShot); } } }
public PlayerPad() { try { base.location = new Point(DEFAULT_X, DEFAULT_Y); string sPath = ConfigurationManager.AppSettings["pathImages"]; base.image = Image.FromFile(@sPath + "PlayerPad.png", false); this.shotingImage = Image.FromFile(@sPath + "PlayerPadShoting.png", false); // register for collisions checks CollisionsSystem.RegisterItemForCollision(this); } catch (Exception ex) { throw ex; } }
public void Reset() { this.slowBallTime = 0; Balls.demolitionBallTime = 0; // remove all balls from collision detection foreach (Ball b in balls) { CollisionsSystem.RemoveItemForCollision(b); } Ball ball = new Ball((int)inputType); Balls.balls = new List <Ball>(); Balls.balls.Add(ball); // register for collisions checks (ball allways in first place within the list) CollisionsSystem.RegisterItemForCollision(ball, 0); }