A court has heard an Adelaide teenager was drunk and on drugs when he shot dead another and tried to kill two others.

The accused was a week from his 18th birthday.

He is on trial for murdering Lewis McPherson, 18, at Warradale on New Year's Eve.

The teenager has pleaded not guilty to murder, two counts of attempted murder and two aggravated counts of endangering life.

Prosecutor Tim Preston told the South Australian Supreme Court there was an argument at a party over sale of illegal pills.

He said the accused was asleep at the time of the argument, but then drawn into it by another teenager.

"It appears that it was common knowledge amongst the guests that the accused had had a firearm for quite some time," the court was told.

He said witnesses would tell they saw the accused fire a loaded silver handgun twice at Mr McPherson.

"The deceased fell to the ground with blood coming from his mouth and chest," Mr Preston said.

He said neighbour Allison McGillick rushed to Mr McPherson's aid and, while she was helping him, the accused killer returned.

"(The accused) walked up to the unconscious deceased put the gun on the deceased's abdomen and said words to the effect "if you don't stop being dead, I'm going to make you really dead".

Mr Preston said the accused teenager knew the victim and the two other people he was now charged with attempting to murder "who were all about the same age as him".

"They'd all been students at one time or another at Brighton High School. And there'll be no suggestion on the prosecution case, Your Honour, that before the 31st of December 2012 the accused bore any ill-will."

Mr Preston told the court the teenager on trial had a blood alcohol reading of 0.25.

"The issue in this case is whether it was a reasonable possibility that, at the time of the shootings, the accused was so intoxicated that he did not have the intent to kill or do grievous bodily harm, or alternatively didn't have the state of mind equating recklessness when he killed McPherson."

In relation to the others: "The other issue is whether it's a reasonable possibility the accused did not have an intention to kill ... when he shot at them."

But Mr Preston said it was the prosecution's case that the teenager had indeed intended killing all of them.

"That the certain purposeful acts on the part of the accused both before and after the shooting allow for a finding beyond reasonable doubt that the accused intended to kill," Mr Preston told the court.

It also heard the accused was estranged from his parents at the time and had been staying for about two weeks at the house where the party was held.