30
Game Making with Alice Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin University of Texas at Austin Games In Alice 1

Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Game Making with AliceGame Making with AliceEat the Hay Game

Mike Scott

University of Texas at AustinUniversity of Texas at Austin

Games In Alice1

Page 2: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

What is Alice?What is Alice?Alice is a visual programming p g glanguage.Alice is designed to teach you Alice is designed to teach you how to programThe output of Alice programs are movies.The movies can be interactive

2 Games In Alice

Page 3: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Alice and Visual ProgrammingAlice and Visual ProgrammingProgramming is done by pointing and clicking, dragging and dropping, selecting from menus, and some typing

Download Alice for free:

lwww.alice.org

3 Games In Alice

Page 4: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Alternate Game Eat The HayAlternate Game – Eat The HayCreate a Game with a cow.

The arrow keys on the keyboard control the cow.

There are 3 bales of hay on the ground.

When the cow gets close to the bales they disappear.

Games In Alice4

Page 5: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Start AliceStart AliceDouble click on the Alice icon to start Alice

It may take a minute to start up

C l h iCancel the openingdialog screen

Games In Alice5

Page 6: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Build the SceneBuild the SceneClick on the add objects button at the bottom right of the scene

Scroll to the Farm category Scroll to the Farm category and clock on Farm

Games In Alice6

Page 7: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Add Hay to WorldAdd Hay to WorldClick and drag 3 bales of hay i h into the scene

Once in the scene objects can be positioned with the mousep

Object can be rotated by selecting the proper option f h hfrom the menu in the upper right

If you want to get rid of an If you want to get rid of an object right click it and select delete

Games In Alice7

Page 8: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Add The CowAdd The CowClick on the Local Gallery to get back to the list of categories

Open the Animals Category

Scroll over to the Cow and add one to the world

Games In Alice8

Page 9: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Make The Hay BiggerMake The Hay BiggerClick on the resize objects button

Click on a bale of hay with the mouse.

M th t k it Move the mouse up to make it bigger.

Make all 3 bigger

Games In Alice9

Page 10: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Exit Scene EditorExit Scene EditorClick the Done Button

Games In Alice10

Page 11: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Add Events for Cow and CameraAdd Events for Cow and CameraClick the create new event button

Select the let the arrow keys move <subject> choicemove <subject> choice

Click the create new event button again.g .

Select the When the world starts choice.

Games In Alice11

Page 12: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Events Events Events should now look like this:

Games In Alice12

Page 13: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Write program for eating HayWrite program for eating HayDrag a while icon from bottom of screen into the program.

While is on bottom of screen

D hi h i k tDrag this to here pick true

Games In Alice13

Page 14: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

While LoopWhile Loop

Games In Alice14

Page 15: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Add 3 ifsAdd 3 ifsDrag 3 ifs from bottom into while loop.

Pick true

Games In Alice15

Page 16: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Program Looks Like ThisProgram Looks Like This

Games In Alice16

Page 17: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Pick the CowPick the CowClick the cow in the object tree

Cl k h f bClick the functions tab

Games In Alice17

Page 18: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Drag into ifDrag into ifClick and drag the cow is within threshold of object icon to replace the true in the first if

When you drop icon select 1 When you drop icon select 1 meter and strawBale from list

Games In Alice18

Page 19: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Complete ifsComplete ifsRepeat for other 2 ifs but pick strawBale2 and strawBale3

Games In Alice19

Page 20: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Make Hay DisappearMake Hay DisappearClick strawBale in object tree

Click the properties tab

Games In Alice20

Page 21: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Make Hay DisappearMake Hay DisappearClick and Drag the opacity icon into the first if

Pick 0 (0%: invisible)

Games In Alice21

Page 22: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Result of HayResult of Hay

Games In Alice22

Page 23: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Repeat for other HayRepeat for other HayDo the same for the other 2 strawBales.

Select in Object tree, click and drag opacity icon, set to 0Be sure to but strawBale2 into if for strawBale2

Games In Alice23

Page 24: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Create method for cameraCreate method for cameraClick on World in the object tree

Click on methods tab and then create new method button.

name methodname methodmove camera

Games In Alice24

Page 25: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

move Cameramove Cameraclick and drag while loop into move camera method

select true

l k d d f b click and drag wait icon from bottom into while loop

select other from the menu and enter 5 select other from the menu and enter 5 in the calculator and click okay

Games In Alice25

Page 26: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

move cameramove cameraselect camera in object tree

select the methods tab and scroll downdown

click and drag the camera turn to gface command into the while loop after the wait

Select cow -> the entire cow from the menu

Games In Alice26

Page 27: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

completed move cameracompleted move camera

Games In Alice27

Page 28: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Set eventsSet eventsIn the events click the camera in the let the arrow keys control event and change to the cow -> the entire cow

click the world in the object tree and then the methods tab

li k d d h i click and drag the move camera icon and replace the nothing event in the bottom when the world starts event

Games In Alice28

Page 29: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Final EventsFinal Events

Pl !!!! Cl k h Pl B Play!!!! Click the Play Button

Games In Alice29

Page 30: Game Making with AliceEatTheHay - University of Texas at ...scottm/firstbytes/Labs... · Game Making with Alice Eat the Hay Game Mike Scott University of Texas at Austin 1 Games In

Possible changes and additionsPossible changes and additionsMake the hay bales move

Make the camera move towards the cow when it turns to face the cow

Ch h l Change camera vehicle to cow

Add instructions

Add h l iAdd a message when player wins

Add more bales of hay or other objects

Play a sound when the bale is eatenPlay a sound when the bale is eaten

Games In Alice30