Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in...

12
Scene Changes This is an modification of the June 2009/July 2012 scene change tutorial by Deborah Nelson and Chris Brown By Natalie Huffman Under the direction of Susan Rodger Duke University June 2017 Overview This tutorial is centered around the use of the full range of the camera to construct different scenes in the same world The camera can then shift between scenes, giving the coder the ability to make a more complicated world You will learn how to control the light levels in Alice, and how to move a character between scenes Open a new Alice world Choose “Grass” Go to setup scene Add a camera marker Name it scene1 Camera Markers in Alice 3 Camera markers let you save a viewpoint Above the scene buttons are two positioning buttons The black camera represents your current point of view The first button moves your point of view to the red camera (scene1) In order to move to scene2, you would click on the scene2 button and then on the left top button Note: this picture is from later in the tutorial

Transcript of Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in...

Page 1: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

SceneChanges

ThisisanmodificationoftheJune2009/July2012scenechangetutorialby

DeborahNelsonandChrisBrown

ByNatalieHuffman

UnderthedirectionofSusanRodger

DukeUniversity

June2017

Overview

• Thistutorialiscenteredaroundtheuseofthe

fullrangeofthecameratoconstructdifferent

scenesinthesameworld

• Thecameracanthenshiftbetweenscenes,

givingthecodertheabilitytomakeamore

complicatedworld

• Youwilllearnhowtocontrolthelightlevelsin

Alice,andhowtomoveacharacterbetween

scenes

OpenanewAliceworld

• Choose“Grass”

• Gotosetupscene

• Addacameramarker

• Nameitscene1

CameraMarkersinAlice3

• Cameramarkersletyousaveaviewpoint

• Abovethescenebuttonsaretwopositioningbuttons

• Theblackcamerarepresentsyourcurrentpointofview

• Thefirstbuttonmovesyourpointofviewtotheredcamera(scene1)

• Inordertomovetoscene2,youwouldclickonthescene2buttonandthenonthelefttopbutton

• Note:thispictureisfromlaterinthetutorial

Page 2: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

Cameramarkers,cont.

• Thesecondbutton,ifclicked,

wouldresetthescene1view

tothecurrentview

• Donotclickthisbutton!

• Oncewesetacameraview,

wewilllikelynotwantto

changeit

Changescene1

camera

Change

currentview

Addtoourscene!

• First,wewanttoaddanoasis

• Gotothe“BrowseGalleryByTheme”tab

• Clickonsouthwestànew Pond

• DragthePond(DESERT_OASIS)intothescene

andpositionitsoitisnearthebottommiddle

ofthescreen

Nowtoaddacharacter

• Getbacktothemainthemepagebyclicking

onthe“allthemes”button

• Clickonwonderlandànew Alice

• DragAlice(WONDERLAND)intothesceneand

positionherbytheoasis

Page 3: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

Finishedscene1 Thefirstsceneiscomplete

• Use thecircled

arrowtoturnthe

scenetotheright

• Keep turninguntiltheoasisisnolongervisible

• Now wecanbeginoursecondscene

• Beforeyoudoanythingelse,addanother

camera

• Nameitscene2

CamerasinAlice3

• CamerasinAlice3arephysicalelementsthatshowuponyourscreen

• Soasyouturn,thesideofthescene1camerawillcomeintoview

• Itshouldbethesamecolorinthesceneasitisunderthecameramarkertab(redbydefault)

• Whenyouactuallyrunthescene,thesewillnotbevisible!

• However,youwillhavetobecarefultoavoidthemwhiledoingpositioning,astheycanbeclickedanddragged

Addingelements

• Gobacktothemainthemepage

• Clickonamazonànew RiverPiece

• DragthenewRiverPiece (CURVE1_BLUE)into

thescene

• AddanotherAlicetothescene

(wonderlandàAliceàAlice(WONDERLAND))

Page 4: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

• Inordertopositiontheseelements,youmay

havetousethearrowstoreposition,sothat

youdonotaccidentallyclickonthescene1

camera

• Tryzoomingbackwardsoruptogetabetter

angle

Finishedscene2

Doublecheck!

• Onceyouaresatisfiedwithyourpositioning,

makesureyougobacktoscene1todouble

checkthattheriverisnotvisible!

• Becausetheriverturns,itmayintrudeonthe

firstscene.Ifthisisthecase,simplymoveit

slightlyfurthertotheright

1)Click

here first

2)Thenclick

here

Scene3

• Fromscene2,continuetoturnrightuntilthe

riverisnolongervisible

• Gobacktothemainthemepage

• Clickonsnowànew IceMountain

• DragtheIceMountain (DEFAULT)intothe

scene

• AddandpositionathirdAlice

Page 5: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

Finishedscene3 Finaltouches

• ThethreeAlices wehaveaddedwillactas

placeholdersforposition

• WethenwantafourthAlice,whowillmove

continuallythroughallthescenes

• Gotoscene1andaddafourthAlice

• WewantAlice4tobetheonlyvisibleone

• Usethelistofsceneelementsonthefarleft

tochangeAlice,Alice2,andAlice3toinvisible

• ThisisdonebychangingtheOpacityto0

Timetocode!

• Clickthe“editcode”buttontogobacktothe

codescreen

• First,wewill

createascene

variable

