Your question is very vague. What exactly do you want to code? AI? that can get complex very quickly. Basically just math for their behavior. And, just don't publish games w/copyright content and you'll be fine. You can make them for fun though.