28029 Parallax Inc, 28029 Datasheet - Page 208

KIT PARTS SMART SENSORS W/TEXT

28029

Manufacturer Part Number
28029
Description
KIT PARTS SMART SENSORS W/TEXT
Manufacturer
Parallax Inc
Datasheet

Specifications of 28029

Accessory Type
Parts Kit
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
BASIC Stamp® or Javelin Modules
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Other names
28029PAR
Page 196 · Smart Sensors and Applications
ACTIVITY #4: GAME CONTROL
Here are the rules of this Activity's tilt-controlled game example, shown in Figure 12.
Tilt your board to control the asterisk. If you get through the maze and place the asterisk
on any of the "WIN" characters, the "YOU WIN" screen will display. If you bump into
any of the pound signs "#" before you get to the end of the maze, the "YOU LOSE"
screen is displayed. As you navigate the maze, try to move your asterisk game character
through the dollar signs "$" to get more points.
Converting BubbleGraph.bs2 into TiltObstacleGame.bs2
TiltObstacleGame.bs2 is inarguably a hopped-up version of BubbleGraph.bs2. Here is a
list of the main changes and additions:
Change the graph into a maze.
Add two backgrounds for win and lose to the EEPROM data.
Give each background a Symbol name.
Write a game player code block that detects which background character the
game character is in front of and uses that information to enforce the rules of the
game.
MIN and Negative Numbers
A two’s complement "gotcha" to avoid is subtracting 1 from 0 and then setting the MIN value
afterwards. Remember from Chapter 3 that the two’s complement system stores the signed
value -1 as 65535. That’s why the MIN value was set to 1 before subtracting 1. The result is
then a correct minimum of 0. The same technique was used for setting the
even though there really isn’t a problem with y + 1 MAX 10.
MAX
values

Related parts for 28029