Jump to content

Potential issue with creating primitives?


earok
 Share

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

Cheers,

Erik

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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