1 of 56

Access StarLogo Nova at www.slnova.org

Copyright © 2023 MIT Scheller Teacher Education Program

2 of 56

3 of 56

4 of 56

5 of 56

6 of 56

7 of 56

8 of 56

9 of 56

10 of 56

11 of 56

12 of 56

with

13 of 56

14 of 56

15 of 56

16 of 56

17 of 56

18 of 56

19 of 56

20 of 56

21 of 56

22 of 56

23 of 56

24 of 56

25 of 56

26 of 56

27 of 56

28 of 56

29 of 56

30 of 56

31 of 56

32 of 56

33 of 56

34 of 56

35 of 56

36 of 56

37 of 56

38 of 56

39 of 56

40 of 56

41 of 56

42 of 56

43 of 56

44 of 56

45 of 56

46 of 56

47 of 56

CLOCK

Keep track of time to impose limits on your player, change aspects of the game over time, and more!

48 of 56

The clock advances by 1 tick every StarLogo loop.

Combining this with the “Remainder” block can cyclic behaviors.

You can create a world trait to simulate a daily cycle. Now you can base the behavior of any agent on what time it is!

Recall that the remainder of 0/5 is 0, remainder of 1/5 is 1, remainder of 2/5 is 2 and so

on. However, the remainder of 5/5 is 0, remainder of 6/5 is 1, and so on.

In the code to the right, the agent will move forward by 1 unit and turn left by 15 degrees only when the clock/5 has a remainder of 0.

49 of 56

LOGIC

Logic blocks can be both very confusing and very helpful in StarLogo Nova and coding in general.

50 of 56

The if block takes a

condition and runs the code inside only if that condition is true. The if/else block has code that runs when the condition is not true.

The while block is similar, but the code inside keeps running in a loop as long as the condition is still true.

All of these blocks can be used to create conditions. You can even combine these three to add more!

Special symbols:

!= not equal

>= greater than or equal to

<= less than or equal to

Conditions don’t have to use numbers! You can check for colors, shapes, terrain, custom traits, etc!

51 of 56

COORDINATES

Anytime you want to move/draw in StarLogo Nova, keep Spaceland’s coordinate system in mind.

52 of 56

Spaceland has 3 axes.

The X axis is horizontal from -50 to 50, and the Y axis is vertical from -50 to 50. The Z axis starts at 0 on Spaceland and comes out of the screen, or is “up” when an agent takes the camera.

50

50

-50

-50

Y

X

Z

Y

X

53 of 56

END OF GAME

Set your game to run for a certain amount of time, until a certain score is met, or if the player dies.

54 of 56

Use a toggle button to start

your game. (See CUSTOM BUTTONS for more).

When the Player collides with a Hazard agent, the collision toggles the PLAY GAME widget off for everyone, which stops the game.

You could also stop the game if the clock reaches a certain value (see CLOCK), if you get a certain score, or if some other condition is met.

You can add game over messages (see TEXT MESSAGE) or extra lives.

55 of 56

56 of 56