How you act in front of the judge can have a huge impact on how things are decided. Think about it: the judge is sitting in the front of the room, almost always elevated so can see everything that is going on. The judge frequently has little more to do than watch the crowd and most of them do. Like a hawk.
This is whenever you are in court, even when you are just waiting for your case to be heard. I have seen judges call out people in the audience because the judge saw something they thought was inappropriate. Not a good way to start the interaction with the person making really important decisions about your life.
The best way to act is to not react at all, just like you are playing poker. I do not like making it sound like a “game” but it has been my experience that people who maintain their composure are given the most credibility by the judges.
You are very likely to hear things you do not like, coming from someone (your ex) who you really do not care for. The more you keep your composure, the more the judge is likely to view you as “credible.” I understand that 1) this may make no sense to you and 2) seem wildly unfair but this is how things seem to work.
The thing is to stay focused on what you are trying to accomplish: convincing an overburdened total stranger to see things your way. This is not the time to be emotional or worse, sarcastic, since these things will almost assuredly affect the judge’s perception of you for the worse. Be firm and strong!