Sfoglia il codice sorgente

Prepared the code for the title screen and menu implementation. Will need to do some sprites

Adrien Boucaud 12 anni fa
parent
commit
d6b83c0a54
3 ha cambiato i file con 5 aggiunte e 3 eliminazioni
  1. 1 1
      hexagon.c
  2. 2 1
      states.c
  3. 2 1
      update_states.c

+ 1 - 1
hexagon.c

@@ -17,7 +17,7 @@ int AddIn_main(int isAppli, unsigned short OptionNum)
 	//rand initialisation
     srand(RTC_GetTicks());
 
-    switch_to_state(MENU, &data);
+    switch_to_state(TITLE, &data);
 
     while(KeyUp(K_EXIT)){ //main loop
         //fps

+ 2 - 1
states.c

@@ -1,6 +1,6 @@
 #include "states.h"
 
-State current_state = MENU;
+State current_state = TITLE;
 void switch_to_state(State new_state, Game_Data *data)
 {
 	switch (new_state)
@@ -18,6 +18,7 @@ void switch_to_state(State new_state, Game_Data *data)
 			init_game_over(data);
 		break;
 	}
+	current_state = new_state;
 }
 void update(Game_Data *data)
 {

+ 2 - 1
update_states.c

@@ -2,7 +2,8 @@
 
 void update_title(Game_Data *data)
 {
-//TODO
+	if(KeyDown(K_EXE))
+		switch_to_state(MENU, data);
 }
 void update_game(Game_Data *data)
 {