diff --git a/README.md b/README.md index a8e71b3..11b7f85 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,11 @@ -# Stoner Alarm -An alarm designed to reliably wake a snoozing stoner. Seize the day (or at least don't get fired)! +# Trigalarm +A habit-correcting alarm for heavy sleepers. Cannot be shut off until you solve a triangle. ## The Pitch ### Simple The app only has one page. You can only set one alarm. There is no snooze, there is no weekly schedule, and there is no way to disable the alarm (you'll always have one set - every day - like it or not). ### Persistent -The alarm cannot be stopped until the drowsy stoner completes a thematically appropriate, touch-based game. Play well enough and quickly enough to prove you're awake and defuse the alarm. -#### "What if I just force-close the app in my sleep?" -Then it will schedule itself to re-open ASAP :) -### The Game -The alarm-defusing game requires you to serve some customers at an illegal flower bar. There are three stages, with each stage having its own meter to fill before progressing to the next. -#### The Stages -1. Grind the flower - - Quickly move your finger in a circle to utilize the grinder -2. Fill the bowls - - Drag the ground flower into each bowl -3. Light the bowls - - Swipe in the prompted direction with good reaction time to use the lighter +The alarm cannot be stopped until you solve a randomized triangle. Even if you force-close the app, it will re-open itself until you solve the triangle. -For all stages, be sure to watch for cops! Don't move a muscle when they're looking. +## Why Trigonometry? +Because it requires the perfect amount of thought to activate your brain in the morning. If the app gave you a more typical math problem, you could just mindlessly punch it into a calculator. Trigonometry still requires a base amount of thought ("Do I need sine, cosine, or tangent?") before a calculator is of any use. diff --git a/package.json b/package.json index a99f112..7c32d4a 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "stoner-alarm", + "name": "trigalarm", "author": "RandyTheSilly", "version": "1.0.0", - "keywords": ["alarm"], + "keywords": ["alarm", "math", "trigonometry", "trig", "triangle"], "private": true, "dependencies": {}, "pebble": { - "displayName": "Stoner Alarm", + "displayName": "Trigalarm", "uuid": "293cd38c-4e8c-46ae-a3dc-c789d7ce93ab", "sdkVersion": "3", "enableMultiJS": true, @@ -22,16 +22,24 @@ "resources": { "media": [ { - "file": "leaf.png", + "file": "clock25.png", "memoryFormat": "Smallest", - "name": "LEAF", + "name": "CLOCK25", + "spaceOptimization": "storage", + "type": "bitmap", + "menuIcon": true + }, + { + "file": "clock35.png", + "memoryFormat": "Smallest", + "name": "CLOCK35", "spaceOptimization": "storage", "type": "bitmap" }, { - "file": "clock.png", + "file": "check.png", "memoryFormat": "Smallest", - "name": "CLOCK", + "name": "CHECK", "spaceOptimization": "storage", "type": "bitmap" } diff --git a/resources-base/ATTRIBUTION.md b/resources-base/ATTRIBUTION.md index cb308d2..ebfbf89 100644 --- a/resources-base/ATTRIBUTION.md +++ b/resources-base/ATTRIBUTION.md @@ -1,8 +1,5 @@ -# Leaf Icon -[marijuana leaf by Rachel Fredericks](https://thenounproject.com/icon/marijuana-leaf-6959339/) (CC BY 3.0) - # Check Icon -[checkmark by Asmuh](https://thenounproject.com/icon/checkmark-2193586/) (CC BY 3.0) +Modified version of [checkmark by Asmuh](https://thenounproject.com/icon/checkmark-2193586/) (CC BY 3.0) # Clock Icon -[pebble-dev/iconography](https://raw.githubusercontent.com/pebble-dev/iconography/refs/heads/master/pebbleos/Pebble_50x50_Alarm_clock.svg) +Modified version of [pebble-dev/iconography](https://raw.githubusercontent.com/pebble-dev/iconography/refs/heads/master/pebbleos/Pebble_50x50_Alarm_clock.svg) diff --git a/resources-base/clock.svg b/resources-base/clock.svg new file mode 100644 index 0000000..24e8741 --- /dev/null +++ b/resources-base/clock.svg @@ -0,0 +1,144 @@ + + + + + + + + + + + + diff --git a/resources-base/clock50x50.svg b/resources-base/clock50x50.svg deleted file mode 100644 index 53e7e2b..0000000 --- a/resources-base/clock50x50.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - diff --git a/resources-base/leaf.svg b/resources-base/leaf.svg deleted file mode 100644 index 6f17415..0000000 --- a/resources-base/leaf.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - diff --git a/resources/check.png b/resources/check.png deleted file mode 100644 index 583fd76..0000000 Binary files a/resources/check.png and /dev/null differ diff --git a/resources/check~color.png b/resources/check~color.png new file mode 100644 index 0000000..17a0475 Binary files /dev/null and b/resources/check~color.png differ diff --git a/resources/clock.png b/resources/clock.png deleted file mode 100644 index ef0ec96..0000000 Binary files a/resources/clock.png and /dev/null differ diff --git a/resources/clock25~color.png b/resources/clock25~color.png new file mode 100644 index 0000000..12e3f56 Binary files /dev/null and b/resources/clock25~color.png differ diff --git a/resources/clock35~color.png b/resources/clock35~color.png new file mode 100644 index 0000000..46e3d5f Binary files /dev/null and b/resources/clock35~color.png differ diff --git a/resources/leaf~200w.png b/resources/leaf~200w.png deleted file mode 100644 index 471d712..0000000 Binary files a/resources/leaf~200w.png and /dev/null differ diff --git a/resources/leaf~260w.png b/resources/leaf~260w.png deleted file mode 100644 index d8f09c0..0000000 Binary files a/resources/leaf~260w.png and /dev/null differ diff --git a/src/c/main.c b/src/c/main.c index 29c1a87..df5c091 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -2,15 +2,17 @@ // layer-age static Window *s_window; -static BitmapLayer *s_leaf_layer; static Layer *s_top_bar_layer; static Layer *s_bottom_bar_layer; +static BitmapLayer *s_clock_bmp_layer; +static BitmapLayer *s_check_bmp_layer; // bitmaps -static GBitmap *s_leaf_bmp; +static GBitmap *s_clock_bmp; +static GBitmap *s_check_bmp; // global vars -static GColor s_bar_color = GColorDarkGreen; +static GColor s_bar_color = GColorMayGreen; // constants static const uint8_t s_edge_bar_height = ((PBL_DISPLAY_HEIGHT / 7) * 2); @@ -27,32 +29,41 @@ static void rect_fill_layer_update_proc(Layer *layer, GContext *ctx) { } static void setter_window_load() { - window_set_background_color(s_window, GColorMintGreen); - - // leaf - s_leaf_bmp = gbitmap_create_with_resource(RESOURCE_ID_LEAF); - s_leaf_layer = bitmap_layer_create(GRect(PBL_IF_ROUND_ELSE(0, -4), PBL_IF_ROUND_ELSE(0, 7), PBL_IF_ROUND_ELSE(PBL_DISPLAY_WIDTH, PBL_DISPLAY_WIDTH + 8), PBL_DISPLAY_HEIGHT)); - bitmap_layer_set_alignment(s_leaf_layer, GAlignCenter); - bitmap_layer_set_compositing_mode(s_leaf_layer, GCompOpSet); - bitmap_layer_set_bitmap(s_leaf_layer, s_leaf_bmp); - // top&bottom bars - s_top_bar_layer = layer_create(GRect(0, 0, PBL_DISPLAY_WIDTH, s_edge_bar_height)); + GRect top_bar_grect = GRect(0, 0, PBL_DISPLAY_WIDTH, s_edge_bar_height); + s_top_bar_layer = layer_create(top_bar_grect); layer_set_update_proc(s_top_bar_layer, rect_fill_layer_update_proc); - s_bottom_bar_layer = layer_create(GRect(0, PBL_DISPLAY_HEIGHT - s_edge_bar_height, PBL_DISPLAY_WIDTH, s_edge_bar_height)); + GRect bottom_bar_grect = GRect(0, PBL_DISPLAY_HEIGHT - s_edge_bar_height, PBL_DISPLAY_WIDTH, s_edge_bar_height); + s_bottom_bar_layer = layer_create(bottom_bar_grect); layer_set_update_proc(s_bottom_bar_layer, rect_fill_layer_update_proc); + // clock icon + s_clock_bmp = gbitmap_create_with_resource(RESOURCE_ID_CLOCK35); + s_clock_bmp_layer = bitmap_layer_create(GRect(PBL_IF_ROUND_ELSE(0, 8), PBL_IF_ROUND_ELSE(8, 0), top_bar_grect.size.w, top_bar_grect.size.h)); + bitmap_layer_set_bitmap(s_clock_bmp_layer, s_clock_bmp); + bitmap_layer_set_alignment(s_clock_bmp_layer, PBL_IF_ROUND_ELSE(GAlignTop, GAlignLeft)); + bitmap_layer_set_compositing_mode(s_clock_bmp_layer, GCompOpSet); + + // check icon + s_check_bmp = gbitmap_create_with_resource(RESOURCE_ID_CHECK); + s_check_bmp_layer = bitmap_layer_create(bottom_bar_grect); + bitmap_layer_set_bitmap(s_check_bmp_layer, s_check_bmp); + bitmap_layer_set_compositing_mode(s_check_bmp_layer, GCompOpSet); + Layer *window_layer = window_get_root_layer(s_window); - layer_add_child(window_layer, bitmap_layer_get_layer(s_leaf_layer)); layer_add_child(window_layer, s_top_bar_layer); layer_add_child(window_layer, s_bottom_bar_layer); + layer_add_child(window_layer, bitmap_layer_get_layer(s_clock_bmp_layer)); + layer_add_child(window_layer, bitmap_layer_get_layer(s_check_bmp_layer)); } static void setter_window_unload() { + bitmap_layer_destroy(s_check_bmp_layer); + bitmap_layer_destroy(s_clock_bmp_layer); + gbitmap_destroy(s_check_bmp); + gbitmap_destroy(s_clock_bmp); layer_destroy(s_bottom_bar_layer); layer_destroy(s_top_bar_layer); - bitmap_layer_destroy(s_leaf_layer); - gbitmap_destroy(s_leaf_bmp); } static void init() { @@ -60,7 +71,7 @@ static void init() { switch (launch_reason()) { case APP_LAUNCH_WAKEUP: - break; // TODO alarm game time! + break; // TODO math time! default: window_set_window_handlers( s_window,