• Gotothe

dropdownmenuàSceneàAdd Scene

Property

Page 6: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

• Valuetype:OthertypesàColor

• Name:storeAtmosphereColor

• Initializer:WHITE

• Nowadda

sceneprocedure

• Nameit

“fadeOut”

Fadeout

• Thisprocedurewilldarkenthescreensowe

canchangethescenewithouttheviewer

seeing

• Draginadotogetherblock

• DraginsetAtmosphereColor andsettoBLACK

– NOTE:ThisisNOTthevariablewecreated,whichcanbechangedwithsetStoreAtmosphereColor

• DraginsetFromAboveLightColor and

setFromBelowLightColor andsetbothto

BLACK

Page 7: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

Testing!

• GobacktomyFirstMethod

• DraginfadeOut andplay!

• Youshouldseethescreendarkenuntilyou

cannolongerseethescene

fadeIn

• Createanothersceneprocedureandnameit

“fadeIn”

• Clickonthe

addparameter

button

• SetthevaluetypetoColorandthe

nameto“atmosphere”

• Draginadotogetherblock

• Likebefore,draginsetAtmosphereColor,but

thistimeselect“atmosphere”,thevariablewe

justcreated

• DraginsetFromAboveLightColor and

setFromBelowLightColor andsetbothto

WHITE

Page 8: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

• Nowtocreatethescenes!

• MakeanewSceneprocedureandnameitscene1

• Draginadotogetherblock

• SelectAlice4– thisshouldbetheonlyvisibleAlice

• DraginamoveTo andselectAlice(thisshouldbetheAliceinscene1)

• ThendraginanorientTo andselectAliceagain

• Draginasayblockandtype“Puteverything

youwanttohappeninscene1inthismethod.”

• Wewanttorepeatthiscodeforscene2and

scene3

• Rightclickonthedotogetherblockandselect

copytoclipboard

• CreateanotherSceneprocedure,andcallit

scene2

• Clickanddragfromthekeyboardtothe

procedure

• ChangethementionsofAlicetoAlice2

• Draginorcopyoverthesayblock,andsay

“Puteverythingyouwanttohappeninscene

2inthismethod”

Page 9: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

Scene3

• CreateafinalSceneprocedureandcallit

scene3

• Repeattheprocess

• Makesuretoswapoutthe2sfor3s!

Useyourprocedures

• GobacktomyFirstMethod

• Draginadotogether

• Selectthis.camera anddragin

moveAndOrientTo,andselectscene1

• Thenselectthis.ground anddraginsetPaint

• Youwillbegivenalistofsettingoptions

• Sinceourfirstsceneisanoasis,wewantthe

groundtobesand

• Finally, selectthis

anddragin

setStoreAtmosphereColor

• Note thatthisisnot

setAtmosphereColor,thisisthe

variablewecreated

• SelectBLACK, thengotothefunctions

tabanddragingetAtmosphereColor

inplaceofBLACK

• Note thatgetAtmosphereColor isnotthevariablewecreated

• Draginscene1

• DraginfadeOut

• Testyourcode!Scene1shouldplay,thenthe

screenshouldfadetoblack

Page 10: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

Repeatforscene2

• Inadotogether

– Havethis.camera moveAndOrientTo scene2

– Havethis.ground setPaint toJungle• DraginfadeIn,andselectstoreAtmosphereColor astheparameter

• Draginscene2

• AndthenfadeOut

• Trytowritethiscodeforyourselfbeforeyoulookatthepictureonthenextslide

storeAtmosphereColor

• Whyarewebotheringwiththisvariable?

• AllstoreAtmosphereColor holdsistheoriginalcoloroftheatmosphere

• InthefadeOut procedureweturntheatmosphereblack

• InfadeIn weturnitbacktotheoriginalcolor

• ThereasonweneedstoreAtmosphereColor isthattheoriginalcoloroftheskyisnotoneofthecoloroptionsAliceprovides

Giveitatry

• SetthefadeIn parametertooneoftheother

colors

• Youcanseehowitchangestheskycolor

• Noneofthemarequitethesameshadeof

blue

• storeAtmosphereColor keepsusfromlosing

thatskycolor!

Page 11: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

Lastscene

• Wewillrepeatthecodeforscene2,exceptfor

scene3

• Inadotogether

– Havethis.camera moveAndOrientTo scene3

– Havethis.ground setPaint toSnow• DraginfadeIn,andselect

storeAtmosphereColor astheparameter

• Draginscene3

• AndthenfadeOut

Finalcode

Ifyouwanttochangeoneofthesky

colors,justchangethefadeIn

parameter!• Forexample,wemightdecidethatmountainskylookssortofgreyandcloudy

• Ifwechoseamoonscene,wemightwanttosetthefadeIn colortoblack

Page 12: Overview Scene Changes...Alice • Drag in a moveToand select Alice (this should be the Alice in scene 1) • Then drag in an orientToand select Alice again • Drag in a say block

ExtraThings

• Trymakingmorethanthreescenes!Youcan

justkeepturningthecamera

• Addmoretotheindividualsceneprocedures.

Makeastory!

• ThecurrentcodefadesinbeforeAlicegets

positioned,soweseehermove.Howwould

youchangethecodesothatAliceisalreadyin

positionwhenthelightsgoon?