Sean Bulle, 21, is accused of attacking Paulius Petrasiunas, 25, in the hallway of low-rise flats in Heath Town, in Wolverhampton, on July 13 last year.
The defendant, also known as 'Switch', denies murder, claiming that he suffered an epileptic fit and could not recall what happened during the incident.
Mr Tim Hannam QC, prosecuting, said that the pair were friends involved in drug dealing and that they were overheard arguing at the premises, in Chervil Rise, before Bulle allegedly ran a 'Rambo' style knife through Mr Petrasiunas, who was also known as Paulo and Polo.
He told the jury at Stoke-on-Trent Crown Court that the alleged victim was found slumped outside the building shortly afterwards by friends who phoned for an ambulance.
He said Bulle had left the scene and was found at a safe house in Shrewsbury.
Mr Hannam said: "He is a cold, calm and collected killer. These are my words, but you have seen and heard the evidence. You have seen him in the witness box.
"You have seen him lie and lie and lie again. Why on earth have you had to go through the trouble of listening to all that evidence?
"It was the case that he could remember. He knew what he was doing and he had not been suffering an epileptic blackout. In terms of what he did in the hallway and him not remembering is a complete red herring and a distraction.
"We know that because a doctor checked him.
"What is plain is that he left home that morning armed with a massive and lethal weapon, a weapon that he was used to carrying.
"We cannot say that he came to Heath Town that day intending to kill Polo, obviously they had been getting on that day. But there was irritation. There was drug dealing. There was an argument in the hallway.
"In the heat of the moment he took out the knife and killed him, but he did so deliberately. He may have been shocked, but his actions afterwards were cold, calm and collected," Mr Hannam said.
Mr Nick Corsellis QC, defending, told the jury that the prosecution's speech had been "carefully crafted", but the panel should keep an "open mind".
"Class A drugs brings risks. It is a chaotic world with violence. It is in that world that Sean Bulle and Polo were friends. They were friends at school and one of them has been charged with murdering the other," Mr Corsellis said.
He said a witness in the case, who had been among a group inside the flat, had described the defendant behaving as if he was annoyed about something shortly before the two men went into the hallway.
"Mr Bulle does suffer from epilepsy which can cause the sensation of a firestorm in the brain. We know that he didn't have his medication. We know it was coming up to the anniversary of his mother's death.
"Stress factors were in the background," Mr Corsellis added.
Bulle, of Clover Ley, also Heath Town, denies the allegations. The trial continues.