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)); }
public bool update(Map map) { shape.move(velocity); return map.collidesWithMap(shape); //return false; }
public bool update(Map map) { shape.move(velocity); return(map.collidesWithMap(shape)); //return false; }