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 alexshendi

Hello folks,

I have a question using impact with node.js. The reason I'm trying to use node.js instead of PHP is that I don't know PHP, but am learning node.js anyway :)

So I have here:
- OpenBSD 5.1-beta
- node.js 0.6.14
- npm 1.1.12

Well I did npm install impact. This installed version 0.0.3 of the module. The current version is 0.1.1. I then did a npm install impact@0.1.1. npm then complained that I had node.js 0.6.14 and npm 1.1.12 whereas it wanted node.js 0.4 and npm 1.0.

So I have two questions:
- How do I install the correct version of the module?
- What do I do afterwards to make impact and node.js play together?
This is not really clear to me.

So happy Easter everybody and thanks in advance for your help.

Best Regards,

/Alexander

1 decade ago by Hareesun

You're over thinking it. :P

You don't need to know anything about PHP to use impact. You just need some software the runs a PHP server locally on your system. For mac, I use MAMP Pro, but I'm sure there are similar program's for other systems.

You shouldn't have to touch a single PHP file. :)

1 decade ago by alexshendi

I seem to have solved my problem. Please see my notes
below:

* Install node.js and npm.
* Download latest module from https://github.com/cpetzold/node-impact, e.g.
  cpetzold-node-impact-8f98f69.zip.
* mkdir ~/node_modules; cd ~/node_modules
* unzip cpetzold-node-impact-8f98f69.zip
* mv cpetzold-node-impact-8f98f69 impact
* cd impact
* edit package.json (apply the following diff:)

*** /home/alexshendi/node_modules/impact/package.json	Sun Apr  8 12:36:42 2012
--- package.json	Wed Oct 19 23:32:14 2011
***************
*** 5,16 ****
    "version": "0.1.1",
    "main": "./lib",
    "dependencies": {
!     "express": ">= 2.0.0",
!     "glob": ">= 2.0.9"
    },
    "engines": {
      "node": "0.4",
      "npm": "1"
    },
    "devDependencies": {}
! }
--- 5,16 ----
    "version": "0.1.1",
    "main": "./lib",
    "dependencies": {
!     "express": "2.0.0",
!     "glob": "2.0.9"
    },
    "engines": {
      "node": "0.4",
      "npm": "1"
    },
    "devDependencies": {}
! }
\ No newline at end of file

* Do 'npm install'
* cd $HOME
* Do 'npm install jade'
* Copy impact and weltmeister:
  cp -R $HOME/sources/packages/impact/lib/impact \
        $HOME/sources/packages/impact/lib/weltmeister \
        $HOME/node_modules/impact/example/public/lib/
* Install Pong:
  - unpack archive 'pong.zip' in $HOME/sources/packages/pong.
  - copy over impact and weltmeister files:
    cp -R $HOME/sources/packages/pong/pong \
          $HOME/node_modules/impact/example/public
* cd $HOME
* Start server by:
  node node_modules/impact/example/server.js
* We can play Pong by pointing a browser at http://localhost:8080.

1 decade ago by cmcculloh

Created a fork of node-impact that can be installed via npm:

npm install impact-fork


Git repo: https://github.com/cmcculloh/node-impact

This one currently works and the documentation is updated a bit. I'll issue a pull request for the author, but, I won't hold my breath.

1 decade ago by alexandre

This is very interesting. I wanted to serve game entities via node server. This seems right up that alley. Thanks for sharing.
Page 1 of 1
« first « previous next › last »