public void Update(int timeElapsed, GameObject gameObj) { PowerUp powerUp = (PowerUp)gameObj; Position pos = powerUp.Position; DirVector dir = powerUp.Direction; powerUp.Position = pos + (dir * (timeElapsed * powerUp.Speed)); }
public GameObject(Position pos, DirVector dir, double speed, int height, int width, IComponentPhysics phy, IComponentInput input) { Speed = speed; Direction = dir; Position = pos; Height = height; Width = width; Physics = phy; Input = input; }