MICKEY SPILLANE has made a career of changing directions: from writing comic books to detective thrillers; from big-city living in New York to his current life in the quiet South Carolina fishing village of Murrell's Inlet, and, most recently, from novels in which the action careens between the bedroom and the barroom floor, to -- yes, its's true -- children's books.

Mike Hammer, that tough-talking, gun-toting, womanizing private eye with the short fuse, who is Spillane's most famous literary creation, has been replaced by Larry and Josh, two adolescent boys who share hair-raising adventure (no violence, just threats) in The Day the Sea Rolled Back (Windmill, $7.95. Ages 9-14), published last year and to be issued as a Bantam paperback next winter. Also coming are the written but not yet published The Ship That Never Was (scheduled as a Bantam paperback original for fall of 1981) and The Shrinking Island (not yet scheduled for publication).

Spillane, relaxed, tanned, craggy-faced and still crewcut, recently sat sipping a Miller Lite (the fridge is full of the free supply he gets for doing Miller commercials) at his dining-room table overlooking a wide blue inlet to the Atlantic. He talked about his current detour into the children's book business, and the business of writing in general.

For Spillane, it is a business.

"What's my inspiration?" He pauses, savoring the question and obviously relishing the answer he, ever the iconoclast, is about to give. "The urgent need for money.

"Oh, sure, sometimes there's something in my head, and I say, 'I gotta resolve this.' But basically, writing's just a job."

For Spillane, the job he's been at most of his life has netted him a fortune. And he is convinced that it's the best way to make a living.

"If you're a good writer all you need is a typewriter and $3 worth of paper."

According to his agent, Jack McKenna, his hardcover publisher, Dutton, has given up counting how many copies of the Mike Hammer novels have been sold. It's more than 55 million, and that was the tally eight years ago, McKenna says. His books are in translation in 14 countries, and Spillane claims to be the fifth most translated author in the world. "The other guys are all dead," he says.

He does appear to have the touch for success. The Day the Sea Rolled Back was a Junior Literary Guild selection last year and was purchased by a number of libraries. The story is about two boys who discover the wreck of a treasure-laden ship one day when the sea mysteriously recedes, laying bare the floor of the western Caribbean. The book is fast-moving; it has the same strong plot line as Spillane's adult novels - but it's "clean," no cusswords, no sex.

"Even the librarians are saying it's good," says McKenna proudly.(And this about a guy who once wrote a novel called The Erection Set and had his wife pose nude on the jacket.)

Spillane is obviously pleased at the reception he's found in the juvenile market. He says he enjoys writing for children. "Kids today are very aware of what's going on -- the letters they write me. It's really why I keep writing kids' books. I'm away for three days, and I'm afraid to go to the mail box."

He reckons that each of the three more children's books he plans will take two weeks to finish. He'll write them in one of the three offices he's built into his modest two-story frame house. Depending on his mood, he may write in a little room situated over the carport where a classic white Jaguar is parked, dissolving imperceptibly, as everything does, in the soft salty sea air. (John Wayne gave him the car as a gift for rewriting Ring of Fear and saving the Duke "a pile of money" he would have otherwise lost on the movie.) Another study is a book-lined paneled affair off the living room, and a third is upstairs. Yet a fourth is moored behind the house, two 50 horsepower motors gleaming on its stern. It's normally used for fishing but . . .

"When I feel like it, I take my typewriter out to the boat, throw in a crabline and write. That way you can make your money, get your tan and catch your dinner."

Obviously, it's this kind of life that first drew Spillane to the South Carolina coast and keeps him here, a quarter of a centruy later. Well -- actually, it was women that brought him here. His eye for the ladies has never been any secret.

"I first came to judge the Miss Sun Fun Contest 24 years ago, and stayed," says Spillane. "I was about the only celebrity they could get in those days. Nobody else'd come but George Gobel, and he used to be ashamed to be here."

But Spillane settled right in to the tee-shirted, barefoot, hammock-swinging life, and now it's almost impossible to budge him.

"I was in Fargo, North Dakota, recently on Miller business. Hadda keep my shoes on for three days, and it nearly killed me," he complains. His wife hates living in Murrell's Inlet, so their modus operandi is for her to live in Los Angeles and for him to send flowers frequently and visit her every six months or so. But he begrudges those trips.

"I hate cities!" He all but spits out the words, as if he were referring to a particular brand of septic tank. "Cities stink! There's nothing to do in them."

Above all, he says, he "hates pretension" of the sort he finds in ample measure among city dwellers.

Of pretense there appears to be not one iota in Spillane, who has begun this warm summer afternoon by answering the door to an unannounced stranger, and ushering her in to the barking of Bandito, his terrier, even before he's ascertained why his visitor is here. ("Oh, the press, I'm used to you guys. Whenever things are slow around here, the local papers come and interview me.")

Spillane is down to earth.But above all he is a moralist. You can see it everywhere in his writing, and perhaps it is one of the qualities which suits him well to the writing of children's books -- traditionally a genre where it's been possible to get away with a little didacticism.

Mike Hammer, for all his hard language, enmity and knuckle-busting, is a champion of the underdog. Many of the jaws he breaks and heads he cracks are intended to right wrongs perpetrated by greedy, prideful and hypocritical people -- "scum," Hammer calls them. In Spillane's children's books a similar framework operates, although not so violently. The young fellows in The Day the Sea Rolled Back are pitted against two greedy characters almost as unsavory as some of the villains in the Hammer books.

The boys win in the end, just as all Spillane heroes do. It's the way he plots his novels. "I start out with the ending first and work backwards -- it's always happy."

The violence so pervasive in her earlier novels is getting harder to write, he says. "I've seen just about everything. But I have trouble writing about it now. I just don't have that old antagonism anymore.

"It's like writing about sex. When I was young, I enjoyed writing those scenes. I found it titillating. Now that I really know about sex, it's not that way. Besides," he pauses, eyes twinking, "I think, why should I write all this and give away all my tricks?"

And so what of Mike Hammer? Is he gone forever?

"You're looking at him," says Spillane, now 62 and a grandfather who keeps a duck in the back yard for the amusement of his 4-year-old granddaughter.

"I always made Hammer my age, so I wouldn't get caught in anachronisms."

Now that he's older, he says, he just couldn't imagine Hammer being older too, even though the biceps in Spillane's Indian wrestling arms still bulge respectably ("I used to win a lot of money Indian wrestling").

"I never described Hammer, you'll notice. But he's basically me. He's a state of mind."