More Information

1.2.2: How to be Successful in the Course

It requires dedication to your game (course), and to becoming a master gamer (successful student)

As the gamer, you take responsibility for your own learning process

As the Game Master, I present ideas, examples and help when requested

As the gamer, you will need to practice to truly master your game

Avoid claiming everything is overpowered, broken or too hard

Instead, learn how to overcome problems and become a winner

Realize that by study and practice you can grow your brain and improve

Improving Your Game

Go to class and participate.

Turn off your cell phones and pay attention to the lecture and participate in the activities. Do not become distracted or try to multitask. Ask questions in class. Establish good rapport with your classmates and the instructor. Get to know other students in the class during activities and breaks. Eighty percent of success is showing up.

Keep up with the course.

Complete all your homework on time. Expect assignments to take time to complete, so start playing with them long before they are due. Every class has a slippery slope, where falling behind causes you to fall even further behind. Falling behind makes the course material seem overwhelming.

Practice

Realize that just because this is a game programming class does not mean that it does not take practice to master the material. Nothing is more effective than practice. You've gotta do the work. Schedule a study session within a day of a lecture to review your notes, study the material and read the textbook.

Start at the lowest level and build.

Beat the prepared lab scenario first. Practice until it becomes too easy and then move to the next level. After finishing the basics you are ready to develop more creative code and game techniques.

Adapt your skills.

Do not get frustrated if you do poorly at first. Figure out what you are doing wrong and fix it! Everyone gets stuck at times. If you find you are stuck, take a break and come back to it later, talk to the professor, or ask a classmate for help. With tenacity and effort you can improve your game and succeed!

Prepare for boss events.

Always prepare for the major challenges. Keep on top of the material and have a game plan. Prepare practice problems and test yourself.

Keep your interest.

If you become bored then talk to the instructor for more challenging assignments. If you want to know how to accomplish a particular task in a game, look it up or ask the professor. Look forward to challenges!

Know your programming code.

If you do not know the code forms you will get frustrated. There are many practice exercises to develop your coding skills. Keep up and keep learning!

Read the code of skilled game programmers.

Greenfoot site has many games with source available. Look at how the programmers create each special effects. It may have taken years for them to figure out a particular technique, but you can get it quickly by reading their code. Try to adapt the code to your own game. Remember to give attribution to honor the original developer.

In this exercise we explore the course web site to see how many of our questions we can answer. We will break into teams of 3-4 people to find answers to the questions. The first team to find all the answers and to notify the instructor wins!

Installing the Software

You will receive a file named: book-scenarios.zip. This is a compressed file that you must extract. On Windows, right-click and select Extract All from the menu. On Mac and Linux systems, you can double-click the file to extract it. Remember where you extracted the files so you can use them.

Specifications

Start Greenfoot and open the leaves-and-wombats scenario for chapter 1 of the book, which is available here if it does open automatically when starting Greenfoot.

In addition, open a text editor, create a file named wombat.txt and record answers to all the questions highlighted during this exercise.

Add some wombats and leaves to the world by right-clicking the class and selecting new...

Invoke the move() method on a wombat and observe what it does.

Try the move() method several times until you understand how the method causes the wombat to act.

Q1: What happens when calling the move() method if a wombat is in the middle of the world?

Q2: When the Run button is pressed, what happens when a wombat reaches the edge of the world?

Q3: Do wombats eat leaves when they move over them?

Invoke the turnLeft() method several times until you understand what it does.

Q4: What does the turnLeft() method do?

Place two wombats in your world and make them face each other.

Examine the methods available on the object menu for a wombat and find the methods that cause it to eat leaves.

Q5: What is the name of the method that causes a wombat to eat leaves?

Notice the method names have a word in front of them like: void, boolean and int. These words are the return type of the method. For more information see section: 1.3.6: Methods and Return Types.

Invoke the canMove() method on a wombat, which should show a dialog box like the following:

Notice the word boolean highlighted above. A boolean return type means the method can return either true or false.

Try invoking the canMove() method on a wombat placed a various locations in the world.

Q6: Under what conditions does the canMove() method return false?

Invoke the setDirection() method, type in a number and press the OK button.

Notice the words inside the parenthesis. These words make up a parameter for the setDirection() method. A parameter is extra data we provide for this method to run. For more information see section: 1.3.7: Parameters.

Q7: What happens if you enter a non-integer number, like 2.5?

Q8: Does anything happen if you enter a number larger than 3 or smaller that 0? If so, what happens?

Right click on Wombat in the class display and select the Open editor menu item.