-
Notifications
You must be signed in to change notification settings - Fork 0
CRAFTY
Michael Smith edited this page Oct 20, 2013
·
1 revision
This guide clarifies the differences between the tutorial organization and the organization of files within Rails.
-
lib/ 3rd party js files
-
crafty.js The Crafty Engine
wget http://craftyjs.com/release/0.5.3/crafty.js
-
crafty.js The Crafty Engine
-
index.html The main console where Crafty is rendering
- open this file in your browser to view game
-
src/ Directory for custom game related code (your engine)
- game.js Your Game Logic
-
assets/ Directory for media files and other binary data
- Get Tutorial Zip and unzip it here
rails server
rails generate controller Game index
- index.html => app/views/game/index.html.erb
- src/game.js => app/assets/javascripts/game.js
-
vendor/assets/javascripts/*.js 3rd party javascripts
- crafty.js game engine goes here
- lib/assets/javascripts/*.js 1st party reusable functions
-
app/assets/javascripts/*.js application specific code
-
application.js
- //= require crafty # loads crafty game engine
-
game.js
- the main javascript driver
- corresponds to Game controller
-
game/*.js
- for javascript game logic organization
- prevent cluttering the app/assets/javascripts directory
-
application.js
- tutorial written in javascript
- coffeescript preferred
- pictures and sounds
- assets/* => app/assets/game/*