IgeCannonComponent for physics collision
-
zaquanishak
- Posts: 53
- Joined: Mon Aug 26, 2013 1:54 am
IgeCannonComponent for physics collision
Hi,
From the example 14.2-isoobjects-physics, i see u add the IgeCannonComponent in the index.js. Well i try to do the same for multiplayer but it's not working. I getting error
on the server 'C;\wamp\www\root\engine\core\IgeClass.js:130 var newComponent = new component(this, options); TypeError: object is not a function at IgeClass.addComponent (c:\wamp\www\root\engine\core\IgeClass.js:130:23) . But for single player it seem working. Could u help me out?
Regards,
Zachz
From the example 14.2-isoobjects-physics, i see u add the IgeCannonComponent in the index.js. Well i try to do the same for multiplayer but it's not working. I getting error
on the server 'C;\wamp\www\root\engine\core\IgeClass.js:130 var newComponent = new component(this, options); TypeError: object is not a function at IgeClass.addComponent (c:\wamp\www\root\engine\core\IgeClass.js:130:23) . But for single player it seem working. Could u help me out?
Regards,
Zachz
zachz
Programmer
compass-interactive
Programmer
compass-interactive
Re: IgeCannonComponent for physics collision
How are you running the server component?
You should run the server from the "server" folder in the examples
eg. node ige.js -g ../examples/14.2-isoobjects-physics
You should run the server from the "server" folder in the examples
eg. node ige.js -g ../examples/14.2-isoobjects-physics
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: IgeCannonComponent for physics collision
If that's the case the setup tutorial I created shows how its done.
-
zaquanishak
- Posts: 53
- Joined: Mon Aug 26, 2013 1:54 am
Re: IgeCannonComponent for physics collision
Okay now i get why it give me error when i try to addComponent IgeCannonComponent. It is because i didn't put it inside if(!ige.isServer) statement. So that mean the IgeCannonConent can only run in the client side is it?
Regards,
Zachz
Regards,
Zachz
zachz
Programmer
compass-interactive
Programmer
compass-interactive
-
zaquanishak
- Posts: 53
- Joined: Mon Aug 26, 2013 1:54 am
Re: IgeCannonComponent for physics collision
So how do i create a collision detection for multiplayer in the server side? Do i use tileoccupy? If so how should i do it?Okay now i get why it give me error when i try to addComponent IgeCannonComponent. It is because i didn't put it inside if(!ige.isServer) statement. So that mean the IgeCannonConent can only run in the client side is it
Regards,
Zachz
zachz
Programmer
compass-interactive
Programmer
compass-interactive
Re: IgeCannonComponent for physics collision
Ahh sorry, I think there's some confusion.
example 14.2 is not a server side demo.
For server side physics checkout example 23.1
Also if you're want multiplayer, checkout the 24.2-multiplayer example.
example 14.2 is not a server side demo.
For server side physics checkout example 23.1
Also if you're want multiplayer, checkout the 24.2-multiplayer example.
Re: IgeCannonComponent for physics collision
Also, there is a little issue with the IgeCannonComponent in master
Checkout the dev branch instead.
Or add the following to the bottom of the IgeCannonComponent.js to enable use within node
if (typeof(module) !== 'undefined' && typeof(module.exports) !== 'undefined') { module.exports = IgeCannonComponent; }
Checkout the dev branch instead.
Or add the following to the bottom of the IgeCannonComponent.js to enable use within node
if (typeof(module) !== 'undefined' && typeof(module.exports) !== 'undefined') { module.exports = IgeCannonComponent; }
Last edited by robaldred on Wed Aug 28, 2013 9:16 am, edited 1 time in total.
-
zaquanishak
- Posts: 53
- Joined: Mon Aug 26, 2013 1:54 am
Re: IgeCannonComponent for physics collision
thanks rob, but the thing is what i want is something like a collision for isometric. Similiar like 14.2-isoobjects-physics which use IgeCannonComponent. And another thing rob, how do i use occupyTile()? My scenario is like this, i created a building on client side and mount it to ige.client.foregroundMap on another hand i created a character and mount it on ige.server.foregroundMap. how do make this two entity know each other when i mount it on different IgeTileMap2d?
Thanks in advance.
Regards,
Zachz
Thanks in advance.
Regards,
Zachz
zachz
Programmer
compass-interactive
Programmer
compass-interactive
Re: IgeCannonComponent for physics collision
Call .streamMode(1) on entities to make them sync up, this will automatically take care of transformations.
Checkout http://www.isogenicengine.com/documenta ... streaming/
Checkout http://www.isogenicengine.com/documenta ... streaming/
-
zaquanishak
- Posts: 53
- Joined: Mon Aug 26, 2013 1:54 am
Re: IgeCannonComponent for physics collision
Thanks for your help. I manage to get it working. 
zachz
Programmer
compass-interactive
Programmer
compass-interactive