Iain Cocks is accused of abusing his position by having a sexual relationship for almost two years with the inmate at HMP New Hall, near Wakefield.
Cocks, 51, is also accused of engaging in flirtatious behavior with another prisoner before sexually assaulting her in her cell.
Married Cocks - whose wife also works at the prison - is alleged to have committed the offences between June 2015 and May 2017.
A jury at Leeds Crown Court heard details of Cocks's alleged inappropriate behaviour.
It included asking one of the women to act out the title of the porn film Debbie Does Dallas during a game of charades.
Cocks, 51, of Barnsley, denies two offences of misconduct in a public office and one of sexual assault.
Mark McKone, prosecuting, said Cocks met the first complainant in 2015 when she was moved onto the prison’s Rivendell wing, a unit where prisoners are allowed more freedom.
Mr McKone said Cocks began speaking to the inmate inappropriately.
Jurors were told that Cocks told the inmate that he no longer had sex with his partner.
Mr McKone said the defendant began "testing the water" by asking her if she was looking at his crotch.
The court heard Cocks touched the woman inappropriately as she bent over a washing machine while working as a cleaner in the laundry room.
The prosecutor said: “(The inmate) accepted that she enjoyed the attention and began to get feelings for him.”
The court heard Cocks and the woman had sex for the first time against a washing machine in June 2015.
It is alleged they had sex on seven or eight further occasions in different cells and also in a staff room.
The court heard Cocks went to her cell at 6am on New Year’s Day 2016 and had sex with her.
The prosecutor said Cocks told the woman not to tell anyone about their relationship when prison authorities became suspicious.
He said: "The defendant told (the inmate) that if the relationship came out she would be shipped out and extra time would be put on her sentence."
Cocks is alleged to have engaged in inappropriate behaviour with the second inmate when she was moved onto the same wing.
Mr McKone said Cocks told the woman it was “like walking down the aisle” when he first escorted her onto the wing.
The prosecutor said Cocks also asked the woman to wear make-up for him and told her it was "difficult not to fall in love" with her.
Mr McKone said: "(the second complainant) did not know what to do or say and was waiting for a decision on early release.
"She thought prison officers could make life hell for her and she played along."
The jury of eight women and four men heard Cocks also looked up details of the woman's husband on the prison system and asked if she was going to divorce him.
Cocks is alleged to have indecently assaulted the woman on the bed of her cell but stopped when she said to him: “Don’t you think I am vulnerable?”
The court heard the two women were in cells next to each other and the first inmate became jealous of the attention Cocks was showing the second inmate.
Cocks is also alleged to have made arrangements to meet the women upon release from custody.
The prosecutor said: "He told both women he was in a bad marriage."
Cocks denied any wrongdoing when interviewed about the allegations, telling officers: “I am a happily married man. I love my wife very much.”
Mr McKone said: “The prosecution say that the defendant abused his position of authority to seek out sexual contact with inmates.”
He told the jury: "The defendant is saying nothing of the sort took place.
"It is a matter for you who's telling the truth and who's telling lies."
The trial continues.