Skip to content

Commit

Permalink
Merge branch 'feature/desktop'
Browse files Browse the repository at this point in the history
  • Loading branch information
petarov committed Jun 1, 2016
2 parents 878ceff + d463369 commit 2692e48
Show file tree
Hide file tree
Showing 13 changed files with 161 additions and 63 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ urch
*.zip
Crafty/
.settings
cache/
webkitbuilds/
27 changes: 24 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ module.exports = function (grunt) {
'dist/lib/crafty.js',
'dist/lib/gj-js-api.js'
],
desktop: [
'dist/chrome.js',
'dist/manifest.json'
],
dist: [
'dist/*'
]
Expand Down Expand Up @@ -87,7 +91,13 @@ module.exports = function (grunt) {
{expand: true, src: ['manifest.json'], dest: 'dist/', flatten: true},
{expand: true, src: ['assets/crx/*.png'], dest: 'dist/', flatten: true}
]
},
},
desktop: {
files: [
{expand: true, src: ['assets/crx/*.png'], dest: 'dist/', flatten: true},
{expand: true, src: ['package.json'], dest: 'dist/', flatten: true},
]
},
},
concat: {
options: {
Expand Down Expand Up @@ -157,10 +167,20 @@ module.exports = function (grunt) {
archive: 'strider-v' + pkg.version + '.zip'
},
files: [
{expand: true, cwd: 'dist/', src: ['**/*']},
{expand: true, cwd: 'dist/', src: ['**/*']},
]
}
}
},
nwjs: {
options: {
version: 'v0.12.3',
platforms: ['linux64', 'osx64', 'win64'],
buildDir: './webkitbuilds',
winIco: 'assets/desktop/icon_128.ico',
macIcns: 'assets/desktop/icon_128.icns'
},
src: ['./dist/**/**']
},
});

grunt.registerTask('build', ['concat', 'replace', 'copy']);
Expand All @@ -170,4 +190,5 @@ module.exports = function (grunt) {
grunt.registerTask('prod', ['build', 'uglify', 'processhtml:dist', 'clean:game']);
grunt.registerTask('zip', ['prod', 'compress']);
grunt.registerTask('crx', ['build', 'copy:crx', 'uglify', 'processhtml:crx', 'clean:game', 'compress']);
grunt.registerTask('desktop', ['build', 'copy:desktop', 'uglify', 'processhtml:crx', 'clean:game', 'clean:desktop', 'nwjs']);
};
Binary file added assets/desktop/icon_128.icns
Binary file not shown.
Binary file added assets/desktop/icon_128.ico
Binary file not shown.
13 changes: 13 additions & 0 deletions assets/desktop/strider.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Desktop Entry]
Encoding=UTF-8
Name=Strider
GenericName=Action Game
Version=@@VERSION
Type=Application
Categories=Game;ActionGame;ArcadeGame
Keywords=Game;Action;2D;Arcade;Shooter
Comment=Strider is a 2D sci-fi platformer
TryExec=strider
Exec=strider
Terminal=false
Icon=strider48
25 changes: 14 additions & 11 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
padding: 0;
cursor: default;
}
body, html {
margin:0;
padding: 0;
overflow:hidden;
height: 100%;
font-family: 'Jura', Arial, sans-serif;
font-size:20px
body, html {
margin:0;
padding: 0;
overflow:hidden;
height: 100%;
font-family: 'Jura', Arial, sans-serif;
font-size: 20px
}
body, html {
background: rgb(224,226,228); /* Old browsers */
Expand All @@ -32,7 +32,7 @@ body, html {
background: -ms-linear-gradient(top, rgba(224,226,228,1) 0%,rgba(185,187,189,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(224,226,228,1) 0%,rgba(185,187,189,1) 100%); /* W3C */
}
#game {
#game {
position: absolute;
top: 0;
left: 50%;
Expand All @@ -43,14 +43,17 @@ body, html {
transform: translate(-50%, 0%);
width: 400px;
height: 640px;
border: 1px solid #999;
color:white;
border: 1px solid #999;
color:white;
-webkit-box-shadow: 0px 0px 32px 0px rgba(0, 0, 0, .5);
box-shadow: 0px 0px 32px 0px rgba(0, 0, 0, .5);
}
.canvas-pos {
top: 12% !important;
}
p.sorry {
margin: 0 auto;
text-align: center;
font-size: 12px;
visibility: hidden;
}
}
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<% } else if (environment !== 'crx') { %>
<script src="lib/gj-js-api.js"></script>
<% } %>
/build -->
/build -->
<!-- build:js:dist,crx lib/crafty-min.js -->
<script src="lib/crafty.js"></script>
<!-- /build -->
Expand All @@ -28,4 +28,4 @@
<!-- build:include:dist urch -->
<!-- /build -->
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"short_name": "Strider",
"description": "Strider is a 2D sci-fi platformer game.",
"author": "Dvubuz Games",
"version": "1.0.5",
"version": "1.0.6",
"app": {
"background": {
"scripts": ["chrome.js"]
Expand All @@ -16,4 +16,4 @@
"128": "icon_128.png"
},
"permissions": ["storage"]
}
}
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "Strider",
"description": "Strider is a 2D sci-fi platformer game.",
"version": "1.0.5",
"version": "1.0.6",
"private": true,
"main": "index.html",
"devDependencies": {
"bower": "^1.4.1",
"connect-livereload": "^0.5.3",
Expand All @@ -15,13 +16,24 @@
"grunt-contrib-uglify": "^0.10.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-html-build": "^0.5.2",
"grunt-nw-builder": "^2.0.0",
"grunt-open": "^0.2.3",
"grunt-processhtml": "^0.3.7",
"grunt-replace": "^0.11.0",
"matchdep": "^1.0.0",
"serve-static": "^1.10.0"
},
"engines": {
"node": ">=0.8.0"
}
"node": ">=0.12.0"
},
"window": {
"title": "Strider",
"icon": "icon_48.png",
"toolbar": false,
"frame": false,
"min_width": 1024,
"min_height": 768,
"fullscreen": true
},
"chromium-args": "--disable-device-orientation"
}
Loading

0 comments on commit 2692e48

Please sign in to comment.