The game won't load.
Issue fork tetris-355635
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
The game won't load.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
valdes1978 commentedError: tetris_initialize_game is not defined
Line: 83
Comment #2
boftx commentedI am getting the same error for this, and for all of the related games: breakout, pong, etc. It appears on FireFox2 and 3, as well as IE7.
Here is the code displayed in the FireFox error console:
Any help would be greatly appreciated.
Jim
Comment #3
boftx commentedI found the problem. The code apparently assumes that drupal is in the top-level directory of the website. If it is in a subdirectory, as I have it, then the hard coded paths of "/modules/tetris/*" will fail miserably. I am working around this for the time being by have a duplicate modules directory containing the tetris (and other game) modules in my top directoy.
This should be classed as a fairly severe bug, IMHO.
Jim
Comment #4
valdes1978 commentedI made a folder modules with tetris inside and now it is working.
I guess this will be fixed with a later version of the game.
thanks for the workaround :)
Comment #5
skinhat commentedPerhaps I need to make it like in views (views.module):
$path = drupal_get_path('module', 'views');
require_once("./$path/views_cache.inc");
with a dot and slash in the front. That wouldnt be the root any more would it?
Comment #6
olsondavida commentedbump
Comment #7
skinhat commentedLooking at other modules code if you add a .js script to your module you should use drupal_add_js() instead of coding the .js file in yourself. I've now updated my modules so uses drupal_add_js() instead. Hopefully this will fix the problem.
Comment #8
CONTEXTFLEXED commentedJust take the tetris.js file out of the folder, change it to tetris.txt, open it, use "replace all". If the name of your Drupal Directory is something like "Yeahdude" , then replace:
/modules/
with
/Yeahdude/modules/
Then flip the file back into tetris.js, and replace tetris.js in your module with the new one. I just did it, and it works fine, except you need to do something for the background image too. I haven't figured that out yet. Too busy playing Tetris.