From 9cfbb59e7b35aee7203c00816195dc041f8cf76f Mon Sep 17 00:00:00 2001 From: Collin Green Date: Mon, 24 Nov 2014 17:01:05 -0800 Subject: [PATCH 1/3] add simple scaling to support more resolutions Add simple scaling - fit horizontally, extra space falls off the bottom Remove some background colors to support extra space on bottom --- src/Application.js | 14 +++++++++----- src/GameScreen.js | 1 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Application.js b/src/Application.js index 47e681c..0bb1e34 100644 --- a/src/Application.js +++ b/src/Application.js @@ -22,17 +22,21 @@ exports = Class(GC.Application, function () { var titlescreen = new TitleScreen(), gamescreen = new GameScreen(); - this.view.style.backgroundColor = '#30B040'; + this.view.style.backgroundColor = '#008a42'; - //Add a new StackView to the root of the scene graph + + // Create a stackview of size 320x480, then scale it to fit horizontally + // Add a new StackView to the root of the scene graph var rootView = new StackView({ superview: this, - x: device.width / 2 - 160, - y: device.height / 2 - 240, + // x: device.width / 2 - 160, + // y: device.height / 2 - 240, + x: 0, + y: 0, width: 320, height: 480, clip: true, - backgroundColor: '#37B34A' + scale: device.width / 320 }); rootView.push(titlescreen); diff --git a/src/GameScreen.js b/src/GameScreen.js index d350992..da14c27 100644 --- a/src/GameScreen.js +++ b/src/GameScreen.js @@ -31,7 +31,6 @@ exports = Class(ui.View, function (supr) { y: 0, width: 320, height: 480, - backgroundColor: '#37B34A' }); supr(this, 'init', [opts]); From d9061b5c3d580bb4f7d0d638edd5ba88b6b87f08 Mon Sep 17 00:00:00 2001 From: Collin Green Date: Mon, 24 Nov 2014 17:03:28 -0800 Subject: [PATCH 2/3] add modules to gitignore --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 31ebf6d..d784ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ build/ -sdk +modules .DS_Store -.version \ No newline at end of file +.version From 54f3a22c97ee5077e0626ae66713dc990f2a7088 Mon Sep 17 00:00:00 2001 From: Collin Green Date: Mon, 24 Nov 2014 17:18:32 -0800 Subject: [PATCH 3/3] update readme with instructions and link to browser build --- README.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7eccdd4..43023a5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,27 @@ -Your first game using the Game Closure SDK. +#Your first game using the [Game Closure SDK](http://gameclosure.com). -A detailed explanation of the game code can be found in the [Game Walk-Through Guide](http://doc.gameclosure.com/guide/game-walkthrough.html). +![WhackThatMole](http://storage.googleapis.com/devkit-example-games/whackthatmole/whackthatmole_screenshot.png) + +A detailed explanation of the game code can be found in the +[Game Walk-Through Guide](http://docs.gameclosure.com/guide/game-walkthrough.html). + +##Prerequisites: +You need devkit installed to run this game locally. Please follow the devkit +installation instructions. + + +##Quick Start: + +Clone this game: +`git clone git@github.com:gameclosure/whack-that-mole whackthatmole` +Change into the game directory: +`cd whackthatmole` + +Add Devkit to the project (and register with the simulator) +`devkit install` + +That's it! Run the simulator and open the WhackThatMole project. + +##Play the Game: +[Play in the +Browser](http://storage.googleapis.com/devkit-example-games/whackthatmole/index.html)