コード例 #1
0
        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));
        }
コード例 #2
0
 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;
 }