18 H ilari ous A pps to Build an d Share VOLUME 16.02

How to Bitsbox

With Bitsbox, you can code real apps that work on gadgets like phones and tablets. All you need is a computer with internet and a working brain.

1

Find a computer with a physical keyboard.

Coding in Bitsbox isn’t meant to be done on tablets just yet.

2

Open a web browser and go to bitsbox.com

3

Click Get Started.

We recommend Chrome, Firefox, Safari, or IE 11.

Before you do these steps, install a QR reader app on your gadget. Go here for a couple of suggestions: bitsbox.com/QRapps

1

On a computer, open the Bitsbox app you built.

2

Click the sharing icon

in the corner of the screen.

3 Scan the on-screen QR code with your gadget. this!

When you change the code on your computer, the app on your gadget changes, too!

ATTENTION GROWNUPS! Check out the Bitsbox Grownup Guide at bitsbox.com/grownups 2

Monkey business is behavior that some people think is inappropriate and your friends probably think is hilarious. Build these apps, share them with everyone you know, and see for yourself. Monkey business is truly in the eye of the beholder. That said, we all think Pull My Finger (on the opposite page) is the very definition of funny. Maybe it's because we're all a little immature.

Have fun!

How can I run my apps on a real phone?

s like It look

y e k n o M usine b ss

Made you look!

Aidan, Scott, Anastasia, Jeff, Alexandra, & Christie

PU LL

M Y

nd ?

or

co l

M

'p ur ba pl ck e' gro ) u

K

IC

KICK ME

E

te

ER

y

a

7

4

2

C R

y? sa

Yes, this is a close-up picture of an elephant's backside. That's how we roll.

's ou

m

'b oo

nd

in

st ea

d?

ED

K

A C

1 1 2 3 fil l( 4 'a 5 fun pp ct 6 st i sc o re } so amp n un ( ta en d( 'c p( ') C an 'c ra ) c ra k { yo ck ', u ') x, y) pl a

no ') e ck th ba ld n ) ma !' 3 ou e t m sh 5 ui k 1 se 's ic el l( 'k 6 l t ( fi xt ha te W 1 2

K

a

G

N

FI

?

er st fa

2 1 2 3 f = 4 st am 5 fun ct p( 6 f 'f .m io in } so ov n C un e ta ge ( H an d( R p( r' in y IG ) ' ,0 to H t: ou { ,5 T o fi a t' ,1 00 ll dd ) 00 ) ) (

LE

FF

U

SH

e ov

2

IE

B

) ) 5' 00 ie 0

8

M

O

SC R

N

EE

