Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by jan

Hi all,
Sorry if this has been asked before (searched, didn't see anything), but what I'm trying to do is have the Impact engine one one place on my server's file system and have the games in another, so I don't have to have multiple copies of the engine, or pollute the /lib directory with all the game files. The reasoning behind this is because I want to have multiple games on a site that are loaded dynamically onto a game page.

So far, my directory structure is like so (individual files omitted for brevity):
root
- games
- - MyGame
- - - entities
- - - levels
- - - media
- lib
- - impact
- - plugins

(sorry for the goofy formatting)

When I try to load the game this way I get an error in Firebug's console stating:
uncaught exception: Failed to load module games.MyGame.levels.test at lib/games/MyGame/levels/test.js required from MyGame.main

I know this is because the Impact engine expects the game assets to be under the /lib directory - is there any way to override this?

*Note that I know my /media directory is set up differently, but this works when the /MyGame directory is located under /lib.

Thanks in advance!

1 decade ago by jan

[redacted]

1 decade ago by fugufish

there's something in impact.js, line 73 that has this:


lib: '/game/lib/',

1 decade ago by fugufish

in your case you could edit it whatever way you like, and all the files will be loaded based on this

i think the default was

  lib: 'lib/',

1 decade ago by Hareesun

Bake it? If you're hosting and linking to the site, then it should be baked. :)

1 decade ago by jan

@fugufish - thanks! I was hoping to avoid making any modifications to Impact itself, but I guess it won't be so bad as long as I can remember what I changed.

@Hareesun - true. This was more of a development experiment/exercise.
Page 1 of 1
« first « previous next › last »