1 of 8

  • var width = 10;
  • var height = 20 + width;

width gets 10

height gets 20 + 10

height gets 30

width

10

height

30

1

Variable

Ending State

width

height

Labels

Values

Workspace

Program

Ending State

2 of 8

  • var size = 30;
  • size = 60;
  • size = size + 5;

size

2

Variable

Ending State

size

Labels

Values

Workspace

Program

Ending State

3 of 8

  • var age = 11;
  • var height = 60;
  • age = age + 1;
  • height = height + 5;

age

height

3

Variable

Ending State

age

height

Labels

Values

Workspace

Program

Ending State

4 of 8

  • var xPosition = 100;
  • var yPosition = xPosition;
  • xPosition = yPosition + 30;
  • yPosition = yPosition + 50;

xPosition

yPosition

4

Variable

Ending State

xPosition

yPosition

Labels

Values

Workspace

Program

Ending State

5 of 8

  • var smiley = createSprite(100,200);
  • smiley.setAnimation("smileyFace");
  • drawSprites();
  • smiley.x = smiley.x + 50;
  • drawSprites();

smiley.x gets 100

smiley.x gets 100 + 50

smiley.x gets 150

smiley

sprite

x

y

150

200

5

Labels

Values

Workspace

Program

0

50

100

150

200

250

300

350

400

50

100

150

200

250

300

350

400

use Ctrl + D to duplicate the smiley then move the duplicate to the final location

6 of 8

  • var smiley = createSprite();
  • smiley.setAnimation("smileyFace");
  • smiley.x = 50;
  • smiley.y = 100
  • drawSprites();
  • smiley.x = smiley.x + 50;
  • drawSprites();
  • smiley.x = smiley.x + 50;
  • drawSprites();
  • smiley.x = smiley.x + 50;
  • drawSprites();

smiley

sprite

x

y

6

Labels

Values

Workspace

Program

0

50

100

150

200

250

300

350

400

50

100

150

200

250

300

350

400

use Ctrl + D to duplicate the smiley then move the duplicate to the final location

7 of 8

  • var smiley = createSprite();
  • smiley.setAnimation("smileyFace");
  • smiley.x = 200;
  • smiley.y = 300
  • drawSprites();
  • smiley.y = smiley.y - 50;
  • drawSprites();
  • smiley.y = smiley.y - 50;
  • drawSprites();
  • smiley.y = smiley.y - 50;
  • drawSprites();

smiley

sprite

x

y

7

Labels

Values

Workspace

Program

0

50

100

150

200

250

300

350

400

50

100

150

200

250

300

350

400

use Ctrl + D to duplicate the smiley then move the duplicate to the final location

8 of 8

  • var smiley = createSprite(50,50);
  • smiley.setAnimation("smileyFace");
  • drawSprites();
  • smiley.y = smiley.y + 50;
  • drawSprites();
  • smiley.x = smiley.x + 150;
  • drawSprites();
  • smiley.y = smiley.y + 50;
  • drawSprites();

smiley

sprite

x

y

8

Labels

Values

Workspace

Program

0

50

100

150

200

250

300

350

400

50

100

150

200

250

300

350

400

use Ctrl + D to duplicate the smiley then move the duplicate to the final location