Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Ruby dependency and streamlined repo #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.rvmrc
.DS_Store
.rbenv*
*~
node_modules/
14 changes: 0 additions & 14 deletions Gemfile

This file was deleted.

110 changes: 0 additions & 110 deletions Gemfile.lock

This file was deleted.

1 change: 0 additions & 1 deletion Procfile

This file was deleted.

12 changes: 10 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# [Gorillas](http://gorillaz.herokuapp.com) in Coffeescript
# [Gorillas](http://drdub.github.io/gorillas/) in Coffeescript

## License

The content of this project itself is licensed under the [Creative Commons Attribution 3.0 license](http://creativecommons.org/licenses/by/3.0/us/deed.en_US), and the underlying source code used to format and display that content is licensed under the [MIT license](http://opensource.org/licenses/mit-license.php).

## Running it locally

You need to have the different Gems listed in the ``Gemfile`` installed, then bring a local server up using ``rackup`` (package ``ruby-rack``).
You will need node.js and npm:

```bash
$ node install
$ node run build
$ node start
```

The game will be available at http://127.0.0.1:8888/
17 changes: 17 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var haml = require('hamljs'),
fs = require('fs'),
cs = require('coffeescript'),
sass = require('node-sass');

fs.writeFileSync("public/index.html", haml.render(fs.readFileSync("index.haml"),{}));
fs.writeFileSync("public/gorillas.js", cs.compile(fs.readFileSync("gorillas.coffee").toString(), {'filename':'gorillas.coffee'}));
sass.render({
file: "style.scss",
outFile: "public/style.css"
}, function(error, result) {
if(!error){
fs.writeFileSync("public/style.css", result.css);
}else{
console.log(error);
}
});
3 changes: 0 additions & 3 deletions config.ru

This file was deleted.

File renamed without changes.
48 changes: 48 additions & 0 deletions index.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
!!!
%html
%head
%link{ rel : "stylesheet", href : "/style.css", type : "text/css", media : "all"}
%script{ type : "text/javascript", src : "/javascript/jquery-1.7.2.min.js"}
%script{ type : "text/javascript", src : "/gorillas.js"}
%title Gorillas in canvas

:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30581394-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

%body
%a{ href : "https://github.com/despo/gorillas" }
%img{ style : "position: absolute; top: 0; right: 0; border: 0;", src : "https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png", alt : "Fork me on GitHub" }
.board
.players
#player_1
Player 1
%br
%label{ for : '#player_1_angle' } angle
%input{ id : "player_1_angle", maxlength : 3 }
%br
%label{ for : '#player_1_velocity' } velocity
%input{ id : "player_1_velocity", maxlength : 3 }
#player_2
Player 2
%br
%label{ for : '#player_2_angle' } angle
%input{ id : "player_2_angle", maxlength : 3 }
%br
%label{ for : '#player_2_velocity' } velocity
%input{ id : "player_2_velocity", maxlength : 3 }
%canvas{ id : "gorillas", width : "1024", height : "640" }

#score
%label#value 0>Score<0

%footer
Created by
%a{ href : "https://twitter.com/despo" } @despo
26 changes: 0 additions & 26 deletions lib/gorillas.rb

This file was deleted.

Loading