• Save
Mgd09 lab03
Upcoming SlideShare
Loading in...5
×
 

Mgd09 lab03

on

  • 382 views

 

Statistics

Views

Total Views
382
Views on SlideShare
377
Embed Views
5

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 5

http://mpgddmgd.blogspot.com 5

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Mgd09 lab03 Mgd09 lab03 Document Transcript

  • $¤&"¤¥¨¤£&%¨%%¨¥$$#¥""!  ¨  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 utsrqpihgof 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¥V&988E£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 its 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–R6f ’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‘ %“fgameDesign = 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 thats 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 “’‘  §¨¦ ¡  £¦¤© £¦ ¨§¦    £¦¤© ¨§¦¥¤£ ¢ ¡