5 Z m mb , 0 e zo 0 6 0 bi (' , T 2 m 0. mp GH ta RI 0 zo 0 s ( e 50 4 = ve th z mo e ing . z ak g 1 m an 2 u ch yo ry an : T C int H

4

Mini Mini Apps Apps To To Get Get You You Started Started

3

7 1 9 6

Build your own hilarious sound effects machine! Replace the blank spaces on line 5 with numbers to place the goat where he belongs. Can you add code that adds more sounds to your app?

? g n i h t e m o s r x a e h u o y y a il l ev

bo

f ro ox

d i D

h

b

500

g

go

at

lg bal

am

e

i yet

fox

lf wo

hor

n

1 fill('button panel') 2 3 stamp('ox',268,200,100).tap = sing 4 stamp('bomb',268,420,120).tap = sing 5 stamp('goat', , ,120).tap = sing 6

4

m

ug

gian

t

s c re a m

toot

HINT While you're coding, move your cursor over the tablet on your screen. The x and y numbers that appear tell you what numbers to type!

200

2 1 9 4

elebrity Dressup

'albert einstein'

barack obama

george w bush

margaret thatcher angela merkel

katy perry

nick jonas

'justin bieber'

bill clinton

aung san suu kyi

justin trudeau

malcolm turnbull

selena gomez

malala

WO U

LD EIN TH INK STE IN TH IS IS FU NN Y?

'taylor swift'

'abraham linc oln'

1 fill('black') 2 3 stamp('albert einstein') 4 stamp('hat16',380,300,550) 5 stamp('eye4',380,550) 6 stamp('lips2',450,750,150)

Can you change the code to make different funny faces?

hat7

hat6

hat5

hat16

hair13

mustache6

nose7

lips

bow tie2

glasses6

glasses8

eyeball

5

G N O D G N I D H C T I D 7 2 4 0

Watch what happens when his doorbells rings.

Can you make a dog appear after 8 seconds? 6

YOU'D BETTER GET OFF HIS LAWN.

1 fill('front door') 2 3 function ring() { 4 sound('doorbell') 5 } 6 7 function open() { 8 sound('old man') 9 stamp('old man',300,700) 1 0 } 1 1 1 2 delay(ring,1000) 1 3 delay(open,5000)

HOORAY FOR DELAY This app uses Bitsbox's delay() command to control timing. Line 12 tells the function ring() to run after a delay of 1000 milliseconds (1 second). Line 13 tells open() to wait 5 seconds before it runs. Both lines start counting at the moment you open the app.

i c g a SpoonM

2 3 5 1

ly Bend a spoon using on

t he

im

se en m

we o p

mind! f your o r

The silverware is telling him to pick on the rabbit for a change.

1 song('angelo') 2 b = stamp('spiral stair',1800) 3 b.rotate(90,20000) 4 5 stamp('spoon handle',384,690,600) 6 s = stamp('spoon head',384,400,700) 7 8 function bend() { 9 s.rotate(LEFT,60,5000) 1 0 } 1 1 1 2 delay(bend,3000)

Hint

To show off your paranormal abilities, open this app and wait 3 seconds. As the spoon starts bending, touch your forehead and clench your teeth. Astounding!

GETTING DIZZY? Lines 3 and 9 both use the rotate() command. The first time, it spins the background 90 degrees in 20 seconds. The second time, it turns the spoon head 60 degrees to the left over 5 seconds.

7

I can guess which card you picked! Take a break from coding and impress your loved ones with this clever card trick.

1

2

memorize this one

3

their card Start with a shuffled deck of cards. Fan them out and have someone pick a card and memorize it without showing you.

4

Go through the cards until you find your card—the one you memorized. Their card should be to the right of yours.

After they've memorized their card, split the deck in half and have them put it face down on top. You memorize the card that's face up on the other half of the deck!

5

Show them the card and encourage them to be amazed at your powers.

Voila! 8

Put the halves together and shuffle the cards lightly. Shuffle too much and their card might be separated from the one you memorized—that would be bad.

m-a-g-i-c

A foolproof card trick that works every time and boggles the mind!

1

Remove any 9 cards from an ordinary deck, shuffle them, and deal them face down into 3 equal piles.

5

2

3

Have your friend choose any pile. Flip over and remember the bottom card.

6

O

f

Stack the three piles face down into one. Make sure to place the chosen pile on top.

7 H

Place remaining stack of cards on top of the cards you just placed on the table. Pick them up again.

Now spell O-F, again placing one card face down onto the table for each letter. Place remaining cards on top as before.

4

E

A

R

t

s

Then spell the suit of the card (In this case H-E-A-R-T-S) placing a card on the table for each letter. Place remaining cards on top.

V

I

F

E

Spell the number of the chosen card, dealing one card face down onto the table with each letter (In this case F-I-V-E).

8 M

A

G

i

c

Finally, pick up the packet and spell M-A-G-I-C, dealing the "C" card face up. It's the chosen card!

9

in otes s n g in u Pass is serio s s . cla ness busi

TOP SECRET C 7 0 7 7

ENcryption Tool Use this app to turn your private messages into secret code that only people with the Decryption Tool can read!

1 fill('encryption') 2 a = 'abcdefghijklm nopqrstuvwxyz' 3 key = 7 4 length = a.length 5 message = prompt('message?') 6 code = [] 7 8 function encrypt(letter) { 9 i = a.indexOf(letter) + key 10 if (i >= length) { 11 i = i - length 12 } 13 code.push(a[i]) 14 } 15 16 message.split('').forEach(encrypt) 17 text(code.join(''),50,330)

After y mess ou've ty age in Tool, to th w out on rite the le it to y a piece of p our b uddy . They c Tool t an use th eD o deco back d e t h e into i ts ori m gina

THE SECRET IS THE KEY See the variable key on line 3? This app works by substituting each letter in your secret message for another letter. To figure out which letter, it looks up the letter on line 2 and counts to the right by the value of key. If key is 7, all a's become h's, b's become i's, and so on.

10

Can you figure out how to include capital letter and numbers in your messages? Hint: Line 2

you'v age in e typed yo u write to the Enc r rypti the le on tters a piec it s e ur bu of paper a pits nd gi ddy. ve n use th code t e Decrypti h o its or e message n igina l stat e!

t: Line 2 1 fill('decryption') 2 message = prompt('Message?') 3 key = 7 4 a = 'abcdefghijklm nopqrstuvwxyz' 5 reveal = [] 6 7 function decrypt(char) { 8 index = a.indexOf(char) - key 9 if (index < 0) { 10 index = index + a.length 11 } 12 reveal.push(a[index]) 13 } 14 15 message.split('').forEach(decrypt) 16 text(reveal.join(''),50,700)

Share this app with your friends to let them read your secret code!

T CODE MACHINE DEcryption Tool 2 6 0 4

Visit bitsbox.com/howtoshare to learn how to send this app to another person! 11

BINGO

Card

3 1 9 8

Play BINGO with your friends and family! Build this app and share it with everyone who wants to play. It works on any computer, smartphone, or tablet.

s open who e n o a y ve Ever ill ha pp w d a s i c h t O ar BING e y u a l q i p un e to an us c y e th ame! the g

See the bottom of page 11 for instructions on how to share this app with other people.

12

1 fill('bingo') 2 3 function column(i) { 4 high = i * 15 5 low = high - 14 6 x = i * 135 - 55 7 text(random(low,high),x,370,60) 8 text(random(low,high),x,505,60) 9 text(random(low,high),x,640,60) 10 text(random(low,high),x,775,60) 11 text(random(low,high),x,910,60) 12 } 13 column(1) 14 column(2) 15 column(3) 16 column(4) 17 column(5) 18 19 function tap() { 20 stamp('bingo dot',x,y) 21 } 22 23 stamp('bingo dot',384,620)

HINT

Thes ea a BIN pps wor k to GO geth gam e with e th at yo r to mak any num e u ca ber n pla Not o y f peo sure ple! how Ask t o play a gr ? own the u olde r, the p— bett er.

REPEAT REPEAT This app uses Bitsbox's repeat() command to stamp a total of 75 wood block images over the background image. Every time you tap, one of these stamps is randomly hidden to show the ball underneath. Sneaky!

This app picks a BINGO ball every time you tap. Use it with Bingo Card (on the opposite page) for hours of old-fashioned, high-tech fun.

1 fill('bingo board') 2 3 function block(i) { 4 a = stamp('wood block',x,i*65 + 15) 5 } 6 7 x = 95 8 repeat(block,15) 9 x = 240 10 repeat(block,15) 11 x = 390 12 repeat(block,15) 13 x = 530 14 repeat(block,15) 15 x = 675 16 repeat(block,15) 17 18 s = stamp('swoop',2000,0,100) 19 function tap() { 20 all = find('wood block') 21 pick = random(all.length - 1) 22 s.move(all[pick].x,all[pick].y) 23 s.rotate(RIGHT,3000,2000) 24 all[pick].hide() 25 }

Open this a pp o one d n evice to us as a e it tool for p BING l a y ing O! Ta ppin the a g t ells pp to pick next the ball.

BINGO 8 0 9 1

Caller

13

2 8 9 4

Fear of Clowns Hypnotize your siblings with this trippy circus of spinning clowns. Awful. 1 fill('wavy stripes') 2 song('clown around') 3 4 function spin(clown) { 5 clown.rotate(RIGHT,25,200) 6 if (clown.width < 10) { 7 clown.size(700,1500) 8 } 9 if (clown.width > 600) { 1 0 clown.size(0,1500) 1 1 } 1 2 } 1 3 1 4 function loop() { 1 5 if (random(25) == 1) { 1 6 stamp('clown',0).move() 1 7 } 1 8 find('clown').forEach(spin) 1 9 }

Never trust anyone with technicolor hair and giant shoes. 14

BIGGER AND SMALLER Line 18 gathers up all the clowns on the screen and sends them to the spin() function. Line 5 spins them. Lines 6–8 make them grow when they get very small. Lines 9–11 make them shrink when they get very big.

's There er a suck y ever born e. minut

d r a C g rin 5 6 8 3

The

a e p p a s i D

d') ng car i r a e p sap ll('di se 1 fi al ag = f l f 2 { tap() 3 { n o i t c te') n false) = = 5,'whi g 4 fu 6 ) a , ' l 0 t f 0 a ( 2 h 5, if 'bunny ..',17 5 reset( ICK AGAIN. CL 6 text(' rue t 7 flag = 2') g card { 8 n i e r s a l e p } e 'disap 9 reset( 1 0 } 1 1 } 1 2 ?

ends i r f r you e z a with s Am r o b eigh n d n card a c i s s la this c ck! tri

hat

fw ack o G A L eep tr k F you o e t A S flag ' rst tim d fi T e e ll A h a T c time WH reen. ariable cond the sc he se es a v 8, t u tap pp us o line en yo h This a w o anks t d h T ld . u e ls it sho e is fa . s valu is true e lu tap, it a v s it p, you ta

15

2 5 7 1

zig zag zombie Get your zombie to the brains without getting squashed or drowned!

1 ZOMBIE! 1 fill('roads2') 2 hero = stamp('zombie4',376,910) 3 4 function up() { hero.move(UP,100) } 5 function down() { hero.move(DOWN,100) } 6 function left() { hero.move(LEFT,100) } 7 function right() { hero.move(RIGHT,100) } 8 stamp('button up',100,870).tap = up 9 stamp('button down',100,990).tap = down 10 stamp('button left',40,930).tap = left 11 stamp('button right',160,930).tap = right

2 WATER! 12 13 function float() {} 14 function drive() {} 15 function eat() {} 16 17 function loop() { 18 hero.front() 19 find('taxi').forEach(drive) 20 find('truck11').forEach(drive) 21 22 find('ship3').forEach(float) 23 find('brain').forEach(eat) 24 if (hero.y > 50 && hero.y < 400) { 25 if (hero.hits('ship3') == false) { 26 hero.splash() 27 } 28 } 29 }

TIP Click PLAY to run your app between each code section!

16

3 CARS & TRUCKS!

CODING ONWARD

30 31 stamp('taxi',600,500).speed = 20 32 stamp('truck11',400,600).speed = -15 33 stamp('taxi',200,700).speed = 12 34 stamp('truck11',700,800).speed = -5 35 36 function drive(car) { 37 car.move(RIGHT,car.speed) 38 car.wrap() 39 if (car.hits(hero)) { 40 hero.explode() 41 } 42 }

Can you add awesome sound effects that play whenever something bad happens to your zombie?

4 BOATS! 43 44 stamp('ship3',100,100).speed = -12 45 stamp('ship3',300,200).speed = 10 46 stamp('ship3',700,300).speed = -5 47 48 function float(boat) { 49 boat.move(RIGHT,boat.speed) 50 boat.wrap() 51 if (boat.hits(hero)) { 52 hero.move(RIGHT,boat.speed) 53 } 54 }

5 BRAINS! 55 56 stamp('brain',80,30,60) 57 stamp('brain',280,30,60) 58 stamp('brain',480,30,60) 59 stamp('brain',680,30,60) 60 function eat(brain) { 61 if (brain.hits(hero)) { 62 hero.move(376,910) 63 brain.change('smile') 64 } 65 } 66 song('bumblebee') 17

5 9 3 0

Everything you say is the truth. Everything they say is a lie!

18

TH RU

LIE

T

1 fill('lie detect') 2 name = prompt('Name?') 3 text('Testing: ' + name,210,700,'gadget') 4 n = stamp('needle2') 5 6 function touching() { 7 angle = random(-2,5) 8 if (name == 'Your Name') { 9 dir = RIGHT TYPE YOUR OWN FIRST 1 0 } else { NAME IN 1 1 dir = LEFT HERE! 1 2 } 1 3 n.rotate(dir,angle) 1 4 } 1 5 1 6 function untouch() { 1 7 n.rotate(0,1000) 1 8 }

Make sure to type your name on line 8. Can you figure out how this trick works?

Creative Coding Challenges Try coding these apps yourself!

CREATE A NEW APP WITH THIS NUMBER: CREATE A NEW APP WITH THIS NUMBER:

8 5 0 3

DANGER CHICKEN

6 2 9 2

PRESTO!

CHALLENGE Create an app with a chicken that crosses an empty road.

CHALLENGE Stamp a rubber chicken behind a magician's hat on the screen. BONUS 1 When you tap the screen, the chicken moves up and out of the hat. BONUS 2 When you tap the screen, a loud squawking sound effect plays.

BONUS 1 Make the chicken wait for an ambulance to go by before she crosses. BONUS 2 After she crosses, a doorbell rings and she dances. BONUS 3 After she dances, she explodes. HINT Refer to the apps on pages 6 and 7. SOUNDS:

SOUNDS:

'doorbell' SOUNDS: 'car7'

'bird2' 'duck' 'top hat'

'rubber chicken'

'boom' SONG: 'town road'

'chicken4'

'ambulance'

'forces'

DANGER CHICKEN: 3497 PRESTO!: 2124

Need a helping hand?

Create new apps with these numbers to get some ideas!

'brick wall'

'chicken'

'cow'

19

More stuff online! Look for more when you're coding at bitsbox.com!

Use these stamps ( and sounds and fills and songs) to make any app your own! Just don't forget to put single quotes around them in your code, like this: banana peel

brain2

building3

camper2

car12

coffee2

card 3h

card ks

detector

monkey3

rabbit hat

rubber chicken

star4

trolley

truck13

type z

whoopee

zombie7

stamp('cat3') sound('laugh') fill('disco') song('merrygo')

Songs america

auld lang syne battle hymn caisson great parade mountain patrol spirited

FILLS

washington western

Sounds

button panel2

chicago

green felt

metal square

color gauge elephant tail

fancy door gramophone

atom

contraption crowd elephant lazer meow

polaroids

red stripes

showbiz

ninja parrot2 robot2 water

©2  016 Bitsbox. All rights reserved. Designed and printed in the U.S.A.

bitsbox.com

spiral2

Bitsbox 16-02.pdf

bomb. frog. ballgame yeti. fox. goat. wolf. horn. scream toot. giant. Build. your own. hilarious. sound. effects. machine! 4. Replace the blank. spaces on line 5.

20MB Sizes 5 Downloads 148 Views

Recommend Documents

Bitsbox 15-12.pdf
All you need is a computer with. internet and a working brain. Have you ever wished you had super powers? Maybe the ability to fly? Shoot lasers from your ...

Bitsbox 16-01.pdf
Please make the T. Rex sound like a. harmless kitty cat. Hint: 'cat'. 4 9 5 3. DINO YOGA. Create an app where a dinosaur moves across a. yoga studio? Write "DINO YOGA" on the wall and. play a funny sound when you run the app. CREATIVE CODING CHALLENG