Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 28 additions & 24 deletions appinfo.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
{
"uuid": "d0c1bba9-48cc-4edc-8a58-54eeed7575f5",
"shortName": "Helibble",
"longName": "Helibble",
"companyName": "MakeAwesomeHappen",
"versionCode": 1,
"versionLabel": "1.0.0",
"watchapp": {
"watchface": false
},
"appKeys": {
"dummy": 0
},
"resources": {
"media": [
{
"type": "png",
"name": "IMAGE_HELI",
"file": "helicopter.png"
"appKeys": {
"dummy": 0
},
{
"type": "png",
"name": "IMAGE_HELI_TILT",
"file": "helicopter_tilt.png"
"capabilities": [
""
],
"companyName": "MakeAwesomeHappen",
"longName": "Helibble",
"projectType": "native",
"resources": {
"media": [
{
"file": "images/helicopter_tilt.png",
"name": "IMAGE_HELI_TILT",
"type": "png"
},
{
"file": "images/helicopter.png",
"name": "IMAGE_HELI",
"type": "png"
}
]
},
"shortName": "Helibble",
"uuid": "d0c1bba9-48cc-4edc-8a58-54eeed7575f5",
"versionCode": 1,
"versionLabel": "1.1",
"watchapp": {
"watchface": false
}
]
}
}
File renamed without changes
File renamed without changes
7 changes: 7 additions & 0 deletions src/helicopter.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ char best_score_str[20];

#define REFRESH_RATE 50
#define MIN_HEIGHT 70

#define PERSIST_SCORE 0

int c = 1;

Expand Down Expand Up @@ -244,10 +246,15 @@ static void init(void) {
window_set_fullscreen(window, true);
window_stack_push(window, animated);
light_enable(true);
if (persist_exists(PERSIST_SCORE)) {
// Load stored count
best_score = persist_read_int(PERSIST_SCORE);
}
}

static void deinit(void) {
window_destroy(window);
persist_write_int(PERSIST_SCORE, best_score);
}

int main(void) {
Expand Down
57 changes: 57 additions & 0 deletions wscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

#
# This file is the default set of rules to compile a Pebble project.
#
# Feel free to customize this to your needs.
#

import os.path
try:
from sh import CommandNotFound, jshint, cat, ErrorReturnCode_2
hint = jshint
except (ImportError, CommandNotFound):
hint = None

top = '.'
out = 'build'

def options(ctx):
ctx.load('pebble_sdk')

def configure(ctx):
ctx.load('pebble_sdk')
global hint
if hint is not None:
hint = hint.bake(['--config', 'pebble-jshintrc'])

def build(ctx):
if False and hint is not None:
try:
hint([node.abspath() for node in ctx.path.ant_glob("src/**/*.js")], _tty_out=False) # no tty because there are none in the cloudpebble sandbox.
except ErrorReturnCode_2 as e:
ctx.fatal("\nJavaScript linting failed (you can disable this in Project Settings):\n" + e.stdout)

# Concatenate all our JS files (but not recursively), and only if any JS exists in the first place.
ctx.path.make_node('src/js/').mkdir()
js_paths = ctx.path.ant_glob(['src/*.js', 'src/**/*.js'])
if js_paths:
ctx(rule='cat ${SRC} > ${TGT}', source=js_paths, target='pebble-js-app.js')
has_js = True
else:
has_js = False

ctx.load('pebble_sdk')

ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'),
target='pebble-app.elf')

if os.path.exists('worker_src'):
ctx.pbl_worker(source=ctx.path.ant_glob('worker_src/**/*.c'),
target='pebble-worker.elf')
ctx.pbl_bundle(elf='pebble-app.elf',
worker_elf='pebble-worker.elf',
js='pebble-js-app.js' if has_js else [])
else:
ctx.pbl_bundle(elf='pebble-app.elf',
js='pebble-js-app.js' if has_js else [])