Pokitto turn based strategy game.

Dependencies:   PokittoLib

Revision:
12:52184eaf74f4
Parent:
11:4c61319450c8
--- a/wars.cpp	Tue Dec 12 03:38:33 2017 +0000
+++ b/wars.cpp	Wed Dec 13 01:33:33 2017 +0000
@@ -33,7 +33,9 @@
     }
     disp.update();
 
-    for (int frame = 0; frame < 180; frame++) {
+    int frame = 0;
+
+    while (frame<180&&!btn.cBtn()) {
         if (frame<60) {
             for (int c = 0; c<16; c++) {
                 disp.palette[c] = disp.interpolateColor(disp.palette[c], sprite_pal[c], (255/60)*frame);
@@ -49,6 +51,7 @@
         }
         disp.update();
         //game.wait(2);
+        frame++;
     }
 
     disp.load565Palette(sprite_pal);
@@ -312,15 +315,21 @@
 
 char Faction[][14] {
     {"GI-BROS"},
-    {"SPACE GRUNKS"},
+    {"SPIDERLINGS"},
     {"TEAM GLOOM"}
 };
 
+int Faction_colors[] {
+    11,
+    6,
+};
+
 char TRAITS[][8] {
     {""},
     {"FAST"},
     {"HULKISH"},
 };
+
 struct Hero {
     unsigned int index, team, id, x, y;
     uint8_t atk, def, hp, max_hp;
@@ -672,22 +681,38 @@
 void showRoundScreen() {
     disp.clear();
     DrawTileMap(map_x, map_y, current_hero);
-    disp.setCursor((SW/2)-((6*7)/2),(SH/2)-3);
-    disp.print("ROUND ");
-    disp.print((int)game_turn/2);
-    disp.print("\nTURN ");
-    disp.print((int)(game_turn%2)+1);
+    disp.load565Palette(sprite_pal);
     disp.update();
+    disp.textWrap = false;
+    disp.enableDirectPrinting(false);
 
-    for (int frame = 0; frame < 50; frame++) {
-        for (int i=0; i<16; i++) {
-            disp.palette[i] = disp.interpolateColor(disp.palette[i], sprite_pal[i], (255/50)*frame);
+    for (int frame = 0; frame< 140; frame++) {
+        disp.setColor(0);
+        if (frame<6) {
+            disp.drawLine(0,SH/2+frame, SW, SH/2+frame);
+            disp.drawLine(0,SH/2-frame, SW, SH/2-frame);
         }
+        else if (frame>=6) {
+            disp.setColor(0);
+            disp.fillRect(0,SH/2-6, SW, 12);
+            disp.setColor(15);
+            disp.setCursor(frame-6-(6*7), (SH/2)-5);
+            disp.setColor(10);
+            disp.print("> ROUND ");
+            disp.setColor(15);
+            disp.print((int)game_turn/2);
+            disp.setCursor(SW+6-frame, (SH/2)+1);
+            disp.setColor(Faction_colors[current_team]);
+            disp.print(Faction[current_team]);
+            disp.setColor(10);
+            disp.print(" TURN <");
+        }
+
         disp.update();
         //game.wait(2);
     }
 
-    disp.load565Palette(sprite_pal);
+    disp.textWrap = true;
 }
 
 void DrawCursor(int x, int y) {