17
FLASH WORD GAMES IT 7220 - April 6, 2009 1 Sunday, April 5, 2009

Flash Word Games

Embed Size (px)

DESCRIPTION

Discussion of Flash text/string operations for creating two games: Hangman and Word Search. References Gary Rosenzweig's book: ActionSccipt 3.0 Game Programming University and companion web site http://flashgameu.com/

Citation preview

  • 1. FLASH WORD GAMESIT 7220 - April 6, 2009 Sunday, April 5, 20091

2. AGENDASyllabus updatesProject updates - presentationsStrings in FlashHangman GameWord Search Game Sunday, April 5, 2009 2 3. SYLLABUSThree weeks until presentations - April 27Final Flash discussion next week - Trivia and Quiz GamesNo class meeting May 4 - Reection Paper due Sunday, April 5, 20093 4. PROJECTSFab C - Recycling Maze GameFantastic Four - Geography GameFlash Sharks - Lets Play Math! GameFunky Flash - Algebra: Its an Everyday Thing Quiz GameWorry Warts - Recycling Instructional Game Sunday, April 5, 20094 5. PRESENTATIONS APRIL 2715-20 Minutes including time for questionsProfessional pitch, rehearsed, ppt optional, demoDeliverable will be a CD (no need for binder)Flash, SWF, and related lesProject Documentation: Design Document; Project Plan; prototype/storyboard; pilot report; presentation materialsSunday, April 5, 2009 5 6. STRINGS IN FLASHThink of a string as an array of characters Strings are a very useful engagement design element for creating cognitive challenge with verbal and visual information (examples: word search; sodoku; vocabulary development, etc.) Flash provides a rich set of functions for managing strings--summarized by Rosenzweig on p 302 charAt joinslice toLowerCase charCodeAt lastIndexOf split toUpperCase concat match string fromCharCode replace substr indexOfsearchsubstring Sunday, April 5, 20096 7. TEXT FORMATTINGText formatting may be applied by creating style sheets or TextFormat objects in ActionScriptStyle sheets are applied to HTML text whereas TextFormat objects are used with text elds in FlashTwo methods are available for creating TextObjects: Inline and formalTextFormat objects are usually created just before a TextFieldSunday, April 5, 20097 8. FORMATTING TEXTOBJECTSFlash provides a set of properties for formattingtext--summarized by Rosenzweig on p 304 align fontleftMargintarget blockIndent indentletterSpacing underline bolditalicrightMargin url bulletkerning size color leading tabStops Sunday, April 5, 2009 8 9. CREATING TEXTFIELD OBJECTSCreating a TextField is similar to creating a Sprite Both are display objects Both can be added to other Sprites and Movie clips with addChild var myTextField:TextField = new TextField(); addChild(myTextField); Formats are assigned to text elds using two methods: defaultTextFormat - generally used with text elds in games myTextField.defaultTextFormat = letterFormat; setTextFormat - allows specication of start/end characters for formatting myTextField.setTextFormat(letterFormat);Sunday, April 5, 20099 10. TEXTFIELD PROPERTIESFlash provides a set of properties for managing text elds--summarized by Rosenzweig on p 305-6 autoSizedefaultTextFormat textColor backgroundembedFontstype backgroundColor multiline wordWrap borderselectable borderColor text NOTE: to embed fonts in your project requires that you rst import the font using the library dropdown menu and then set the lingag properties to export the font to ActionScript (discussed on p 306 and in Ch 7) Sunday, April 5, 200910 11. ANIMATED TEXT EXAMPLERosenzweig provides an animated text example to demonstrate the string concepts discussed with a bit of panacheTextFly.aTextFly.asIf you have extra time in your project, this code could be reused to animate the title on your intro frame Sunday, April 5, 2009 11 12. HANGMAN GAME Relatively simple game, take on 19th century game minus the gallowsConsists of guessing the letters to complete a phraseNumber of wrong answers tied to number of frames of movie clip; although game play continues until user quits the Flash appSunday, April 5, 200912 13. HANGMAN GAME ELEMENTSSingle frame with one movie clip in the libraryAll game elements and logic stored in document class library--Hangman.as Sunday, April 5, 200913 14. HANGMAN GAME MODS Easily change phrase in AS le or randomly generate a list of phrases using an arrayInclude an intro, game, and scoring screen to provide setup and scoringEnd game when number of tries exceeds number of frames in movie clipSunday, April 5, 2009 14 15. WORD SEARCH GAME This game is obviously more complex, follows 3- frame structure: intro; play; gameoverAll game logic is in a single document class WordSearch.as linked to WordSearch.aSearches are horizontal, vertical, and diaganolWords are removed from list when located Sunday, April 5, 2009 15 16. WORD SEARCH MODS Easily modiable to any subject, simply change the list of wordsWords could also be read from an external (XML) le for even greater exibilityCould add a timerGrid size can be reduced for younger audiences Sunday, April 5, 2009 16 17. LAB Work in teams Sunday, April 5, 2009 17