MESA VIRTUAL COMPUTER SCIENCE COMPETITION YEAR 2 CYBER RULES 2016

Level: Required for competitors who participated in the 2015 Competition (Open to any competitors) Type of Contest: Team Composition of Team: 2 – 4 students per team Number of Teams: 10 entries per Center

The year 2 MESA Virtual Computer Science Competition is designed to extend and advance the knowledge of the Greenfoot programming environment and the programming language. The year 2 virtual competition will require students to incorporate some advance concepts of Greenfoot programming. Students participating in the year 2 competition will create a project at their home school sites and, subsequently, submit it to the MESA California State Office for judging. The MESA State Office may determine at its discretion that the competition is to be a timed, proctored competition at the school sites.

OVERVIEW Develop an educational and creative interactive game using Greenfoot in accordance to the specifications set forth in this document. Entries will be submitted to a statewide URL for judging by 5:00 p.m. TBD for judging.

All entries must be designed and created by California MESA students. The following software packages and their sources are as follows:

Software Package Source Greenfoot 2.3 or above (2.4.2 www.greenfoot.org/download now available) Java JDK 8 SE Compiler http://www.oracle.com/technetwork/java/javase/downloads/jdk8- downloads-2133151.html

Also, it is highly recommended that each school obtain at least one copy of the official Greenfoot instructional book:

- Koelling, Michael. Introduction to Programming with Greenfoot, Prentice Hall. Upper Saddle River, 2010.

The first edition is suitable and can be obtained used from Amazon. The second edition is now available but is expensive.

Judges reserve the right to contact contestants prior/during judging for verification of student work. Student work should be verified by the teacher/mentor prior to submission, this might help to eliminate copying and missing content.

Game Details 1. Skill Levels: Each game must have three levels which increase in difficulty. Difficulty is defined as an increase in skill level. 2. Time Limit: A level should take a minimum of 1 minute to play. 3. Start and Return to Menu: All levels must have the following buttons that will function while the level is executing: a. Restart b. Return to main menu 4. Timer: The game must include a timer. 5. Scoreboard: The game must include a scoreboard. 6. Sound: The game must include sound effects. 7. Color: Use of the color library for at least one class. 8. Anatomical Animation: The game must include animations. Animation characters can be obtained from the Greenfoot images library or imported from other sources. They must have anatomical functions. 9. Data Input: The game must prompt the user to input data in the form of text or numbers at least once per level. 10. Instructions: The game must contain clear and informative in-game instructions relevant to the targeted age and skill level. 11. Starting Configuration: Game pieces should be initially configured automatically. 12. Disappearing: Some objects should be programmed to disappear either randomly or based on a game event. 13. Appearing: Some objects should be programmed to appear either randomly or based on a game event. 14. Wrapping: Some object should wrap the world. This means that if they exit one side of the world moving in a particular direction, they should return to the world moving in the same direction. 15. Rebounding: Some object(s) should rebound off of a side of the world or a fixture within the world using proper geometric principles (Example: If an moving object contacts a fixed object at a 30° angle, it should rebound at a 30° angle). 16. Constructors: The game should employ the use of one or more constructors. 17. Random Motion: One or more objects should contain random motion. 18. Actor 1-Intermediate Actor-Actor 2 Contact: An event driven object should be generated by one actor and delivered to a second actor causing some resultant action. The following are examples: a. Upon key entry, a tank produces an artillery shell that intersects with building and causes it to disappear or explode (incrementing the score). b. Upon key entry, a rescue plane produces a care package and drops it to a hurricane victim resulting in some game response (incrementing the score). 19. While or For Loop: The game should include either a while loop or a for loop. 20. If-then Decision: The game should include an if-then loop or and if-then-else loop.

Games can be built from one of the Greenfoot templates available on the MESA website. (Only these templates may be used.)

Documentation: Students should produce concise in-code comments explaining the function of each line, or related series of lines, of code. Documentation should serve two purposes: a. The comments should be sufficient for a reader with a understanding of Greenfoot to the function of the code. b. The comments should also serve to identify for the the judges that a specific game element (see “Rules”) has been utilized.

JUDGING 1. Game Components 2. Technology Fluency 3. In-code Comments 4. Creative Design 5. Questions

It benefits contestants to make it as easy as possible for judges to follow your code and comments.

