All entities use a layer property. Assuming your UFO and beam are separate entities, simply set the layer of your UFO to one that is less than the layer of your beam in the constructor. E.g: UFO’s layer would be -1, beam’s layer would be 0. So long as the layer of the UFO is less than the beam’s, it will always appear in front of any newly created beams.
UFO’s Entity class
public class UFO extends Entity
{
public function UFO()
{
layer = -1;
// other constructor code here
}
}
Beam’s Entity class
public class Beam extends Entity
{
public function Beam()
{
layer = 0;
// other constructor code here
}
}