setSize()

This method will allow you to set the size of your game.

Parameters

width: number - The width of your game

height: number - The height of your game

Returns

Nothing

Usage

This method should be used when you’re ready to set boundaries on your game.

Examples

Example 1

//File code/client/src/game.js
init() {
	g.setSize(1200, 2000);
}

getSize()
loadImage()

Need Help?

Proofread your code, check with your team and classmates, and if you’re still stuck!

Click Here for Help