How to mimic a struct in Javascript


function SDL_Rect() {
this.x;
this.y;
this.w;
this.h;
}

var rect2 = new SDL_Rect;

rect2.x = 640 /2;
rect2.y = 480 / 2;
rect.h = 32;
rect.w = 32;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s