uncaught type error property 'y2'

Post your help queries and engine programming questions here

uncaught type error property 'y2'

Postby beco1 » Mon Oct 05, 2015 12:58 pm

I'm on part 2 of that tutorial, and when I try to bring in that PlayerTexture.js(to see that player triangle thing) I get the follow:

Code: Select all
IGE *log* [IgeSocketIoComponent] : Network component initiated with socket.io version: undefined
2015-10-05 22:07:39.761 IgeClass.js:101
IGE *log* [IgeInputComponent] : Setting up input event listeners...
2015-10-05 22:07:39.766 IgeClass.js:101
IGE *log* [IgeTexture] : Texture script "./assets/PlayerTexture.js" loaded successfully
2015-10-05 22:07:40.366 IgeClass.js:101
IGE *log* [IgeEngine:ige] : All textures have loaded
2015-10-05 22:07:40.366 IgeClass.js:101
IGE *log* [IgeEngine:ige] : Starting engine...
2015-10-05 22:07:40.367 IgeClass.js:101
IGE *log* [IgeEngine:ige] : Engine started
2015-10-05 22:07:40.367 IgeClass.js:101
IGE *log* [IgeSocketIoComponent] : Connecting to socket.io server at "http://localhost:2000"...
2015-10-05 22:07:40.377 IgeClass.js:101
IGE *log* [IgeSocketIoComponent] : Connected to server!
2015-10-05 22:07:40.378 IgeClass.js:101
IGE *log* [IgeSocketIoComponent] : Received network command list with count: 7
2015-10-05 22:07:40.379 IgeClass.js:101
IGE *log* [IgeEngine:ige] : Loading SceneGraph data class: IgeBaseScene
2015-10-05 22:07:40.386 IgeClass.js:101
IGE *log* [Client] : Stream entity created with ID: exent
2015-10-05 22:07:40.409 PlayerTexture.js:6
Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.129 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.145 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.162 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.179 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.198 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.212 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.230 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.245 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.262 PlayerTexture.js:6


which continues infinitely(chrome console)

and firefox console gives me:
Code: Select all
TypeError: entity._geometry is undefined

also infinitely repeated.

I also havent been able to get the sceneGraph up from the previous section if that means anything. If I didnt know better I'd say it had something to do with canvas..

its breaking on line 6 of PlayerTexture.js:

Code: Select all
ctx.moveTo(0, -entity._geometry.y2);


when I replace the "entity._geometry" with numbers the engine renders the image.. still no sceneGraph tho :?
beco1
 
Posts: 1
Joined: Mon Oct 05, 2015 11:49 am

Re: uncaught type error property 'y2'

Postby ZetCoby » Mon Nov 09, 2015 8:13 pm

same problem here :(
ZetCoby
 
Posts: 2
Joined: Thu Nov 05, 2015 5:19 pm

Re: uncaught type error property 'y2'

Postby Riowind » Sat Nov 28, 2015 2:00 am

This is just a problem with the texture supplied in the tutorial.

To fix this I just copied the lander example's ship.js code:
Code: Select all
var image = {
   render: function (ctx, entity) {
      // Draw the player entity
      ctx.fillStyle = '#0090ff';
      ctx.beginPath();
      ctx.moveTo(0, -entity._bounds2d.y2);
      ctx.lineTo(entity._bounds2d.x2, entity._bounds2d.y2);
      ctx.lineTo(0, entity._bounds2d.y2 - 5);
      ctx.lineTo(-entity._bounds2d.x2, entity._bounds2d.y2);
      ctx.lineTo(0, -entity._bounds2d.y2);
      ctx.fill();
   }
};
Riowind
 
Posts: 8
Joined: Thu Oct 29, 2015 7:55 pm

Re: uncaught type error property 'y2'

Postby rob » Mon Nov 30, 2015 11:05 am

I think _geometry is now _bounds2d.

It's my fault as I didn't remember to update the tutorial code on the site when we made the switch way back when.
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm

Re: uncaught type error property 'y2'

Postby rob » Tue Dec 01, 2015 2:40 pm

beco1 wrote:I'm on part 2 of that tutorial, and when I try to bring in that PlayerTexture.js(to see that player triangle thing) I get the follow:

Code: Select all
IGE *log* [IgeSocketIoComponent] : Network component initiated with socket.io version: undefined
2015-10-05 22:07:39.761 IgeClass.js:101
IGE *log* [IgeInputComponent] : Setting up input event listeners...
2015-10-05 22:07:39.766 IgeClass.js:101
IGE *log* [IgeTexture] : Texture script "./assets/PlayerTexture.js" loaded successfully
2015-10-05 22:07:40.366 IgeClass.js:101
IGE *log* [IgeEngine:ige] : All textures have loaded
2015-10-05 22:07:40.366 IgeClass.js:101
IGE *log* [IgeEngine:ige] : Starting engine...
2015-10-05 22:07:40.367 IgeClass.js:101
IGE *log* [IgeEngine:ige] : Engine started
2015-10-05 22:07:40.367 IgeClass.js:101
IGE *log* [IgeSocketIoComponent] : Connecting to socket.io server at "http://localhost:2000"...
2015-10-05 22:07:40.377 IgeClass.js:101
IGE *log* [IgeSocketIoComponent] : Connected to server!
2015-10-05 22:07:40.378 IgeClass.js:101
IGE *log* [IgeSocketIoComponent] : Received network command list with count: 7
2015-10-05 22:07:40.379 IgeClass.js:101
IGE *log* [IgeEngine:ige] : Loading SceneGraph data class: IgeBaseScene
2015-10-05 22:07:40.386 IgeClass.js:101
IGE *log* [Client] : Stream entity created with ID: exent
2015-10-05 22:07:40.409 PlayerTexture.js:6
Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.129 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.145 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.162 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.179 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.198 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.212 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.230 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.245 PlayerTexture.js:6

Uncaught TypeError: Cannot read property 'y2' of undefinedimage.render @ PlayerTexture.js:6IgeEventingClass.extend.render @ IgeTexture.js:666IgeObject.extend._renderEntity @ IgeEntity.js:1853IgeObject.extend.tick @ IgeEntity.js:1684IgeEventingClass.extend.tick @ IgeObject.js:1596IgeObject.extend.tick @ IgeEntity.js:1702IgeEntity.extend.tick @ IgeScene2d.js:136IgeEntity.extend.tick @ IgeViewport.js:204IgeEntity.extend.renderSceneGraph @ IgeEngine.js:1876IgeEntity.extend.engineStep @ IgeEngine.js:1755
2015-10-05 22:11:32.262 PlayerTexture.js:6


which continues infinitely(chrome console)

and firefox console gives me:
Code: Select all
TypeError: entity._geometry is undefined

also infinitely repeated.

I also havent been able to get the sceneGraph up from the previous section if that means anything. If I didnt know better I'd say it had something to do with canvas..

its breaking on line 6 of PlayerTexture.js:

Code: Select all
ctx.moveTo(0, -entity._geometry.y2);


when I replace the "entity._geometry" with numbers the engine renders the image.. still no sceneGraph tho :?


Which tutorial did you follow? I cannot find any with incorrect details. Was it a video tutorial?
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm


Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest
cron