Revision ad516f5c main.c

View differences:

main.c
121 121
	player[0].score = 0;
122 122
	player[0].gameAreaStart = 0;
123 123
	player[0].gameAreaEnd = 43;
124
	setNewSprite((sprite_t*)&(player[0].sprite));
125 124
	player[0].sprite.owner = (player_t*)&player[0];
125
	setNewSprite((sprite_t*)&(player[0].sprite));
126 126
	player[0].mirrored = 0;
127 127
	player[0].controllerInputMask = (1<<CONTROLLER0_LEFT) | (1<<CONTROLLER0_DOWN) | (1<<CONTROLLER0_RIGHT) | (1<<CONTROLLER0_ROTATE);
128 128
	player[0].controllerOffset = 4;
......
130 130
	player[1].score = 0;
131 131
	player[1].gameAreaStart = 46;
132 132
	player[1].gameAreaEnd = 89;
133
	setNewSprite((sprite_t*)&(player[1].sprite));
134 133
	player[1].sprite.owner = (player_t*)&player[1];
134
	setNewSprite((sprite_t*)&(player[1].sprite));
135 135
	player[1].mirrored = 1;
136 136
	player[1].controllerInputMask = (1<<CONTROLLER1_LEFT) | (1<<CONTROLLER1_DOWN) | (1<<CONTROLLER1_RIGHT) | (1<<CONTROLLER1_ROTATE);
137 137
	player[1].controllerOffset = 0;
138 138
	while(1){
139 139
		for(uint8_t delay = 0; delay < TICKS; delay++){
140 140
			drawGameArea((player_t*)player);
141
			if(delay%(TICKS/(NUMBER_OF_PLAYERS)-1) == 0){
141
			if(delay%(TICKS/(NUMBER_OF_PLAYERS)) == 0){
142 142
				for(uint8_t playerNumber = 0; playerNumber < NUMBER_OF_PLAYERS; playerNumber++){ //fair handing of input
143 143
					handleGamepadInput((player_t*)&player[playerNumber],
144 144
								((~PIN(CONTROLLER0_PORT))& player[playerNumber].controllerInputMask)

Also available in: Unified diff