By building the Get The Gold App you will get practice with setting visibility, using Clock components and Timers, and detecting collisions in App Inventor. You'll program an application that has a pirate ship whose goal is to collect all the gold on the screen.
Connect to the App Inventor web site and start a new project. Name it GetTheGold, and also set the screen's Title to "GetTheGold". Switch to the Blocks view and connect to a device or emulator.
You may notice that PirateSprite.Flung takes in 6 attributes: x, y, xvel, yvel, speed, and heading. We want to reassign PirateSprite's current heading to the heading given to us from PirateSprite.Flung. This means that the user can now control the direction of the pirate ship with their fingers by flinging on the screen.
When the Clock1.Timer goes off, we want all of our gold coin ImageSprites to move to a new random location on the Canvas. We will do this by using the Sprite.MoveTo block. MoveTo takes in two arguments: the x and y coordinates on the canvas of the new position we want the sprite to move to. We want the Sprite to move to a new random location so we will use the random integer block found in the Math box. Since we want each Gold ImageSprite to move to a new location, we repeat this process for each sprite's MoveTo function.
For ImageSprite2, we want x to be a random integer from 0 to Canvas1.Width-ImageSprite2.Width and y to be a random integer from 0 to Canvas1.Height-ImageSprite2.Height. This is to be repeated for all the Gold Image Sprites.
Remember that sprites are measured at the upper left corner as (0,0) so if we don't want them to go off the screen, we need to take the sprite's height/width into account when setting the range for our random numbers.
App Inventor detects collisions by checking for an intersection between the bounding rectangles of each ImageSprite. We call this rectangle-based collision detection. As you can see in the image below, sprites with circular or polygon shape will appear to collide because of the rectangular bounds around them when they might not actually be colliding.
We can use the PirateSprite.CollidedWith event handler to detect whenever the pirate ship collides with another sprite or gold coin. You may notice that PirateSprite.CollidedWith takes in an argument. This argument is the object that PirateSprite just collided with. We will be testing inside the handler for which object so the name of this argument is not significant. You can name it other.
Whenever the pirate collides with a gold coin, we want the coin to disappear. We can do this by setting the coin's visibility to false. To find which coin the pirate collided with, we will use the PirateSprite.CollidingWith.
We can use PirateSprite.CollidingWith to take in a component (each of the gold coin sprites) to detect which sprite was hit. This is a component block and NOT a text block with the words ImageSprite inside. The component block can be found in the drawer for each component. If a sprite was hit, we will set its visibility to false.
Package the final version of the app by choosing Package For Phone Barcode from the Component Designer menu. When the barcode appears, use the barcode scanner on your phone to download and install the app.
Scan the following barcode onto your phone to install and run the sample app.Download Source CodeIf you'd like to work with this sample in App Inventor, download the source code to your computer, then open App Inventor, click Projects, choose Import project (.aia) from my computer..., and select the source code you just downloaded.
So I have been working with this game and there is a pirate ship that I want to shoot a canon ball from, but the pirate ship is always moving. How do I get the ball to shoot in the direction the pirate ship is pointing and only appear when it is shot?
Did you try to using the MoveTo as recommended? You do not have to set the heading of the image sprite equal to the pirate ship. I expect it will. I don't think you have to 'point' in the same direction.
I've always had a soft spot in my heart for Captain Nemo of the Nautilus, genius inventor of the submarine that is the central locale for Jules Verne's 20,000 Leagues Under the Sea. If you've never read the story, there's really no excuse to wait as the novel can be obtained free-of-charge for Kindle, Nook, and a variety of eReaders. It's a relatively short story, too, compared to some of the 500+ page stories that we're used to reading today.
The original Cap'n Crunch cereal was developed to recall a recipe of brown sugar and butter over rice. It was one of the first cereals to use an oil coating to deliver its flavoring, which required an innovative baking process.[2]
Grandma would like to make this concoction with rice and the sauce that she had; it was a combination of brown sugar and butter. It tasted good, obviously. They'd put it over the rice and eat it as a kind of a treat on Sundays ...
Low created the flavor coating for Cap'n Crunch, describing it as giving the cereal a quality she called "want-more-ishness".[7] After her death in 2007, The Boston Globe called Low "the mother of Cap'n Crunch".[5] At Arthur D. Little, Low had also worked on the flavors for Heath,[7] Mounds and Almond Joy candy bars.[8]
The character was created by Allan Burns, who became known for co-creating The Munsters and The Mary Tyler Moore Show.[9] The commercials themselves were originally produced by Jay Ward Productions. Quaker Oats had a marketing plan for Cap'n Crunch, before it had developed the cereal.[7] The product line is heralded by a cartoon mascot named Cap'n Crunch.[10] Cap'n Crunch is depicted as a late 18th-century naval captain, an elderly gentleman with white eyebrows and a white moustache, who wears a Revolutionary-style naval uniform: a bicorne hat emblazoned with a "C" and a gold-epauletted blue coat with gold bars on the sleeves. While typically an American naval captain wears four bars on his sleeves, the mascot has been variously depicted over the years wearing only one bar (ensign), two bars (lieutenant), or three bars (commander). As of May 26, 2024, he is now depicted on cereal boxes with the four bars of a naval captain, so after 61 years he has finally been promoted to captain.
Animated television commercials featured the adventures of Cap'n Crunch commanding the "good ship" Guppy on its sea voyages accompanied by his canine first mate Seadog and loyal crew of sailor children named Alfie, Dave, Brunhilde, and Carlyle.Jean LaFoote, "The Barefoot Pirate", often attacked the Guppy in order to steal its cargo of Cap'n Crunch cereal.
In 2013, sources including The Wall Street Journal[10] and Washington Times[12] noted that the three stripes on the mascot's uniform indicate a rank of Commander rather than the four that denote the rank of Captain. In jest, The Wall Street Journal reported that the U.S. Navy had no record of Crunch and that the Naval Criminal Investigative Service (NCIS) was investigating him for impersonating a naval officer.[10]
Daws Butler provided the original voice of the Cap'n until his death in 1988.[13][14][15][16] From 1991 to 2007, George J. Adams voiced him,[17] followed by John Gegenhuber in The Cap'n Crunch Show in 2013,[18] and Mike Stoudt from 2021 to 2023.[19][20] Author Philip Wylie wrote a series of short stories, Crunch and Des, beginning in the 1940s, which featured a similarly named character, Captain Crunch Adams.[21] Vinton Studios produced a claymation ad during the 1980s.[22]
In the 1960s Cap'n Crunch cereal boxes came with whistles which coincidentally had the specific frequency (2600 hertz) required to exploit a vulnerability of in-band signaling enabling a phone to make free calls by entering an 'operator mode'. This was discovered by John Draper.
Jean LaFoote is a fictional pirate character from the Cap'n Crunch breakfast cereal's character set. The character's name is wordplay on that of the historical pirate, Jean Lafitte.[23] In the mid-1970s, he was the primary mascot for Jean LaFoote's Cinnamon Crunch cereal.[23] LaFoote was originally voiced by Bill Scott, followed by Adam Shapiro from 2006 to 2007,[24] and Joe Nipote in The Cap'n Crunch Show in 2013.[25]
In the 1980s, the Captain's main adversaries were the Soggies, strange alien creatures resembling blobs of milk, whose goal was to make everything on Earth soggy. The only thing that was immune was Cap'n Crunch cereal, and many ads revolved around their attempts to "soggify" the cereal and everything else, to no avail. Their leader, Squish the Sogmaster (voiced by Dick Gautier), was a large mechanical creature (with a pair of eyes peeking out from an opening in the head, implying it was a suit of armor for a smaller figure) who was mostly seen ordering the Soggies to carry out his plans to "ruin breakfast"; several commercials that tied in with contests had story arcs involving the Sogmaster attempting to capture Cap'n Crunch.
(Fortune Small Business) -- Woody Norris has little passion for business. When it comes to technology, the 71-year-old founder of American Technology Corp. (ATC), a San Diego acoustic engineering firm, talks with the air of an enthusiastic teenager, telling you how "psyched" he is about his latest "cool" prototype. But ask Norris questions about corporate finance, and he'll shrug.
He's not kidding. ATC has struggled since Norris started it in 1980, and it's never turned a profit. But the company's fortunes have finally changed, thanks to one of Norris's cool products - the LRAD, or Long Range Acoustic Device. The gadget looks like an enormous satellite dish and produces a bone-rattling noise. It's not a loudspeaker for rock concerts but a nonlethal weapon that has kept Somali pirates and Iraqi jihadists at bay.
The LRAD is the latest invention to spring from Norris's restless brain. The son of a coal miner, Norris spent much of his childhood tinkering with old radios in the family's chicken coop in Barrelville, Md. In the 1960s he developed the audio technology behind the sonogram. More than 300 patents later he'd earned enough in royalties to buy a 20,000-square-foot mansion on 44 acres outside San Diego.