Commits

mcc committed f0d0ddf

Play again?

Comments (0)

Files changed (2)

 	game_stop();
 	
 	map_init();
+	nexttype(new pong_automaton());
 }
 
 void map_init() {
 	if (event.type==SDL_KEYDOWN && event.key.keysym.sym == ']') {
 		spaces[0].player->spaces[0].body->p.x -= 1.0;
 	}
-#endif
 	if (event.type==SDL_KEYDOWN && event.key.keysym.sym == '=') {
 		game_reset();
 	}
+#endif
 
 #endif
 }
 	rollover = FPS; state = 0;
 }
 
+void pong_automaton::input(SDL_Event &event) {
+	if (state == 2) {
+		if (event.type==SDL_KEYDOWN && event.key.keysym.sym == 'y') {
+			game_halt = false;
+			game_reset();
+		}
+		if (event.type==SDL_KEYDOWN && event.key.keysym.sym == 'n') {
+			BackOut();
+		}
+	}
+}
+
 void pong_automaton::tick() {
 	type_automaton::tick();
 	
 	int actual_bulletperiod;
 	pong_automaton();
 	virtual void tick();
+	virtual void input(SDL_Event &event);
 };
 
 struct failure_automaton : public type_automaton {