AWARDS Medals will be awarded for first, second, and third place teams overall and by region. Center Directors will be notified on TBD of local and regional winners.

2016 MESA Interactive Game Design Competition with Greenfoot Rubric Points Possible Advanced Developing Emerging Game 25 One point will be One point will be One point will be Components awarded for each of awarded for each of awarded for each of twenty (20) game twenty (20) game twenty (20) game elements included in the elements included in the elements included in the game (see “Rules”). An game (see “Rules”). game (see “Rules”). additional five (5) points Fifteen or fewer of the Ten or fewer of the can be awarded for the game elements and two game elements, one three levels of increasing levels of increasing level of difficulty. difficulty, animation, and difficulty. sound effects. Technology 25 The game works as The game works The game does not flow Fluency designed with no errors completely from well or stops due to programming or beginning to end but prematurely. design. Game is may have minor flaws in Good programming particularly well the way it flows structure is seldom used. organized, logical, and Good programming Methods are written in debugged. Good structure is sometimes the act method. Code programming structure is used. Methods should layout is difficult to used. Methods are not be written in the act follow. written below the act method. Rather methods method and then called are called to the act when needed. method when needed. In-code 25 Comments explain the Comments mostly Comments explain Comments function of individual explain (greater than or fewer than 50 percent of lines of code or a related equal to 50 percent) the the lines or related lines series of lines of code. individual lines or a of code. Identification The explanations should related series of lines. of game elements is be understandable to a Comments do not inconsistent. beginning Greenfoot user. completely identify the Comments also game elements used. completely identify the completion of any of the 20 game elements for judges’ reference. Minimum 90 percent complete. Creative 15 Game concept is highly Game concept shows Game is a basic shooter Design creative. More than a some creativity. This or chase game. A basic shooter or chase game. would include shooter or Pacman-type game Elements of complex chase games with would be an example. game responses to events embellishments. A within the game or user classic Pacman game driven events are in would be an example. evidence. Answers to 10 One point for each correct One point for each One point for each Questions answer. correct answer. correct answer.

Year 2: Answers to Questions about Java

1. What is a Java Virtual Machine (JVM)? A JVM is a piece of software unique to Java that converts the Java program into code that can be understood by the particular computer on which it is running. It is the JVM that allows a Java program to run on any kind of computer.

2. What is a Java class? A Java class is a template that defines the features of one or more objects. A Java class can be thought of as a category used to define a group of things. Classes implement methods. Java classes can: 1) define and implement methods; Declare constants and variables; inherit methods from another class; and override inherited methods.

3. What is an object? How are objects and classes related? Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). A class is a blueprint from which individual objects are created.

4. Can different instances of an object of the same class have different characteristics? Explain. Yes. While all objects in the Dog class have color, two different instances of Dog can have different colors.

5. What is a Constructor? A constructor in Java is a block of code similar to a method that is called when an instance of an object is created. Here are the key differences between a constructor and a method:  A constructor doesn’t have a return type.  The name of the constructor must be the same as the name of the class.  Unlike methods, constructors are not considered members of a class.  A constructor is called automatically when a new instance of an object is created.  A constructor allows you to create initial values for class fields when you create an object.

6. What is a “call” and how are calls used in the act method in Greenfoot? When a method is written below the act method, it must be given a name, referred to as the signature line. The method can then be activated by the program by placing the signature line inside of the act method for execution. This is referred to as calling the method. The use of calls leaves the act method uncluttered by detailed code.

7. Name the seven Greenfoot classes and what function they perform. a. Actor: An Actor is an object that exists in the Greenfoot world. b. Greenfoot: This utility class provides methods to control the simulation and interact with the system. . GreenfootImage: An image to be shown on screen. d. GreenfootSound: Represents audio that can be played in Greenfoot. e. MouseInfo: This class contains information about the current status of the mouse. f. UserInfo: The UserInfo class can be used to store data permanently on a server, and to share this data between different users, when the scenario runs on the Greenfoot web site. g. World: World is the world in which the Actors live.

8. What does Java API stand for and where can Java API be accessed from Greenfoot? API stands for Applications Programming Interface. API are utilities that can perform specialized functions. These include a wide variety ranging from using color, to 3-D geometry to cryptography. Java has several thousand API that can save a a great deal of time in offering useful, pre-written functionality.

