SlideShare a Scribd company logo
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                   ¨    
                                                                      ojufk ”’m•— ’u•to•z
                            {’u•to•z •y•x w s’— ”h’m•uh ™f tojko ‘gujv p’u•to•“ s’™ eer ”q “’‘
                                      p‘o’nf–“ h’m•l’kj˜fih ’g‘ ™’“f e™• d™•’˜‘’— ‘–•‘ ” “’‘
                                      yxth y‰yˆ‡x€† …„t ƒ‚€s yxth wvp utsrqpihg
of game builder and visual mobile designer. You will also learn to use the SVG UI editor.
This lab series will take you through the process of developing a mobile game with the assistance
                                                                                  0)f1edc)b10a
   988EYG`BYX'W¥V988E£BV$ §¦£§¤ §¤¢V$¨§¦§ £$¤'§ ¥¤£ ¢ %$$#¥!
                                         ¢U §T  £'S ¤D £ §¤R%§! E8QQ A   # '§  D P
                           ¨ % £¦  !   £¥¤' %§ '¦¨¤£  ¨  ! %%I #H8A@98¡©   o
       § '  ¨ %§  G£ % £¦ F ¦¥  !   ' ¤  %£¦  ¨ ¨§¦C #E8A@98¡©o
     ¤D £  %§ ¤D §¦  !   ' ¤  §¨¦ ¡  £¦¤© £¦ ¨§¦C #B8 A@98¡© o
              # %£¦  ¨ %§ 7¡©6  §¨¦ %  £¦¤ £¦¢ ¨§¦  ¨  £¦¤ ¥¤£ ¢ % ¤ 5¤4 •
                                                                                         310210)(
                                              §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
¤ V  ¤ ¥  ¨ ¤ £  T ¨ TT ¨ ¥     ¥   !
      U               U                                             ¨    5
                                        @R$QD9%FB21A9 ($PDI $1D EBDH
    `$1D EBDH D3DY X C$I (WB21A9W 4A EB29B #012G F$1D EBD% C$4 ))6 (7 %$#'
                                     E
                             $1D EBD% B21A9 A#42 @$928 7 4$321 $0# ))6 ( %$#'
                     S §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
                                   ©
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                              ¨   
                                        §¤¦§  £¥¦  G£ ¡I #       PhonePlayer           o
                                      §¤¦§  £¥¦  G£ §4 #      OwnPlayer             o
     G£  §¤! %§  G£ §5S G % §  £¥¦   ¤  'D §¦  G£¥ '¦£ #
                                                                         Player                o
               - Classes for the player interface and it's implementations.      logic.players
                                                                                 ¡C © ¨
 ! !¦5 ¨§¦ D §¦ %¦¤¢ ¤ % !  ¥   §¦ § % !  ¨ §¦© #
                                                                GameThread                     o
                      G£¥ ¤D  ££¦¢ §¤¦¤D§¦ §¤¦    § # #
                                                                GameInfo                       o
 G£ % £¦ %§  ¦¥  ! §  5  §¤¦' §¦  !  ¨§© # BricksLayerManager             o
                                                                                    §  '
      '¦¢ %  ! §¤ % G£¥¦%   ££¦5 ! §¤¦§ ¢  ¢§#  #   BricksGameCanvas            o
                                  - Contains classes that manage the game workflow            logic
                                                                        u™jfe d’kj6 ojufk ’d’g‘ ’–• ‘•gI
                                                  ’u•to•“ d–’%•k“pojufk f‘™j d’kj6 ™’yju ’g‘ eer ”H “’‘
                                                 §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                   ¨   E
                                         { ’‘‘’k•z f‘ eer ™f tojk
 h{ –’u•™•i ’‘‘’k•zh ‘o’k’d e™• tojko ‘guj– sfe™js ’‘‘’k•z ’g‘ ™T
            •y•np‘’kTik•dj ™f tojko ’k˜fe sfe™js d‘o’nf–z ™T
   ‘™’™f“mfo mf‘do • d• ’‘‘’k•“ ’g‘ f‘ d•y™•’m•ldtoj–R eer ”Q “’‘
              b20©f¥2¨ §¢d¥f¦ 2 1 )1 ¥¢¤0¢(2£¢¡ 2 1 cc
                    §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                          ¨    H
              ”‘’u kkjs fW e™• –’u•™•i ’‘‘’k•z ’g‘ ’dfk
                  d•y™•’m•ldtoj–Rpojufk ”d’dd•k ‘o’k’
                            ’m•l’kj˜fi ”‘o’nf–z ‘o’k’
             §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                    ¨       Q
                 ”–’‘’m•–•“ d‘j e™• –f‘o–‘d™fo ’g‘ ’y–’d˜f ”d•y™•’m•ldtoj–R
6f ’o–fd ’g‘ s’jy f‘ •y•npd•y™•’m•ldtoj–R ™f tojko ’k˜fe sfe™js d‘o’nf–z ™T
                                                                   ‘’u kkjs fW
         s’jy asfkY` •y•np‘’kTik•dj ’g‘ f‘™j d•y™•’m•ltoj–R “f–e e™• u•–
                                                     sfe™js ’‘‘’k•z ’g‘ mf–Y     ”X “’‘
                                  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                            ¨   X
                                    djg‘ ”™fjdd’–“¡A •y•x
                         ™f tojk ”  –f‘o–‘d™fo p ‘’kejm
                         d’j‘–’“f–z ‘o’k’d e™• tojkoc‘gujv
                                d•y™•’m•ldtoj–˜ ‘o’k’
                         s’jy asfkY` •y•np‘’kTik•dj ™T ”b “’‘
             §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                   ¨       b
                                                             ”‘’u kkjs fW
 ™f‘‘
    ˜ %•kz ’g‘ dj djg‘ ‘•g‘ sfe™js d’j‘–’“f–z ™j to’go ™f‘‘Ruyd ‘o’k’   ”¨ “’‘
                                                               ’dfk tojk
                            §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                       ¨    ¨
” ‘’to•–˜ %k–o ‘d•k ’g‘ ’–f6’˜ ’u•“ ’g‘ 6f e™’ ’g‘ ‘• ’efo u™jsfkkf6 ’g‘ eer
                               s’jy a’o–f` f‘ go‘jsd •y•np‘’kTik•dj ™T ” “’‘
                                                                 ”‘’u kkjs fW
       s’jy asfkY` •y•np‘’kTik•dj f‘™j ‘–’kr “f–e e™• u•–e ’‘‘’k•z mf–Y ”¡ “’‘
                              b20©f¥2¨ §¢d¥f¦ 2 1 )1 2©¢¥¥2£ 1b2§ cc
                               §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                 ¨     ¡
         h’o–f f‘ flh ‘o’k’d e™• tojkoc‘gujv ™f‘‘Ruyd ‘o’k’
                     s’jy asfkY` f‘ go‘jsd •y•np‘’kTik•dj ™T ” “’‘
   he•’–g’m•lpojufk –f6 ‘–f“mj eerh ‘o’k’d e™•      ’g‘ ™f tojk
                                        ”’efo u™jsfkkf6 ’g‘ eer
                s’jy a’o–f` f‘ go‘jsd •y•np‘’kTik•dj ™T ”q “’‘
   2ebd)¥ ¢¤¢¡ 12§¨a¤§¢d¥f¦ )1 c¢2b 1 2£¢© cc 3©0fc)(
                   §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                         ¨     
                               ”d’efo u™jsfkkf6 ’g‘ eer ”E “’‘
             §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                      ¨     q
                              %ef˜  ““r%f–‘d’e f‘™j  ’m•l“f‘d ee• sf— ”Q “’‘
” ‘’to•–˜ %k–o ‘d•k ’g‘ ’–f6’˜ ’u•“ ’g‘ 6f e™’ ’g‘ ‘• ’efo u™jsfkkf6 ’g‘ eer
                               s’jy a’o–f` f‘ go‘jsd •y•np‘’kTik•dj ™T ”H “’‘
                               §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
 §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡


a  2£¢© 2 1 2¨f§¢f1f0a

–f6 tffk •y•np–’u•™•i–’%•Tdtoj–R ™T ”X “’‘    ‘j™j


       hT¡ ’m•u ‘j™T ii h ’g‘ sfk’˜ m’g‘ ’‘d•“ e™• d’efo u™jsfkkf6 ’g‘ %“f
gameDesign = new GameDesign();
dukeSprite = gameDesign.getDukeWhite();
jamesSprite = gameDesign.getJamesG();
dukeSprite.defineReferencePixel(dukeSprite.getWidth() / 2, 0);
jamesSprite.defineReferencePixel(jamesSprite.getWidth() / 2, 0);
dukeSpriteAnimator = new SpriteAnimationTask(dukeSprite, false);
jamesSpriteAnimator = new SpriteAnimationTask(jamesSprite, false);

bricksLayer = gameDesign.getBricks();
wallsLayer = gameDesign.getBorder();
gameDesign.updateLayerManagerForLevel1(this);

timer = new Timer();
timer.scheduleAtFixedRate(dukeSpriteAnimator, 0, gameDesign.dukeWhiteseq001Delay);
timer.scheduleAtFixedRate(jamesSpriteAnimator, 0, gameDesign.JamesGseq001Delay);



       ”‘’u kkjs fW




     ¨              $¤'¤¥¨¤£%¨%%¨¥$$#¥!
 §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡

       The inserted code performs the following actions:

             o   Creates a new instance of the GameDesign with the graphical data we created
                 earlier.
             o   Gets and Stores the Duke and James sprites using the
                 gameDesign.getDukeWhite() and gameDesign.getJamesG().
             o   Defines the reference pixels for the sprites used in the methods for setting and
                 retrieving the sprite location.
                 Examples include: setPosition(x,y), getX() and getY().
                 By default the reference pixel is the top-left corner coordinates.
             o   Creates the SpriteAnimationTask instances for James and Duke.
             o   Gets and Stores the Wall and Brick tiled layers
             o   Stores the first scene of level1 that we created by combining the Sprites and
                 Tiled Layers created in the Game Designer that's returned by
                 gameDesign.updateLayerManagerForLevel1




 E    ¨                $¤'¤¥¨¤£%¨%%¨¥$$#¥!
$¤'¤¥¨¤£%¨%%¨¥$$#¥!                                            ¨    H
                                                      p™– e™• ekj˜ kk• ’y• ”¨ “’‘
 ¦¥  U  ! ¤ ¦ ¨§¦' §§¤'  '§§¦   PhonePlayer    !   #    o
  ¦¥  X¡  ! ¤ ¦ ¨§¦' §§¤'  '§§¦   OwnerPlayer    !   #    o
                      The inserted code performs the following actions:
                                                                 ”‘’u kkjs fW
    myPlayer2 = new PhonePlayer(jamesSprite, jamesSpriteAnimator, myGameInfo);
    // init player 2
    myPlayer1 = new OwnerPlayer(dukeSprite, dukeSpriteAnimator, myGameInfo);
    // init player 1
     hd–’%•k“ ‘j™T ii h ’g‘ sfk’˜ m’g‘ ’‘d•“ e™• d’efo u™jsfkkf6 ’g‘ %“f
                         d–’%•kz‘j™j   –f6 tffk •y•np–’u•™•i–’%•Tdtoj–R ™T ”b “’‘
                             §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡

More Related Content

PDF
Hoshin Kanri 1-day workshop - Handout - AME Conference Toronto 2013
PDF
The Lean Training Game Exchange from 5S Supply - June 2013
PDF
Semantic Web Vo Camp Seoul Summer Rdf Vocabularies
PDF
SK컴즈 행복화실 9주 과정 전체
PDF
Revista Española de Defensa
PDF
Who was william shakespeare ?
PDF
PDF
Biometria em r
Hoshin Kanri 1-day workshop - Handout - AME Conference Toronto 2013
The Lean Training Game Exchange from 5S Supply - June 2013
Semantic Web Vo Camp Seoul Summer Rdf Vocabularies
SK컴즈 행복화실 9주 과정 전체
Revista Española de Defensa
Who was william shakespeare ?
Biometria em r

What's hot (20)

PDF
Draft final strategi nasional redd+
PDF
Yahoo Innovation Culture And Hacker
PDF
O ritual do santuário
PDF
Fiestaru07 2003
PDF
20 th inmo_solu
PDF
Torquato Dalcich - Un diario (1944 - 1945)
PDF
Lebanon Welfare Board of Directors -22aug2013
PDF
92428025
PDF
Sapienza stochino-25-06-2013
TXT
Andela.php
PDF
Reformas e auto-reformas da educação no Brasil
PDF
Fichas para trabajar con euros y centimos
PDF
023 vimtamogudu
PDF
Engleza incepatori
PDF
Engleza pentru incepatori
PDF
Aids 01-12
PDF
Aesthetics in Software Testing
PDF
Avakaa sam
PDF
Allari atta-01-03
PDF
Abdullah bin__abdul-baarii_al-ahdal_-_the_slicing_sword
Draft final strategi nasional redd+
Yahoo Innovation Culture And Hacker
O ritual do santuário
Fiestaru07 2003
20 th inmo_solu
Torquato Dalcich - Un diario (1944 - 1945)
Lebanon Welfare Board of Directors -22aug2013
92428025
Sapienza stochino-25-06-2013
Andela.php
Reformas e auto-reformas da educação no Brasil
Fichas para trabajar con euros y centimos
023 vimtamogudu
Engleza incepatori
Engleza pentru incepatori
Aids 01-12
Aesthetics in Software Testing
Avakaa sam
Allari atta-01-03
Abdullah bin__abdul-baarii_al-ahdal_-_the_slicing_sword
Ad

Viewers also liked (10)

PDF
A simple php exercise on date( ) function
PDF
PHP built-in functions date( ) and mktime( ) to calculate age from date of birth
PDF
PHP built-in function mktime example
PDF
Using iMac Built-in Screen Sharing
PDF
Visual basic asp.net programming introduction
PDF
Hosting SWF Flash file
PDF
ASP.net Image Slideshow
PDF
Inaugural Addresses
PDF
Teaching Students with Emojis, Emoticons, & Textspeak
PDF
Hype vs. Reality: The AI Explainer
A simple php exercise on date( ) function
PHP built-in functions date( ) and mktime( ) to calculate age from date of birth
PHP built-in function mktime example
Using iMac Built-in Screen Sharing
Visual basic asp.net programming introduction
Hosting SWF Flash file
ASP.net Image Slideshow
Inaugural Addresses
Teaching Students with Emojis, Emoticons, & Textspeak
Hype vs. Reality: The AI Explainer
Ad

Similar to Mgd09 lab03 (20)

PDF
MSME Conclave - Facilitating Financing & Enhancing Competitiveness
PDF
Argentina (Cordoba) elections 2015
PDF
PDF
document redesign project
PDF
Mgd09 lab01
PDF
Quinones Final Design
PDF
Dispositivi per la telemedicina
PDF
Mgd10 lab03
PDF
Theroyalconnection1week hrh
PDF
Catálogo 1
PDF
método violino kreutzer kr16
PDF
Dav Body
PDF
Mgd01 lab01to03
PDF
Math wb grade 1 (3)
PDF
globes-it-donitza-pr
PDF
القرءان الكريم برواية الدوري عن الكسائي من موقع الشبكة الإسلامية
PDF
خودکاوی-اریک.فروم
PDF
La biblia libro de profecias exactas
PDF
Thesis Abstract & Intro
PDF
Bicos SprayDry: Enfrentando os principais problemas na operação de secagem
MSME Conclave - Facilitating Financing & Enhancing Competitiveness
Argentina (Cordoba) elections 2015
document redesign project
Mgd09 lab01
Quinones Final Design
Dispositivi per la telemedicina
Mgd10 lab03
Theroyalconnection1week hrh
Catálogo 1
método violino kreutzer kr16
Dav Body
Mgd01 lab01to03
Math wb grade 1 (3)
globes-it-donitza-pr
القرءان الكريم برواية الدوري عن الكسائي من موقع الشبكة الإسلامية
خودکاوی-اریک.فروم
La biblia libro de profecias exactas
Thesis Abstract & Intro
Bicos SprayDry: Enfrentando os principais problemas na operação de secagem

More from Hock Leng PUAH (20)

PDF
Integrate jQuery PHP MySQL project to JOOMLA web site
PPTX
Responsive design
PDF
Step by step guide to use mac lion to make hidden folders visible
PPTX
Beautiful web pages
PPT
CSS Basic and Common Errors
PPTX
Connectivity Test for EES Logic Probe Project
PPTX
Logic gate lab intro
PDF
Ohm's law, resistors in series or in parallel
PPTX
Connections Exercises Guide
PPTX
Design to circuit connection
PPTX
NMS Media Services Jobshet 1 to 5 Summary
DOCX
Virtualbox step by step guide
PPTX
Nms chapter 01
PPTX
Pedagogic Innovation to Engage Academically Weaker Students
PPTX
Objective C Primer (with ref to C#)
PPTX
Do While and While Loop
PPTX
C# looping basic
PDF
Mgd10 lab02
PDF
Mgd10 lab01
PDF
Mgd09 lab02
Integrate jQuery PHP MySQL project to JOOMLA web site
Responsive design
Step by step guide to use mac lion to make hidden folders visible
Beautiful web pages
CSS Basic and Common Errors
Connectivity Test for EES Logic Probe Project
Logic gate lab intro
Ohm's law, resistors in series or in parallel
Connections Exercises Guide
Design to circuit connection
NMS Media Services Jobshet 1 to 5 Summary
Virtualbox step by step guide
Nms chapter 01
Pedagogic Innovation to Engage Academically Weaker Students
Objective C Primer (with ref to C#)
Do While and While Loop
C# looping basic
Mgd10 lab02
Mgd10 lab01
Mgd09 lab02

Mgd09 lab03

  • 1. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ ojufk ”’m•— ’u•to•z {’u•to•z •y•x w s’— ”h’m•uh ™f tojko ‘gujv p’u•to•“ s’™ eer ”q “’‘ p‘o’nf–“ h’m•l’kj˜fih ’g‘ ™’“f e™• d™•’˜‘’— ‘–•‘ ” “’‘ yxth y‰yˆ‡x€† …„t ƒ‚€s yxth wvp utsrqpihg of game builder and visual mobile designer. You will also learn to use the SVG UI editor. This lab series will take you through the process of developing a mobile game with the assistance 0)f1edc)b10a 988EYG`BYX'W¥V988E£BV$ §¦£§¤ §¤¢V$¨§¦§ £$¤'§ ¥¤£ ¢ %$$#¥! ¢U §T  £'S ¤D £ §¤R%§! E8QQ A # '§  D P  ¨ % £¦  !   £¥¤' %§ '¦¨¤£  ¨  ! %%I #H8A@98¡© o  § '  ¨ %§  G£ % £¦ F ¦¥  !   ' ¤  %£¦  ¨ ¨§¦C #E8A@98¡©o ¤D £  %§ ¤D §¦  !   ' ¤  §¨¦ ¡  £¦¤© £¦ ¨§¦C #B8 A@98¡© o # %£¦  ¨ %§ 7¡©6  §¨¦ %  £¦¤ £¦¢ ¨§¦  ¨  £¦¤ ¥¤£ ¢ % ¤ 5¤4 • 310210)(  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 2. ¤ V ¤ ¥ ¨ ¤ £ T ¨ TT ¨ ¥ ¥ ! U U  ¨ 5 @R$QD9%FB21A9 ($PDI $1D EBDH `$1D EBDH D3DY X C$I (WB21A9W 4A EB29B #012G F$1D EBD% C$4 ))6 (7 %$#' E $1D EBD% B21A9 A#42 @$928 7 4$321 $0# ))6 ( %$#' S §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡ ©
  • 3. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ §¤¦§  £¥¦  G£ ¡I # PhonePlayer o §¤¦§  £¥¦  G£ §4 # OwnPlayer o  G£  §¤! %§  G£ §5S G % §  £¥¦   ¤  'D §¦  G£¥ '¦£ # Player o - Classes for the player interface and it's implementations. logic.players ¡C © ¨  ! !¦5 ¨§¦ D §¦ %¦¤¢ ¤ % !  ¥  §¦ § % !  ¨ §¦© # GameThread o  G£¥ ¤D  ££¦¢ §¤¦¤D§¦ §¤¦    § # # GameInfo o  G£ % £¦ %§  ¦¥  ! §  5  §¤¦' §¦  !  ¨§© # BricksLayerManager o §  '  '¦¢ %  ! §¤ % G£¥¦%   ££¦5 ! §¤¦§ ¢  ¢§#  # BricksGameCanvas o - Contains classes that manage the game workflow logic  u™jfe d’kj6 ojufk ’d’g‘ ’–• ‘•gI ’u•to•“ d–’%•k“pojufk f‘™j d’kj6 ™’yju ’g‘ eer ”H “’‘  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 4. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ E { ’‘‘’k•z f‘ eer ™f tojk h{ –’u•™•i ’‘‘’k•zh ‘o’k’d e™• tojko ‘guj– sfe™js ’‘‘’k•z ’g‘ ™T •y•np‘’kTik•dj ™f tojko ’k˜fe sfe™js d‘o’nf–z ™T ‘™’™f“mfo mf‘do • d• ’‘‘’k•“ ’g‘ f‘ d•y™•’m•ldtoj–R eer ”Q “’‘ b20©f¥2¨ §¢d¥f¦ 2 1 )1 ¥¢¤0¢(2£¢¡ 2 1 cc  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 5. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ H ”‘’u kkjs fW e™• –’u•™•i ’‘‘’k•z ’g‘ ’dfk d•y™•’m•ldtoj–Rpojufk ”d’dd•k ‘o’k’ ’m•l’kj˜fi ”‘o’nf–z ‘o’k’  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 6. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ Q ”–’‘’m•–•“ d‘j e™• –f‘o–‘d™fo ’g‘ ’y–’d˜f ”d•y™•’m•ldtoj–R 6f ’o–fd ’g‘ s’jy f‘ •y•npd•y™•’m•ldtoj–R ™f tojko ’k˜fe sfe™js d‘o’nf–z ™T ‘’u kkjs fW s’jy asfkY` •y•np‘’kTik•dj ’g‘ f‘™j d•y™•’m•ltoj–R “f–e e™• u•– sfe™js ’‘‘’k•z ’g‘ mf–Y ”X “’‘  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 7. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ X djg‘ ”™fjdd’–“¡A •y•x ™f tojk ”  –f‘o–‘d™fo p ‘’kejm d’j‘–’“f–z ‘o’k’d e™• tojkoc‘gujv d•y™•’m•ldtoj–˜ ‘o’k’ s’jy asfkY` •y•np‘’kTik•dj ™T ”b “’‘  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 8. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ b ”‘’u kkjs fW  ™f‘‘ ˜ %•kz ’g‘ dj djg‘ ‘•g‘ sfe™js d’j‘–’“f–z ™j to’go ™f‘‘Ruyd ‘o’k’ ”¨ “’‘ ’dfk tojk  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 9. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ ¨ ” ‘’to•–˜ %k–o ‘d•k ’g‘ ’–f6’˜ ’u•“ ’g‘ 6f e™’ ’g‘ ‘• ’efo u™jsfkkf6 ’g‘ eer s’jy a’o–f` f‘ go‘jsd •y•np‘’kTik•dj ™T ” “’‘ ”‘’u kkjs fW s’jy asfkY` •y•np‘’kTik•dj f‘™j ‘–’kr “f–e e™• u•–e ’‘‘’k•z mf–Y ”¡ “’‘ b20©f¥2¨ §¢d¥f¦ 2 1 )1 2©¢¥¥2£ 1b2§ cc  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 10. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ ¡ h’o–f f‘ flh ‘o’k’d e™• tojkoc‘gujv ™f‘‘Ruyd ‘o’k’ s’jy asfkY` f‘ go‘jsd •y•np‘’kTik•dj ™T ” “’‘ he•’–g’m•lpojufk –f6 ‘–f“mj eerh ‘o’k’d e™• ’g‘ ™f tojk ”’efo u™jsfkkf6 ’g‘ eer s’jy a’o–f` f‘ go‘jsd •y•np‘’kTik•dj ™T ”q “’‘ 2ebd)¥ ¢¤¢¡ 12§¨a¤§¢d¥f¦ )1 c¢2b 1 2£¢© cc 3©0fc)(  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 11. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ ”d’efo u™jsfkkf6 ’g‘ eer ”E “’‘  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 12. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ q %ef˜  ““r%f–‘d’e f‘™j  ’m•l“f‘d ee• sf— ”Q “’‘ ” ‘’to•–˜ %k–o ‘d•k ’g‘ ’–f6’˜ ’u•“ ’g‘ 6f e™’ ’g‘ ‘• ’efo u™jsfkkf6 ’g‘ eer s’jy a’o–f` f‘ go‘jsd •y•np‘’kTik•dj ™T ”H “’‘  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡
  • 13.  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡ a  2£¢© 2 1 2¨f§¢f1f0a –f6 tffk •y•np–’u•™•i–’%•Tdtoj–R ™T ”X “’‘  ‘j™j hT¡ ’m•u ‘j™T ii h ’g‘ sfk’˜ m’g‘ ’‘d•“ e™• d’efo u™jsfkkf6 ’g‘ %“f gameDesign = new GameDesign(); dukeSprite = gameDesign.getDukeWhite(); jamesSprite = gameDesign.getJamesG(); dukeSprite.defineReferencePixel(dukeSprite.getWidth() / 2, 0); jamesSprite.defineReferencePixel(jamesSprite.getWidth() / 2, 0); dukeSpriteAnimator = new SpriteAnimationTask(dukeSprite, false); jamesSpriteAnimator = new SpriteAnimationTask(jamesSprite, false); bricksLayer = gameDesign.getBricks(); wallsLayer = gameDesign.getBorder(); gameDesign.updateLayerManagerForLevel1(this); timer = new Timer(); timer.scheduleAtFixedRate(dukeSpriteAnimator, 0, gameDesign.dukeWhiteseq001Delay); timer.scheduleAtFixedRate(jamesSpriteAnimator, 0, gameDesign.JamesGseq001Delay); ”‘’u kkjs fW  ¨ $¤'¤¥¨¤£%¨%%¨¥$$#¥!
  • 14.  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡ The inserted code performs the following actions: o Creates a new instance of the GameDesign with the graphical data we created earlier. o Gets and Stores the Duke and James sprites using the gameDesign.getDukeWhite() and gameDesign.getJamesG(). o Defines the reference pixels for the sprites used in the methods for setting and retrieving the sprite location. Examples include: setPosition(x,y), getX() and getY(). By default the reference pixel is the top-left corner coordinates. o Creates the SpriteAnimationTask instances for James and Duke. o Gets and Stores the Wall and Brick tiled layers o Stores the first scene of level1 that we created by combining the Sprites and Tiled Layers created in the Game Designer that's returned by gameDesign.updateLayerManagerForLevel1 E  ¨ $¤'¤¥¨¤£%¨%%¨¥$$#¥!
  • 15. $¤'¤¥¨¤£%¨%%¨¥$$#¥!  ¨ H p™– e™• ekj˜ kk• ’y• ”¨ “’‘  ¦¥  U  ! ¤ ¦ ¨§¦' §§¤'  '§§¦ PhonePlayer  !   # o  ¦¥  X¡  ! ¤ ¦ ¨§¦' §§¤'  '§§¦ OwnerPlayer  !   # o The inserted code performs the following actions: ”‘’u kkjs fW myPlayer2 = new PhonePlayer(jamesSprite, jamesSpriteAnimator, myGameInfo); // init player 2 myPlayer1 = new OwnerPlayer(dukeSprite, dukeSpriteAnimator, myGameInfo); // init player 1 hd–’%•k“ ‘j™T ii h ’g‘ sfk’˜ m’g‘ ’‘d•“ e™• d’efo u™jsfkkf6 ’g‘ %“f  d–’%•kz‘j™j –f6 tffk •y•np–’u•™•i–’%•Tdtoj–R ™T ”b “’‘  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