Commits

Trammell Hudson committed ff181e1

spacing looks almost right

  • Participants
  • Parent commits 38ca31f

Comments (0)

Files changed (1)

 // sylviashow.com/monochron
 
 // == EASILY HACKABLE DEFINES ==================================================
-// MonoChron as 128x64, Pebble as 144x168.
-// Initial version does not change anything
+// MonoChron as 128x64, Pebble as 144x168 == rotated 84x72.
+// Scale up by almost 2 and adjust X positions
 
-#define GROUND_Y 58    // Ground Position
+#define GLCD_XPIXELS (168/2)
+#define GLCD_YPIXELS (144/2)
+#define GROUND_Y (GLCD_YPIXELS-6)    // Ground Position
 
 #define CLOUD_X 65     // Cloud Position
 #define CLOUD_Y 11
 
-#define BOX_X 50       // Box Position
+#define BOX_X 30       // Box Position
 #define BOX_Y 26
 #define BOX_TYPE 1     // Box Type (0 for standard, 1 for question)
 
-#define TURTLE_MIN 83  // Turtle boundary
-#define TURTLE_MAX 110
-#define TURTLE_Y 27    // TODO: Derive these from bolted box position
+// Bolted box position
+#define BOLT_X 50
+#define BOLT_Y 43
+#define BOLT_W 30
+#define BOLT_H (GLCD_YPIXELS - BOLT_X)
+
+// Coin position
+#define COIN_X 80
+
+#define TURTLE_MIN BOLT_X  // Turtle boundary
+#define TURTLE_MAX (BOLT_X+BOLT_W-8)
+#define TURTLE_Y (BOLT_Y - 16)
 #define TURTLE_SPIN 0  // Shell spin on or off
 
+
 // ^^ EASILY HACKABLE DEFINES ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 #include <pebble_os.h>
 #include "font5x7.h"
 
 typedef uint8_t u08;
-#define GLCD_XPIXELS 128
-#define GLCD_YPIXELS 64
 
 static GContext * ctx;
 
 )
 {
 	graphics_context_set_stroke_color(ctx, GColorWhite);
-	graphics_draw_round_rect(ctx, GRect(y*2,x*2,h*2,w*2), 0);
+	graphics_draw_round_rect(ctx, GRect(y*2, x*2,h*2,w*2), 0);
 }
 
 static inline void
 )
 {
 	graphics_context_set_fill_color(ctx, inverted ? GColorWhite : GColorBlack);
-	graphics_fill_rect(ctx, GRect(y*2, x*2, h*2, w*2), 0, GCornerNone);
+	graphics_fill_rect(ctx, GRect(y*2,  x*2, h*2, w*2), 0, GCornerNone);
 }
 
 
 )
 {
 	graphics_context_set_fill_color(ctx, GColorBlack);
-	graphics_fill_rect(ctx, GRect(y*2, x*2, 2, 2), 0, GCornerNone);
+	graphics_fill_rect(ctx, GRect(y*2,  x*2, 2, 2), 0, GCornerNone);
 }
 
 static inline void
 )
 {
 	graphics_context_set_fill_color(ctx, GColorWhite);
-	graphics_fill_rect(ctx, GRect(y*2, x*2, 2, 2), 0, GCornerNone);
+	graphics_fill_rect(ctx, GRect(y*2,  x*2, 2, 2), 0, GCornerNone);
 }
 
 extern volatile uint8_t time_s, time_m, time_h;
 #endif
 
   // Add the coin and draw the time
-  draw_coin(80, 0);
+  draw_coin(COIN_X, 0);
   WriteTime(inverted);
 
   // Draw the bolted box (height doesn't matter as long as its below the ground)
   // TODO: Make a wrapper function for this (should be easy!)
-  glcdRectangle(80, 43, 44, 20);
-  glcdClearDot(80, 43); glcdClearDot(123, 43); // Round top corners
-  draw_bolt(82, 45); draw_bolt(118, 45); // Add top corner bolts
+  glcdRectangle(BOLT_X, BOLT_Y, BOLT_W, BOLT_H);
+  glcdClearDot(BOLT_X, BOLT_Y);
+  glcdClearDot(BOLT_X+BOLT_W, BOLT_Y); // Round top corners
+  draw_bolt(BOLT_X+2, BOLT_Y+2);
+  draw_bolt(BOLT_X+BOLT_W-6, BOLT_Y+2); // Add top corner bolts
 
   // Untouchable static elements
   draw_ground();
   uint8_t yarc[] = {3,9,10,12,9,6,2};
 
   // Maximum X for mario to walk (hits the big bolted box)
-  uint8_t max = 72; // TODO: Derive this from actual collision
+  uint8_t max = BOLT_X-8; // TODO: Derive this from actual collision
 
   // If the minute, or hour has changed, jump the next chance we get
   if(minute_changed || hour_changed){