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));
        }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 public Builder Direction(DirVector dir)
 {
     this.dir = dir;
     return(this);
 }