public void Update(int timeElapsed, IGameObject obj) { Ball ball = (Ball)obj; Position pos = ball.Position; DirVector dir = ball.Dir; ball.Position = pos + (dir * (timeElapsed * ball.Speed)); }
public GameObject(Position pos, DirVector dir, double speed, int height, int width, IComponentPhysics phy, IComponentInput input) { Speed = speed; Dir = dir; Position = pos; Height = height; Width = width; Phy = phy; Input = input; }
private Ball(Position pos, DirVector dir, double speed, int height, int width, String tPath) : base(pos, dir, speed, height, width, new BallComponentPhysics(), new ComponentInputEmpty()) { TexturePath = tPath; }
public Builder Direction(DirVector dir) { this.dir = dir; return(this); }