Yeah, this has been discussed before. There is no general rule.
However, there are things to check.
Do the state four year schools have to accept credits from the state's community colleges? As education expenses have risen, more states have forced this arrangement on their state colleges/community colleges, but I seriously doubt it's the case in every state. If there is no arrangement, you need to check with the school you plan to get your bachelor's degree from to find out what credits will transfer.
How good is the teaching at the university vs. the community college? There's a lot of variation in both. The quality of the courses and teaching at the community college are as likely to be better than at the university as vice versa. If it's a large four year university using TA's for the freshman and sophomore courses, you'll probably be better off at the community college. You're really rolling the dice when you're stuck with TA's - a few are really good, a lot are passable, and some are really bad.
How good are the facilities at the community college? A lot of community colleges can provide quality classes when all that's needed is a room, some desks, and a good teacher. As one poster noted, the physics classes at his community college were pretty poor - most likely because science classes with labs require money. One of the big selling points of community colleges is the cheaper tuition costs - it's hard to keep the costs down if you're investing in lab equipment. The community college in my city manages it - not only do they have great physics and chemistry courses, they have an incredible auto repair facility for those looking for an associates degree in the automotive field.
Are you going to school full time or part time? Even with an agreement for transferring credits, you'll probably find it hard to build a full time schedule for two straight years because of pre-requisites. If you're going part time, community colleges usually provide a better schedule (some four year universities offer a good evening schedule, but a few couldn't care less about part time students).