Hardware Reference
In-Depth Information
If the a variable holds a value greater than 3, Python will print “big” on the
Python Shell, else (meaning, if it is not greater than 3) it will print “small” on the
Python Shell. Or put another way, if a>3 is True, it prints big, else if a>3 is False,
it prints small.
An if statement doesn't have to have an else (it is optional), but sometimes in
your programs you want to handle the part that is true in a different way than
the part that is false.
The other thing you used here was a comment. You will find comments a useful
way of leaving little reminders in your program for yourself or anyone else who
reads it.
A comment starts with a hash symbol, like this:
# this is a comment
You can put a comment anywhere on a line. Wherever you put a hash symbol,
everything to the end of that line will be ignored by the Python language.
Further Adventures in
Tracking Your Player
In this adventure, you have learned and put into practice the basics of a game loop,
using sensing and geo-fencing, to create a fun game. When you make games, it's a great
idea to get your friends and family to play them and tell you what they like or don't like
about them. It's a good way of getting feedback to help you improve the game.
The Welcome Home Game has a problem: if your player stands on the doormat,
it repeatedly says “welcome home” and fills up the chat. Can you think of a way
to modify this program so that it only says “welcome home” once when you
come into your house?
A good way to come up with ideas for exciting games is to play other games and
see how they keep the player gripped. Play lots of other computer games and
make a list of as many different things as possible that a game could do, in terms
of the player's position changing.
Search on the Internet for geo-fencing and see if you can find some of the ways
it is used to good effect in industry. If any of these ideas grab your interest, have
a go at writing a Minecraft program that uses some aspect of them by writing
your own simple game based on what you have learned in this adventure.
 
Search WWH ::




Custom Search