Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
draw2D.configure({
viewportRectangle : [0, 0, stageWidth, stageHeight],
scaleMode : 'scale'
});
boardSprite = Draw2DSprite.create({
texture : textures['textures/tictactoeboard.png'],
x: boardOffsetX,
y: boardOffsetY,
width : boardSizeX,
height: boardSizeY,
origin: [0, 0]
});
pieceTextures.O = textures['textures/nought.png'];
pieceTextures.X = textures['textures/cross.png'];
var x, y;
var pieceWidth = boardSizeX / 3;
var pieceHeight = boardSizeY / 3;
for (x = 0; x < 3; x += 1)
{
for (y = 0; y < 3; y += 1)
{
var pieceX = boardOffsetX + pieceWidth * x;
var pieceY = boardOffsetY + pieceHeight * y;
pieceSprites.O[x + y * 3] = Draw2DSprite.create({
texture : pieceTextures.O,
x: pieceX,
y: pieceY,
width : pieceWidth,
height: pieceHeight,
var boardOffsetX = this.boardOffsetX;
var boardOffsetY = this.boardOffsetY;
var boardSizeX = this.boardSizeX;
var boardSizeY = this.boardSizeY;
this.boardSprite = Draw2DSprite.create({
texture : textures['textures/tictactoeboard.png'],
x: boardOffsetX,
y: boardOffsetY,
width : boardSizeX,
height: boardSizeY,
origin: [0, 0]
});
pieceTextures.O = textures['textures/nought.png'];
pieceTextures.X = textures['textures/cross.png'];
var pieceWidth = boardSizeX / 3;
var pieceHeight = boardSizeY / 3;
var pieceSprites = this.pieceSprites;
var x, y;
for (x = 0; x < 3; x += 1)
{
for (y = 0; y < 3; y += 1)
{
var pieceX = boardOffsetX + pieceWidth * x;
var pieceY = boardOffsetY + pieceHeight * y;
pieceSprites.O[x + y * 3] = Draw2DSprite.create({
texture : pieceTextures.O,
x: pieceX,
y: pieceY,
width : pieceWidth,