IgeCannonComponent for physics collision

All things HTML5 or text based engines, or really any web based engines.
Post Reply
zaquanishak
Posts: 53
Joined: Mon Aug 26, 2013 1:54 am

IgeCannonComponent for physics collision

Post by zaquanishak »

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
zachz
Programmer
compass-interactive
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: IgeCannonComponent for physics collision

Post by robaldred »

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
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: IgeCannonComponent for physics collision

Post by hallsofvallhalla »

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

Post by zaquanishak »

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
zaquanishak
Posts: 53
Joined: Mon Aug 26, 2013 1:54 am

Re: IgeCannonComponent for physics collision

Post by zaquanishak »

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
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?

Regards,
Zachz
zachz
Programmer
compass-interactive
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: IgeCannonComponent for physics collision

Post by robaldred »

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.
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: IgeCannonComponent for physics collision

Post by robaldred »

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; }
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

Post by zaquanishak »

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
zachz
Programmer
compass-interactive
robaldred
Posts: 64
Joined: Tue Aug 27, 2013 5:54 pm

Re: IgeCannonComponent for physics collision

Post by robaldred »

Call .streamMode(1) on entities to make them sync up, this will automatically take care of transformations.
Checkout http://www.isogenicengine.com/documenta ... streaming/
zaquanishak
Posts: 53
Joined: Mon Aug 26, 2013 1:54 am

Re: IgeCannonComponent for physics collision

Post by zaquanishak »

Thanks for your help. I manage to get it working. :D
zachz
Programmer
compass-interactive
Post Reply

Return to “HTML5/Web Engines”