Jump to content

Prototype (Lost)


Recommended Posts

Here's my code:

var c=document.getElementById("myCanvas");var ctx=c.getContext("2d");  var Shape = function(){} Shape.prototype.Circle = function(){	// Some code here}; Shape.prototype.Square = function(){	// Some code here};  MainMenu.prototype = new Shape(); var MainMenu = function(ctx){   this.draw{	this.Circle();	this.Square();   }}

What I want to do is to call the Circle() and Square() function inside my draw() function.But it doesn't work.Is this even possible??I'm going crazy trying to figure this out!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...