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 vidja_games

I was wondering if anyone came up with a clever way to use a single impact dir for multiple game installs. The only way I can think of involves editing the impact source to allow for calling directories above where the game is at. I can't imagine this is the best way.

1 decade ago by vidja_games

Ok so far here is how I've done it:

where the 'game' directory sits is where i put my specific game.

so the dir to main.js is now:

lib/impact/my_game/main.js

This means that for module names and imports the name needs to now read:

'my_game.player' //for my player entity instead of the normal 'game.player'

This prevents collisions between games and assures that you are loading the appropriate classes for the project you are working on.

I then keep the media folder inside of the my_game folder instead of above it in the media folder and I need to setup a media prefix var so i can load the media outside of the default impact directory.
lib/impact/my_game/media/song.ogg

Hope this helps someone else trying to do the same. Any comments are welcome.

1 decade ago by vidja_games

duplicate post

1 decade ago by taddeimania

i've always wondered if I could do this type of thing with symbolic links. Could be pretty easy to make a bash script to scaffold your structure so all of your framework code is just stored in one location with links pointing back towards it.

I'll give this a shot in the near future and report back :)

1 decade ago by taddeimania

If you are running a linux distribution or OSX I whipped this up tonight. I'll make a .bat for windows this weekend. My windows PC is not conveniently accessible right now.

I'm happy to take a pull request if someone would like to submit one :)

https://github.com/taddeimania/impactjs-scaffold
Page 1 of 1
« first « previous next › last »