In this paper, we examine the advantages of transmission scheduling by medium access control (MAC) protocols for energy-limited wireless sensor networks (WSN) as a means of maximizing network lifetime. We consider transmission scheduling for sensor networks with a mobile access point, where each sensor transmits its measurement directly to an access point through a fading channel. WSN lifetime maximization depends almost exclusively on the channel-state information (CSI) and the residual-energy information (REI) of each sensor in the network. We discuss distributed protocols which exploit local CSI and REI. We present a novel protocol for distributed transmission scheduling, dubbed the time-varying opportunistic protocol (TOP), for maximizing the network lifetime. TOP prioritizes sensors with better channels when the network is young, by exploiting local CSI to reduce transmission energy. However, TOP prefers sensors with higher residual energy when the network is old by exploiting local REI to reduce the wasted energy. We show that the relative performance loss of TOP compared to the optimal centralized protocol in terms of network lifetime decreases as the initial energy stored in the sensors increases. Furthermore, TOP significantly simplifies the implementation of carrier sensing compared to other distributed MAC protocols. We also explore the case of large-scale wireless sensor networks, where the activated sensors are picked randomly and modify the implementation of TOP for such networks. Simulation results show that TOP outperforms other distributed MAC protocols that have been proposed recently.