Jump to content

Potential issue with creating primitives?


Recommended Posts

Hi there,


Maybe I'm doing this wrong but I ran into an issue creating primitives, although I came up with a hacky work around (below). This code below will crash with "Uncaught TypeError: Cannot call method 'update' of undefined". I used the phaser.js file from the 1.0.5 build.

	var line;	var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });	function preload(){	}		function create(){			//Uncomment this for rough work around fix		//game.add.graphics = function (x, y) {				//	var graphics = new Phaser.Graphics(this.game, x, y);		//	Phaser.Sprite.call(graphics,this.game,x,y);		//	this.world.group.add(graphics);		//	return graphics;		//};			line = game.add.graphics(0,0);			}		function update(){			line.clear();		line.lineStyle(10,3685702,1);		line.moveTo(100,100);		line.lineTo(200,200);			}



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...