9. Name three advantages of Java. a. Java is transportable. The same Java program can be run on a variety of processors and operating systems as long as a JVM is available. b. Java has significant advantages over other languages and environments that make it suitable for just about any programming task. c. Java is easy to learn. d. Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn than other programming languages. e. Java is object-oriented. f. This allows you to create modular programs and reusable code. g. Java is platform-independent.

10. Who developed Java and for what company? What company now owns Java? James Gosling and his team developed Java while working at Sun Microsystems. The language was released in 1994. Sun was purchased by , which now owns the language.

Year 1: Answers to Questions about Java Provide complete sentence answers to the following questions. You may use the internet or any other reliable source for references. The following book presents an excellent overview of computer science: Wang, Wallace. Beginning Programming for Dummies, All-in-One Desk Reference. John Wiley & Sons. 2008. Tips on internet searches: When doing an internet search stick to websites sponsored by universities, corporations, or other established organization. Avoid gathering information from Wikis or question/answer forums as the quality of information on such sites is often incomplete or incorrect. 1. What is computer hardware? Hardware is the physical structure of the computer and includes the mother board (where the central processor unit (CPU) resides, hard drive, and power supply.

2. What is computer software? Computer software is the instruction set to perform a task, written by software developers (also called ), that allows the computer to perform useful functions. Software includes an that coordinates the activities of the hardware and software. It also includes applications programs such as the software that controls a satellite, a word processor, and a .

3. What is Java and what company owns the Java language? Java is a high-level programming language developed by James Gosling at Sun Microsystems in the early 1990’s. Java is now owned by Oracle Corporation.

4. What is the major advantage of Java over other programming languages? The major advantage of Java is that it is transportable. This means that a Java program written on a Mac will run on a windows computer without changing the program. Transportability is important since the advent of the internet where different computers, CPU’s, and operating systems must communicate with one another.

5. What is a compiler? Java is called a high level language because it uses ordinary words and keyboard symbols. Computer hardware operates in high voltages (represented by the number “1”) and low voltages (represented by the number “0”). A compiler converts a high level language in to a series of 1’s and 0’s for the computer to process.

6. What is the latest compiler now used for Java? The latest Java compiler as of the summer of 2014 is called JDK 8.

7. What is a Java Virtual Machine (JVM)? A JVM is a piece of software unique to Java that converts the Java program into code that can be understood by the particular computer on which it is running. It is the JVM that allow a Java program to run on any kind of computer. 8. What is an integrated development environment (IDE)? An IDE is an editor used by programmers to develop software. It provides useful tools for programmers just as a program such as Microsoft Word provides tools for writing papers. Among the tools of an IDE is a debugger, which flags errors and returns messages to the programmer to assist them in correcting them.

9. Name two popular IDE’s for Java? The two most popular IDE’s for Java are and Netbeans.

10. What is the relationship between Alice, Greenfoot, and Java? Alice and Greenfoot are educational programs to teach Java and object oriented programming. Alice is the simplest of these and uses a drop-and-drag format to create animations. Greenfoot also provides a drop-and-drag format. In addition, Greenfoot allows the user to edit the underlying Java code and is, therefore, an intermediate step in learning Java.

11. What is object oriented programming? Object Oriented Programming (OOP) is a programming structure technique introduced by the C++ programing language in 1985. OOP breaks programs into natural objects that have associated subprograms. A subprogram is a small program within the overall program that performs specific tasks. Java calls subprograms “Methods.” For example, a teacher can be an object whose class includes subroutines to prepare lessons, teach lessons, and grade tests.

12. What are two advantages of object oriented programming? a. OOP’s break a program into natural objects such as people, cars, and buildings and then create within these objects characteristics that are associated only with that object (e.g. people walk but cars don’t walk). b. Objects are encapsulated so their data is insulated from other parts of the program. This prevents data from being improperly changed and damaging the program. c. Objects allow inheritance. Inheritance means that an object can use a method (subroutine) held by another object without making a new copy of the method. d. OOP’s permit polymorphism. This means that an object can inherit a method from another object. This means that an object can inherit am method from another object and then modify it for its own private use.

13. What is a class and how is it different from an object? An object is a part of a program that has its own distinct characteristics which are defined in its unique class file. The class file holds the methods that are used by the object.