Ejemplo n.º 1
0
        private Vector3 ifmovewherebe(Vector3 move)
        {
            Matrix  rotat   = Matrix.CreateRotationY(rotation.Y);
            Vector3 movment = new Vector3(move.X, move.Y, move.Z);

            movment = Vector3.Transform(movment, rotat);

            return(position + new Vector3(
                       map.collidesWithMap(position + new Vector3(movment.X, 0, 0), new Vector3(Consts.WORLDSCALE / 1.05f, Consts.WORLDSCALE / 1.05f, Consts.WORLDSCALE / 1.05f)) ? 0 : movment.X,
                       map.collidesWithMap(position + new Vector3(0, movment.Y, 0), new Vector3(Consts.WORLDSCALE / 1.05f, Consts.WORLDSCALE / 1.05f, Consts.WORLDSCALE / 1.05f)) ? 0 : movment.Y,
                       map.collidesWithMap(position + new Vector3(0, 0, movment.Z), new Vector3(Consts.WORLDSCALE / 1.05f, Consts.WORLDSCALE / 1.05f, Consts.WORLDSCALE / 1.05f)) ? 0 : movment.Z));
        }
Ejemplo n.º 2
0
 public bool update(Map map)
 {
     shape.move(velocity);
     return map.collidesWithMap(shape);
     //return false;
 }
Ejemplo n.º 3
0
 public bool update(Map map)
 {
     shape.move(velocity);
     return(map.collidesWithMap(shape));
     //return false;
 }