diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d2ec4a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.pyc +currentroom.png diff --git a/MiniProject4_writeup.odt b/MiniProject4_writeup.odt new file mode 100644 index 0000000..95e365b Binary files /dev/null and b/MiniProject4_writeup.odt differ diff --git a/MiniProject4_writeup.pdf b/MiniProject4_writeup.pdf new file mode 100644 index 0000000..c3759c9 Binary files /dev/null and b/MiniProject4_writeup.pdf differ diff --git a/README.md b/README.md index 61ec120..726a619 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,10 @@ # InteractiveProgramming -This is the base repo for the interactive programming project for Software Design, Spring 2016 at Olin College. +This is Ian Paul and Taylor Sheneman's project on interactive programming. +Most art assets are from Yume Nikki and belong to their original creator. +Music from Yume Nikki, step used under creative commons. +# How to Run +Have pygame and python installed on your computer. Run interactive.py from within the highest level folder the game installed from. It should handle itself. +# Controls +Arrow keys to move +9 to wake up +Play for a few minutes and try waking up a couple of times diff --git a/Screenshot from 2016-03-10 11-36-05.png b/Screenshot from 2016-03-10 11-36-05.png new file mode 100644 index 0000000..02657d9 Binary files /dev/null and b/Screenshot from 2016-03-10 11-36-05.png differ diff --git a/Screenshot from 2016-03-10 11-36-59.png b/Screenshot from 2016-03-10 11-36-59.png new file mode 100644 index 0000000..970eb77 Binary files /dev/null and b/Screenshot from 2016-03-10 11-36-59.png differ diff --git a/classes_No_Name.png b/classes_No_Name.png new file mode 100644 index 0000000..a6065c5 Binary files /dev/null and b/classes_No_Name.png differ diff --git a/html/api-objects.txt b/html/api-objects.txt new file mode 100644 index 0000000..58515bb --- /dev/null +++ b/html/api-objects.txt @@ -0,0 +1,273 @@ +interactive interactive-module.html +interactive.K_KP_MINUS interactive-module.html#K_KP_MINUS +interactive.GL_STEREO interactive-module.html#GL_STEREO +interactive.K_F2 interactive-module.html#K_F2 +interactive.K_F3 interactive-module.html#K_F3 +interactive.BLEND_MULT interactive-module.html#BLEND_MULT +interactive.K_F5 interactive-module.html#K_F5 +interactive.K_F6 interactive-module.html#K_F6 +interactive.K_F1 interactive-module.html#K_F1 +interactive.K_F8 interactive-module.html#K_F8 +interactive.K_F9 interactive-module.html#K_F9 +interactive.K_2 interactive-module.html#K_2 +interactive.K_COMMA interactive-module.html#K_COMMA +interactive.SCRAP_PPM interactive-module.html#SCRAP_PPM +interactive.BLEND_RGBA_MAX interactive-module.html#BLEND_RGBA_MAX +interactive.RLEACCEL interactive-module.html#RLEACCEL +interactive.KMOD_RALT interactive-module.html#KMOD_RALT +interactive.KMOD_LALT interactive-module.html#KMOD_LALT +interactive.__package__ interactive-module.html#__package__ +interactive.BLEND_RGBA_MIN interactive-module.html#BLEND_RGBA_MIN +interactive.GL_GREEN_SIZE interactive-module.html#GL_GREEN_SIZE +interactive.KMOD_NONE interactive-module.html#KMOD_NONE +interactive.K_AMPERSAND interactive-module.html#K_AMPERSAND +interactive.K_PAUSE interactive-module.html#K_PAUSE +interactive.K_n interactive-module.html#K_n +interactive.KMOD_LCTRL interactive-module.html#KMOD_LCTRL +interactive.K_CLEAR interactive-module.html#K_CLEAR +interactive.HAT_LEFTUP interactive-module.html#HAT_LEFTUP +interactive.K_F7 interactive-module.html#K_F7 +interactive.KMOD_META interactive-module.html#KMOD_META +interactive.TIMER_RESOLUTION interactive-module.html#TIMER_RESOLUTION +interactive.HWPALETTE interactive-module.html#HWPALETTE +interactive.KMOD_CAPS interactive-module.html#KMOD_CAPS +interactive.SCRAP_PBM interactive-module.html#SCRAP_PBM +interactive.AUDIO_U8 interactive-module.html#AUDIO_U8 +interactive.SCRAP_CLIPBOARD interactive-module.html#SCRAP_CLIPBOARD +interactive.GL_BUFFER_SIZE interactive-module.html#GL_BUFFER_SIZE +interactive.AUDIO_U16 interactive-module.html#AUDIO_U16 +interactive.K_SPACE interactive-module.html#K_SPACE +interactive.BLEND_RGB_MULT interactive-module.html#BLEND_RGB_MULT +interactive.MOUSEMOTION interactive-module.html#MOUSEMOTION +interactive.K_INSERT interactive-module.html#K_INSERT +interactive.GL_ACCUM_GREEN_SIZE interactive-module.html#GL_ACCUM_GREEN_SIZE +interactive.GL_ACCUM_RED_SIZE interactive-module.html#GL_ACCUM_RED_SIZE +interactive.K_LSUPER interactive-module.html#K_LSUPER +interactive.BLEND_RGB_MAX interactive-module.html#BLEND_RGB_MAX +interactive.BLEND_RGB_MIN interactive-module.html#BLEND_RGB_MIN +interactive.SCRAP_SELECTION interactive-module.html#SCRAP_SELECTION +interactive.GL_RED_SIZE interactive-module.html#GL_RED_SIZE +interactive.HAT_RIGHT interactive-module.html#HAT_RIGHT +interactive.HWACCEL interactive-module.html#HWACCEL +interactive.K_GREATER interactive-module.html#K_GREATER +interactive.HAT_DOWN interactive-module.html#HAT_DOWN +interactive.K_FIRST interactive-module.html#K_FIRST +interactive.K_KP_PERIOD interactive-module.html#K_KP_PERIOD +interactive.K_RALT interactive-module.html#K_RALT +interactive.YV12_OVERLAY interactive-module.html#YV12_OVERLAY +interactive.K_RIGHTBRACKET interactive-module.html#K_RIGHTBRACKET +interactive.K_RSHIFT interactive-module.html#K_RSHIFT +interactive.K_LSHIFT interactive-module.html#K_LSHIFT +interactive.K_LEFTPAREN interactive-module.html#K_LEFTPAREN +interactive.JOYBALLMOTION interactive-module.html#JOYBALLMOTION +interactive.K_LAST interactive-module.html#K_LAST +interactive.BLEND_RGBA_SUB interactive-module.html#BLEND_RGBA_SUB +interactive.K_DOLLAR interactive-module.html#K_DOLLAR +interactive.K_KP_ENTER interactive-module.html#K_KP_ENTER +interactive.K_PAGEDOWN interactive-module.html#K_PAGEDOWN +interactive.K_HASH interactive-module.html#K_HASH +interactive.K_EXCLAIM interactive-module.html#K_EXCLAIM +interactive.K_DOWN interactive-module.html#K_DOWN +interactive.JOYAXISMOTION interactive-module.html#JOYAXISMOTION +interactive.K_END interactive-module.html#K_END +interactive.HAT_LEFT interactive-module.html#HAT_LEFT +interactive.K_HELP interactive-module.html#K_HELP +interactive.GL_DEPTH_SIZE interactive-module.html#GL_DEPTH_SIZE +interactive.UYVY_OVERLAY interactive-module.html#UYVY_OVERLAY +interactive.K_ASTERISK interactive-module.html#K_ASTERISK +interactive.AUDIO_S8 interactive-module.html#AUDIO_S8 +interactive.RESIZABLE interactive-module.html#RESIZABLE +interactive.BLEND_MAX interactive-module.html#BLEND_MAX +interactive.K_LCTRL interactive-module.html#K_LCTRL +interactive.KMOD_NUM interactive-module.html#KMOD_NUM +interactive.K_BACKSLASH interactive-module.html#K_BACKSLASH +interactive.AUDIO_U16LSB interactive-module.html#AUDIO_U16LSB +interactive.K_MINUS interactive-module.html#K_MINUS +interactive.K_0 interactive-module.html#K_0 +interactive.SWSURFACE interactive-module.html#SWSURFACE +interactive.SCRAP_TEXT interactive-module.html#SCRAP_TEXT +interactive.K_r interactive-module.html#K_r +interactive.K_q interactive-module.html#K_q +interactive.SYSWMEVENT interactive-module.html#SYSWMEVENT +interactive.KMOD_LSHIFT interactive-module.html#KMOD_LSHIFT +interactive.KMOD_ALT interactive-module.html#KMOD_ALT +interactive.K_BREAK interactive-module.html#K_BREAK +interactive.NOEVENT interactive-module.html#NOEVENT +interactive.BLEND_ADD interactive-module.html#BLEND_ADD +interactive.K_POWER interactive-module.html#K_POWER +interactive.K_ESCAPE interactive-module.html#K_ESCAPE +interactive.K_BACKSPACE interactive-module.html#K_BACKSPACE +interactive.K_MENU interactive-module.html#K_MENU +interactive.K_UNDERSCORE interactive-module.html#K_UNDERSCORE +interactive.FULLSCREEN interactive-module.html#FULLSCREEN +interactive.RLEACCELOK interactive-module.html#RLEACCELOK +interactive.JOYHATMOTION interactive-module.html#JOYHATMOTION +interactive.SRCALPHA interactive-module.html#SRCALPHA +interactive.SRCCOLORKEY interactive-module.html#SRCCOLORKEY +interactive.K_QUOTEDBL interactive-module.html#K_QUOTEDBL +interactive.K_KP_MULTIPLY interactive-module.html#K_KP_MULTIPLY +interactive.K_COLON interactive-module.html#K_COLON +interactive.GL_SWAP_CONTROL interactive-module.html#GL_SWAP_CONTROL +interactive.KMOD_LMETA interactive-module.html#KMOD_LMETA +interactive.GL_DOUBLEBUFFER interactive-module.html#GL_DOUBLEBUFFER +interactive.ASYNCBLIT interactive-module.html#ASYNCBLIT +interactive.K_t interactive-module.html#K_t +interactive.HAT_LEFTDOWN interactive-module.html#HAT_LEFTDOWN +interactive.VIDEOEXPOSE interactive-module.html#VIDEOEXPOSE +interactive.K_LALT interactive-module.html#K_LALT +interactive.K_F4 interactive-module.html#K_F4 +interactive.K_KP_PLUS interactive-module.html#K_KP_PLUS +interactive.K_NUMLOCK interactive-module.html#K_NUMLOCK +interactive.K_x interactive-module.html#K_x +interactive.K_RMETA interactive-module.html#K_RMETA +interactive.K_LEFT interactive-module.html#K_LEFT +interactive.K_RIGHT interactive-module.html#K_RIGHT +interactive.AUDIO_S16 interactive-module.html#AUDIO_S16 +interactive.GL_ALPHA_SIZE interactive-module.html#GL_ALPHA_SIZE +interactive.K_z interactive-module.html#K_z +interactive.HWSURFACE interactive-module.html#HWSURFACE +interactive.K_SYSREQ interactive-module.html#K_SYSREQ +interactive.NOFRAME interactive-module.html#NOFRAME +interactive.AUDIO_S16LSB interactive-module.html#AUDIO_S16LSB +interactive.K_SEMICOLON interactive-module.html#K_SEMICOLON +interactive.VIDEORESIZE interactive-module.html#VIDEORESIZE +interactive.BLEND_RGBA_ADD interactive-module.html#BLEND_RGBA_ADD +interactive.KMOD_RMETA interactive-module.html#KMOD_RMETA +interactive.HAT_RIGHTDOWN interactive-module.html#HAT_RIGHTDOWN +interactive.K_UNKNOWN interactive-module.html#K_UNKNOWN +interactive.KMOD_MODE interactive-module.html#KMOD_MODE +interactive.BLEND_RGB_ADD interactive-module.html#BLEND_RGB_ADD +interactive.GL_MULTISAMPLESAMPLES interactive-module.html#GL_MULTISAMPLESAMPLES +interactive.GL_BLUE_SIZE interactive-module.html#GL_BLUE_SIZE +interactive.GL_ACCELERATED_VISUAL interactive-module.html#GL_ACCELERATED_VISUAL +interactive.K_EURO interactive-module.html#K_EURO +interactive.KMOD_CTRL interactive-module.html#KMOD_CTRL +interactive.MOUSEBUTTONUP interactive-module.html#MOUSEBUTTONUP +interactive.K_PERIOD interactive-module.html#K_PERIOD +interactive.BLEND_SUB interactive-module.html#BLEND_SUB +interactive.BLEND_MIN interactive-module.html#BLEND_MIN +interactive.JOYBUTTONUP interactive-module.html#JOYBUTTONUP +interactive.K_DELETE interactive-module.html#K_DELETE +interactive.K_CARET interactive-module.html#K_CARET +interactive.BLEND_RGBA_MULT interactive-module.html#BLEND_RGBA_MULT +interactive.LIL_ENDIAN interactive-module.html#LIL_ENDIAN +interactive.KMOD_SHIFT interactive-module.html#KMOD_SHIFT +interactive.K_QUESTION interactive-module.html#K_QUESTION +interactive.KMOD_RSHIFT interactive-module.html#KMOD_RSHIFT +interactive.BIG_ENDIAN interactive-module.html#BIG_ENDIAN +interactive.K_v interactive-module.html#K_v +interactive.GL_MULTISAMPLEBUFFERS interactive-module.html#GL_MULTISAMPLEBUFFERS +interactive.HAT_RIGHTUP interactive-module.html#HAT_RIGHTUP +interactive.QUIT interactive-module.html#QUIT +interactive.K_LMETA interactive-module.html#K_LMETA +interactive.K_TAB interactive-module.html#K_TAB +interactive.K_EQUALS interactive-module.html#K_EQUALS +interactive.GL_ACCUM_BLUE_SIZE interactive-module.html#GL_ACCUM_BLUE_SIZE +interactive.K_MODE interactive-module.html#K_MODE +interactive.OPENGL interactive-module.html#OPENGL +interactive.K_RIGHTPAREN interactive-module.html#K_RIGHTPAREN +interactive.K_SLASH interactive-module.html#K_SLASH +interactive.GL_STENCIL_SIZE interactive-module.html#GL_STENCIL_SIZE +interactive.PREALLOC interactive-module.html#PREALLOC +interactive.K_F12 interactive-module.html#K_F12 +interactive.K_F13 interactive-module.html#K_F13 +interactive.K_F10 interactive-module.html#K_F10 +interactive.K_F11 interactive-module.html#K_F11 +interactive.K_F14 interactive-module.html#K_F14 +interactive.K_F15 interactive-module.html#K_F15 +interactive.K_y interactive-module.html#K_y +interactive.K_KP_EQUALS interactive-module.html#K_KP_EQUALS +interactive.K_l interactive-module.html#K_l +interactive.K_o interactive-module.html#K_o +interactive.YVYU_OVERLAY interactive-module.html#YVYU_OVERLAY +interactive.K_UP interactive-module.html#K_UP +interactive.K_p interactive-module.html#K_p +interactive.K_s interactive-module.html#K_s +interactive.KEYUP interactive-module.html#KEYUP +interactive.K_u interactive-module.html#K_u +interactive.AUDIO_S16MSB interactive-module.html#AUDIO_S16MSB +interactive.K_w interactive-module.html#K_w +interactive.KMOD_RCTRL interactive-module.html#KMOD_RCTRL +interactive.K_i interactive-module.html#K_i +interactive.K_h interactive-module.html#K_h +interactive.K_k interactive-module.html#K_k +interactive.GL_ACCUM_ALPHA_SIZE interactive-module.html#GL_ACCUM_ALPHA_SIZE +interactive.K_m interactive-module.html#K_m +interactive.K_LEFTBRACKET interactive-module.html#K_LEFTBRACKET +interactive.IYUV_OVERLAY interactive-module.html#IYUV_OVERLAY +interactive.K_RSUPER interactive-module.html#K_RSUPER +interactive.K_a interactive-module.html#K_a +interactive.ANYFORMAT interactive-module.html#ANYFORMAT +interactive.BLEND_RGB_SUB interactive-module.html#BLEND_RGB_SUB +interactive.K_e interactive-module.html#K_e +interactive.K_c interactive-module.html#K_c +interactive.K_g interactive-module.html#K_g +interactive.K_f interactive-module.html#K_f +interactive.BUTTON_X2 interactive-module.html#BUTTON_X2 +interactive.K_AT interactive-module.html#K_AT +interactive.BUTTON_X1 interactive-module.html#BUTTON_X1 +interactive.K_PAGEUP interactive-module.html#K_PAGEUP +interactive.K_CAPSLOCK interactive-module.html#K_CAPSLOCK +interactive.DOUBLEBUF interactive-module.html#DOUBLEBUF +interactive.K_PRINT interactive-module.html#K_PRINT +interactive.K_j interactive-module.html#K_j +interactive.KEYDOWN interactive-module.html#KEYDOWN +interactive.K_d interactive-module.html#K_d +interactive.AUDIO_U16SYS interactive-module.html#AUDIO_U16SYS +interactive.K_RETURN interactive-module.html#K_RETURN +interactive.K_SCROLLOCK interactive-module.html#K_SCROLLOCK +interactive.ACTIVEEVENT interactive-module.html#ACTIVEEVENT +interactive.SCRAP_BMP interactive-module.html#SCRAP_BMP +interactive.K_9 interactive-module.html#K_9 +interactive.K_8 interactive-module.html#K_8 +interactive.NUMEVENTS interactive-module.html#NUMEVENTS +interactive.HAT_UP interactive-module.html#HAT_UP +interactive.K_1 interactive-module.html#K_1 +interactive.K_3 interactive-module.html#K_3 +interactive.AUDIO_U16MSB interactive-module.html#AUDIO_U16MSB +interactive.K_5 interactive-module.html#K_5 +interactive.K_4 interactive-module.html#K_4 +interactive.K_7 interactive-module.html#K_7 +interactive.K_6 interactive-module.html#K_6 +interactive.YUY2_OVERLAY interactive-module.html#YUY2_OVERLAY +interactive.HAT_CENTERED interactive-module.html#HAT_CENTERED +interactive.K_KP_DIVIDE interactive-module.html#K_KP_DIVIDE +interactive.K_PLUS interactive-module.html#K_PLUS +interactive.K_KP6 interactive-module.html#K_KP6 +interactive.USEREVENT interactive-module.html#USEREVENT +interactive.K_b interactive-module.html#K_b +interactive.K_QUOTE interactive-module.html#K_QUOTE +interactive.K_HOME interactive-module.html#K_HOME +interactive.K_RCTRL interactive-module.html#K_RCTRL +interactive.MOUSEBUTTONDOWN interactive-module.html#MOUSEBUTTONDOWN +interactive.K_LESS interactive-module.html#K_LESS +interactive.AUDIO_S16SYS interactive-module.html#AUDIO_S16SYS +interactive.OPENGLBLIT interactive-module.html#OPENGLBLIT +interactive.JOYBUTTONDOWN interactive-module.html#JOYBUTTONDOWN +interactive.K_KP8 interactive-module.html#K_KP8 +interactive.K_KP9 interactive-module.html#K_KP9 +interactive.K_KP4 interactive-module.html#K_KP4 +interactive.K_KP5 interactive-module.html#K_KP5 +interactive.K_BACKQUOTE interactive-module.html#K_BACKQUOTE +interactive.K_KP7 interactive-module.html#K_KP7 +interactive.K_KP0 interactive-module.html#K_KP0 +interactive.K_KP1 interactive-module.html#K_KP1 +interactive.K_KP2 interactive-module.html#K_KP2 +interactive.K_KP3 interactive-module.html#K_KP3 +interactive.Connection interactive.Connection-class.html +interactive.Connection.__init__ interactive.Connection-class.html#__init__ +interactive.ExitBlock interactive.ExitBlock-class.html +interactive.ExitBlock.__init__ interactive.ExitBlock-class.html#__init__ +interactive.GameController interactive.GameController-class.html +interactive.GameController.update interactive.GameController-class.html#update +interactive.GameController.__init__ interactive.GameController-class.html#__init__ +interactive.GameModel interactive.GameModel-class.html +interactive.GameModel.generate_room interactive.GameModel-class.html#generate_room +interactive.GameModel.update interactive.GameModel-class.html#update +interactive.GameModel.__init__ interactive.GameModel-class.html#__init__ +interactive.GameView interactive.GameView-class.html +interactive.GameView.draw interactive.GameView-class.html#draw +interactive.GameView.build_surface interactive.GameView-class.html#build_surface +interactive.GameView.__init__ interactive.GameView-class.html#__init__ +interactive.Wall interactive.Wall-class.html +interactive.Wall.__init__ interactive.Wall-class.html#__init__ diff --git a/html/class-tree.html b/html/class-tree.html new file mode 100644 index 0000000..a2229a7 --- /dev/null +++ b/html/class-tree.html @@ -0,0 +1,127 @@ + + + + + Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+
+ [ Module Hierarchy + | Class Hierarchy ] +

+

Class Hierarchy

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/crarr.png b/html/crarr.png new file mode 100644 index 0000000..26b43c5 Binary files /dev/null and b/html/crarr.png differ diff --git a/html/epydoc.css b/html/epydoc.css new file mode 100644 index 0000000..86d4170 --- /dev/null +++ b/html/epydoc.css @@ -0,0 +1,322 @@ + + +/* Epydoc CSS Stylesheet + * + * This stylesheet can be used to customize the appearance of epydoc's + * HTML output. + * + */ + +/* Default Colors & Styles + * - Set the default foreground & background color with 'body'; and + * link colors with 'a:link' and 'a:visited'. + * - Use bold for decision list terms. + * - The heading styles defined here are used for headings *within* + * docstring descriptions. All headings used by epydoc itself use + * either class='epydoc' or class='toc' (CSS styles for both + * defined below). + */ +body { background: #ffffff; color: #000000; } +p { margin-top: 0.5em; margin-bottom: 0.5em; } +a:link { color: #0000ff; } +a:visited { color: #204080; } +dt { font-weight: bold; } +h1 { font-size: +140%; font-style: italic; + font-weight: bold; } +h2 { font-size: +125%; font-style: italic; + font-weight: bold; } +h3 { font-size: +110%; font-style: italic; + font-weight: normal; } +code { font-size: 100%; } +/* N.B.: class, not pseudoclass */ +a.link { font-family: monospace; } + +/* Page Header & Footer + * - The standard page header consists of a navigation bar (with + * pointers to standard pages such as 'home' and 'trees'); a + * breadcrumbs list, which can be used to navigate to containing + * classes or modules; options links, to show/hide private + * variables and to show/hide frames; and a page title (using + *

). The page title may be followed by a link to the + * corresponding source code (using 'span.codelink'). + * - The footer consists of a navigation bar, a timestamp, and a + * pointer to epydoc's homepage. + */ +h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; } +h2.epydoc { font-size: +130%; font-weight: bold; } +h3.epydoc { font-size: +115%; font-weight: bold; + margin-top: 0.2em; } +td h3.epydoc { font-size: +115%; font-weight: bold; + margin-bottom: 0; } +table.navbar { background: #a0c0ff; color: #000000; + border: 2px groove #c0d0d0; } +table.navbar table { color: #000000; } +th.navbar-select { background: #70b0ff; + color: #000000; } +table.navbar a { text-decoration: none; } +table.navbar a:link { color: #0000ff; } +table.navbar a:visited { color: #204080; } +span.breadcrumbs { font-size: 85%; font-weight: bold; } +span.options { font-size: 70%; } +span.codelink { font-size: 85%; } +td.footer { font-size: 85%; } + +/* Table Headers + * - Each summary table and details section begins with a 'header' + * row. This row contains a section title (marked by + * 'span.table-header') as well as a show/hide private link + * (marked by 'span.options', defined above). + * - Summary tables that contain user-defined groups mark those + * groups using 'group header' rows. + */ +td.table-header { background: #70b0ff; color: #000000; + border: 1px solid #608090; } +td.table-header table { color: #000000; } +td.table-header table a:link { color: #0000ff; } +td.table-header table a:visited { color: #204080; } +span.table-header { font-size: 120%; font-weight: bold; } +th.group-header { background: #c0e0f8; color: #000000; + text-align: left; font-style: italic; + font-size: 115%; + border: 1px solid #608090; } + +/* Summary Tables (functions, variables, etc) + * - Each object is described by a single row of the table with + * two cells. The left cell gives the object's type, and is + * marked with 'code.summary-type'. The right cell gives the + * object's name and a summary description. + * - CSS styles for the table's header and group headers are + * defined above, under 'Table Headers' + */ +table.summary { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; + margin-bottom: 0.5em; } +td.summary { border: 1px solid #608090; } +code.summary-type { font-size: 85%; } +table.summary a:link { color: #0000ff; } +table.summary a:visited { color: #204080; } + + +/* Details Tables (functions, variables, etc) + * - Each object is described in its own div. + * - A single-row summary table w/ table-header is used as + * a header for each details section (CSS style for table-header + * is defined above, under 'Table Headers'). + */ +table.details { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; + margin: .2em 0 0 0; } +table.details table { color: #000000; } +table.details a:link { color: #0000ff; } +table.details a:visited { color: #204080; } + +/* Fields */ +dl.fields { margin-left: 2em; margin-top: 1em; + margin-bottom: 1em; } +dl.fields dd ul { margin-left: 0em; padding-left: 0em; } +dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; } +div.fields { margin-left: 2em; } +div.fields p { margin-bottom: 0.5em; } + +/* Index tables (identifier index, term index, etc) + * - link-index is used for indices containing lists of links + * (namely, the identifier index & term index). + * - index-where is used in link indices for the text indicating + * the container/source for each link. + * - metadata-index is used for indices containing metadata + * extracted from fields (namely, the bug index & todo index). + */ +table.link-index { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; } +td.link-index { border-width: 0px; } +table.link-index a:link { color: #0000ff; } +table.link-index a:visited { color: #204080; } +span.index-where { font-size: 70%; } +table.metadata-index { border-collapse: collapse; + background: #e8f0f8; color: #000000; + border: 1px solid #608090; + margin: .2em 0 0 0; } +td.metadata-index { border-width: 1px; border-style: solid; } +table.metadata-index a:link { color: #0000ff; } +table.metadata-index a:visited { color: #204080; } + +/* Function signatures + * - sig* is used for the signature in the details section. + * - .summary-sig* is used for the signature in the summary + * table, and when listing property accessor functions. + * */ +.sig-name { color: #006080; } +.sig-arg { color: #008060; } +.sig-default { color: #602000; } +.summary-sig { font-family: monospace; } +.summary-sig-name { color: #006080; font-weight: bold; } +table.summary a.summary-sig-name:link + { color: #006080; font-weight: bold; } +table.summary a.summary-sig-name:visited + { color: #006080; font-weight: bold; } +.summary-sig-arg { color: #006040; } +.summary-sig-default { color: #501800; } + +/* Subclass list + */ +ul.subclass-list { display: inline; } +ul.subclass-list li { display: inline; } + +/* To render variables, classes etc. like functions */ +table.summary .summary-name { color: #006080; font-weight: bold; + font-family: monospace; } +table.summary + a.summary-name:link { color: #006080; font-weight: bold; + font-family: monospace; } +table.summary + a.summary-name:visited { color: #006080; font-weight: bold; + font-family: monospace; } + +/* Variable values + * - In the 'variable details' sections, each varaible's value is + * listed in a 'pre.variable' box. The width of this box is + * restricted to 80 chars; if the value's repr is longer than + * this it will be wrapped, using a backslash marked with + * class 'variable-linewrap'. If the value's repr is longer + * than 3 lines, the rest will be ellided; and an ellipsis + * marker ('...' marked with 'variable-ellipsis') will be used. + * - If the value is a string, its quote marks will be marked + * with 'variable-quote'. + * - If the variable is a regexp, it is syntax-highlighted using + * the re* CSS classes. + */ +pre.variable { padding: .5em; margin: 0; + background: #dce4ec; color: #000000; + border: 1px solid #708890; } +.variable-linewrap { color: #604000; font-weight: bold; } +.variable-ellipsis { color: #604000; font-weight: bold; } +.variable-quote { color: #604000; font-weight: bold; } +.variable-group { color: #008000; font-weight: bold; } +.variable-op { color: #604000; font-weight: bold; } +.variable-string { color: #006030; } +.variable-unknown { color: #a00000; font-weight: bold; } +.re { color: #000000; } +.re-char { color: #006030; } +.re-op { color: #600000; } +.re-group { color: #003060; } +.re-ref { color: #404040; } + +/* Base tree + * - Used by class pages to display the base class hierarchy. + */ +pre.base-tree { font-size: 80%; margin: 0; } + +/* Frames-based table of contents headers + * - Consists of two frames: one for selecting modules; and + * the other listing the contents of the selected module. + * - h1.toc is used for each frame's heading + * - h2.toc is used for subheadings within each frame. + */ +h1.toc { text-align: center; font-size: 105%; + margin: 0; font-weight: bold; + padding: 0; } +h2.toc { font-size: 100%; font-weight: bold; + margin: 0.5em 0 0 -0.3em; } + +/* Syntax Highlighting for Source Code + * - doctest examples are displayed in a 'pre.py-doctest' block. + * If the example is in a details table entry, then it will use + * the colors specified by the 'table pre.py-doctest' line. + * - Source code listings are displayed in a 'pre.py-src' block. + * Each line is marked with 'span.py-line' (used to draw a line + * down the left margin, separating the code from the line + * numbers). Line numbers are displayed with 'span.py-lineno'. + * The expand/collapse block toggle button is displayed with + * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not + * modify the font size of the text.) + * - If a source code page is opened with an anchor, then the + * corresponding code block will be highlighted. The code + * block's header is highlighted with 'py-highlight-hdr'; and + * the code block's body is highlighted with 'py-highlight'. + * - The remaining py-* classes are used to perform syntax + * highlighting (py-string for string literals, py-name for names, + * etc.) + */ +pre.py-doctest { padding: .5em; margin: 1em; + background: #e8f0f8; color: #000000; + border: 1px solid #708890; } +table pre.py-doctest { background: #dce4ec; + color: #000000; } +pre.py-src { border: 2px solid #000000; + background: #f0f0f0; color: #000000; } +.py-line { border-left: 2px solid #000000; + margin-left: .2em; padding-left: .4em; } +.py-lineno { font-style: italic; font-size: 90%; + padding-left: .5em; } +a.py-toggle { text-decoration: none; } +div.py-highlight-hdr { border-top: 2px solid #000000; + border-bottom: 2px solid #000000; + background: #d8e8e8; } +div.py-highlight { border-bottom: 2px solid #000000; + background: #d0e0e0; } +.py-prompt { color: #005050; font-weight: bold;} +.py-more { color: #005050; font-weight: bold;} +.py-string { color: #006030; } +.py-comment { color: #003060; } +.py-keyword { color: #600000; } +.py-output { color: #404040; } +.py-name { color: #000050; } +.py-name:link { color: #000050 !important; } +.py-name:visited { color: #000050 !important; } +.py-number { color: #005000; } +.py-defname { color: #000060; font-weight: bold; } +.py-def-name { color: #000060; font-weight: bold; } +.py-base-class { color: #000060; } +.py-param { color: #000060; } +.py-docstring { color: #006030; } +.py-decorator { color: #804020; } +/* Use this if you don't want links to names underlined: */ +/*a.py-name { text-decoration: none; }*/ + +/* Graphs & Diagrams + * - These CSS styles are used for graphs & diagrams generated using + * Graphviz dot. 'img.graph-without-title' is used for bare + * diagrams (to remove the border created by making the image + * clickable). + */ +img.graph-without-title { border: none; } +img.graph-with-title { border: 1px solid #000000; } +span.graph-title { font-weight: bold; } +span.graph-caption { } + +/* General-purpose classes + * - 'p.indent-wrapped-lines' defines a paragraph whose first line + * is not indented, but whose subsequent lines are. + * - The 'nomargin-top' class is used to remove the top margin (e.g. + * from lists). The 'nomargin' class is used to remove both the + * top and bottom margin (but not the left or right margin -- + * for lists, that would cause the bullets to disappear.) + */ +p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em; + margin: 0; } +.nomargin-top { margin-top: 0; } +.nomargin { margin-top: 0; margin-bottom: 0; } + +/* HTML Log */ +div.log-block { padding: 0; margin: .5em 0 .5em 0; + background: #e8f0f8; color: #000000; + border: 1px solid #000000; } +div.log-error { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffb0b0; color: #000000; + border: 1px solid #000000; } +div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffffb0; color: #000000; + border: 1px solid #000000; } +div.log-info { padding: .1em .3em .1em .3em; margin: 4px; + background: #b0ffb0; color: #000000; + border: 1px solid #000000; } +h2.log-hdr { background: #70b0ff; color: #000000; + margin: 0; padding: 0em 0.5em 0em 0.5em; + border-bottom: 1px solid #000000; font-size: 110%; } +p.log { font-weight: bold; margin: .5em 0 .5em 0; } +tr.opt-changed { color: #000000; font-weight: bold; } +tr.opt-default { color: #606060; } +pre.log { margin: 0; padding: 0; padding-left: 1em; } diff --git a/html/epydoc.js b/html/epydoc.js new file mode 100644 index 0000000..e787dbc --- /dev/null +++ b/html/epydoc.js @@ -0,0 +1,293 @@ +function toggle_private() { + // Search for any private/public links on this page. Store + // their old text in "cmd," so we will know what action to + // take; and change their text to the opposite action. + var cmd = "?"; + var elts = document.getElementsByTagName("a"); + for(var i=0; i...
"; + elt.innerHTML = s; + } +} + +function toggle(id) { + elt = document.getElementById(id+"-toggle"); + if (elt.innerHTML == "-") + collapse(id); + else + expand(id); + return false; +} + +function highlight(id) { + var elt = document.getElementById(id+"-def"); + if (elt) elt.className = "py-highlight-hdr"; + var elt = document.getElementById(id+"-expanded"); + if (elt) elt.className = "py-highlight"; + var elt = document.getElementById(id+"-collapsed"); + if (elt) elt.className = "py-highlight"; +} + +function num_lines(s) { + var n = 1; + var pos = s.indexOf("\n"); + while ( pos > 0) { + n += 1; + pos = s.indexOf("\n", pos+1); + } + return n; +} + +// Collapse all blocks that mave more than `min_lines` lines. +function collapse_all(min_lines) { + var elts = document.getElementsByTagName("div"); + for (var i=0; i 0) + if (elt.id.substring(split, elt.id.length) == "-expanded") + if (num_lines(elt.innerHTML) > min_lines) + collapse(elt.id.substring(0, split)); + } +} + +function expandto(href) { + var start = href.indexOf("#")+1; + if (start != 0 && start != href.length) { + if (href.substring(start, href.length) != "-") { + collapse_all(4); + pos = href.indexOf(".", start); + while (pos != -1) { + var id = href.substring(start, pos); + expand(id); + pos = href.indexOf(".", pos+1); + } + var id = href.substring(start, href.length); + expand(id); + highlight(id); + } + } +} + +function kill_doclink(id) { + var parent = document.getElementById(id); + parent.removeChild(parent.childNodes.item(0)); +} +function auto_kill_doclink(ev) { + if (!ev) var ev = window.event; + if (!this.contains(ev.toElement)) { + var parent = document.getElementById(this.parentID); + parent.removeChild(parent.childNodes.item(0)); + } +} + +function doclink(id, name, targets_id) { + var elt = document.getElementById(id); + + // If we already opened the box, then destroy it. + // (This case should never occur, but leave it in just in case.) + if (elt.childNodes.length > 1) { + elt.removeChild(elt.childNodes.item(0)); + } + else { + // The outer box: relative + inline positioning. + var box1 = document.createElement("div"); + box1.style.position = "relative"; + box1.style.display = "inline"; + box1.style.top = 0; + box1.style.left = 0; + + // A shadow for fun + var shadow = document.createElement("div"); + shadow.style.position = "absolute"; + shadow.style.left = "-1.3em"; + shadow.style.top = "-1.3em"; + shadow.style.background = "#404040"; + + // The inner box: absolute positioning. + var box2 = document.createElement("div"); + box2.style.position = "relative"; + box2.style.border = "1px solid #a0a0a0"; + box2.style.left = "-.2em"; + box2.style.top = "-.2em"; + box2.style.background = "white"; + box2.style.padding = ".3em .4em .3em .4em"; + box2.style.fontStyle = "normal"; + box2.onmouseout=auto_kill_doclink; + box2.parentID = id; + + // Get the targets + var targets_elt = document.getElementById(targets_id); + var targets = targets_elt.getAttribute("targets"); + var links = ""; + target_list = targets.split(","); + for (var i=0; i" + + target[0] + ""; + } + + // Put it all together. + elt.insertBefore(box1, elt.childNodes.item(0)); + //box1.appendChild(box2); + box1.appendChild(shadow); + shadow.appendChild(box2); + box2.innerHTML = + "Which "+name+" do you want to see documentation for?" + + ""; + } + return false; +} + +function get_anchor() { + var href = location.href; + var start = href.indexOf("#")+1; + if ((start != 0) && (start != href.length)) + return href.substring(start, href.length); + } +function redirect_url(dottedName) { + // Scan through each element of the "pages" list, and check + // if "name" matches with any of them. + for (var i=0; i-m" or "-c"; + // extract the portion & compare it to dottedName. + var pagename = pages[i].substring(0, pages[i].length-2); + if (pagename == dottedName.substring(0,pagename.length)) { + + // We've found a page that matches `dottedName`; + // construct its URL, using leftover `dottedName` + // content to form an anchor. + var pagetype = pages[i].charAt(pages[i].length-1); + var url = pagename + ((pagetype=="m")?"-module.html": + "-class.html"); + if (dottedName.length > pagename.length) + url += "#" + dottedName.substring(pagename.length+1, + dottedName.length); + return url; + } + } + } diff --git a/html/frames.html b/html/frames.html new file mode 100644 index 0000000..e222973 --- /dev/null +++ b/html/frames.html @@ -0,0 +1,17 @@ + + + + + API Documentation + + + + + + + + + diff --git a/html/help.html b/html/help.html new file mode 100644 index 0000000..a74e246 --- /dev/null +++ b/html/help.html @@ -0,0 +1,268 @@ + + + + + Help + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+ +

API Documentation

+ +

This document contains the API (Application Programming Interface) +documentation for this project. Documentation for the Python +objects defined by the project is divided into separate pages for each +package, module, and class. The API documentation also includes two +pages containing information about the project as a whole: a trees +page, and an index page.

+ +

Object Documentation

+ +

Each Package Documentation page contains:

+
    +
  • A description of the package.
  • +
  • A list of the modules and sub-packages contained by the + package.
  • +
  • A summary of the classes defined by the package.
  • +
  • A summary of the functions defined by the package.
  • +
  • A summary of the variables defined by the package.
  • +
  • A detailed description of each function defined by the + package.
  • +
  • A detailed description of each variable defined by the + package.
  • +
+ +

Each Module Documentation page contains:

+
    +
  • A description of the module.
  • +
  • A summary of the classes defined by the module.
  • +
  • A summary of the functions defined by the module.
  • +
  • A summary of the variables defined by the module.
  • +
  • A detailed description of each function defined by the + module.
  • +
  • A detailed description of each variable defined by the + module.
  • +
+ +

Each Class Documentation page contains:

+
    +
  • A class inheritance diagram.
  • +
  • A list of known subclasses.
  • +
  • A description of the class.
  • +
  • A summary of the methods defined by the class.
  • +
  • A summary of the instance variables defined by the class.
  • +
  • A summary of the class (static) variables defined by the + class.
  • +
  • A detailed description of each method defined by the + class.
  • +
  • A detailed description of each instance variable defined by the + class.
  • +
  • A detailed description of each class (static) variable defined + by the class.
  • +
+ +

Project Documentation

+ +

The Trees page contains the module and class hierarchies:

+
    +
  • The module hierarchy lists every package and module, with + modules grouped into packages. At the top level, and within each + package, modules and sub-packages are listed alphabetically.
  • +
  • The class hierarchy lists every class, grouped by base + class. If a class has more than one base class, then it will be + listed under each base class. At the top level, and under each base + class, classes are listed alphabetically.
  • +
+ +

The Index page contains indices of terms and + identifiers:

+
    +
  • The term index lists every term indexed by any object's + documentation. For each term, the index provides links to each + place where the term is indexed.
  • +
  • The identifier index lists the (short) name of every package, + module, class, method, function, variable, and parameter. For each + identifier, the index provides a short description, and a link to + its documentation.
  • +
+ +

The Table of Contents

+ +

The table of contents occupies the two frames on the left side of +the window. The upper-left frame displays the project +contents, and the lower-left frame displays the module +contents:

+ + + + + + + + + +
+ Project
Contents
...
+ API
Documentation
Frame


+
+ Module
Contents
 
...
  +

+ +

The project contents frame contains a list of all packages +and modules that are defined by the project. Clicking on an entry +will display its contents in the module contents frame. Clicking on a +special entry, labeled "Everything," will display the contents of +the entire project.

+ +

The module contents frame contains a list of every +submodule, class, type, exception, function, and variable defined by a +module or package. Clicking on an entry will display its +documentation in the API documentation frame. Clicking on the name of +the module, at the top of the frame, will display the documentation +for the module itself.

+ +

The "frames" and "no frames" buttons below the top +navigation bar can be used to control whether the table of contents is +displayed or not.

+ +

The Navigation Bar

+ +

A navigation bar is located at the top and bottom of every page. +It indicates what type of page you are currently viewing, and allows +you to go to related pages. The following table describes the labels +on the navigation bar. Note that not some labels (such as +[Parent]) are not displayed on all pages.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LabelHighlighted when...Links to...
[Parent](never highlighted) the parent of the current package
[Package]viewing a packagethe package containing the current object +
[Module]viewing a modulethe module containing the current object +
[Class]viewing a class the class containing the current object
[Trees]viewing the trees page the trees page
[Index]viewing the index page the index page
[Help]viewing the help page the help page
+ +

The "show private" and "hide private" buttons below +the top navigation bar can be used to control whether documentation +for private objects is displayed. Private objects are usually defined +as objects whose (short) names begin with a single underscore, but do +not end with an underscore. For example, "_x", +"__pprint", and "epydoc.epytext._tokenize" +are private objects; but "re.sub", +"__init__", and "type_" are not. However, +if a module defines the "__all__" variable, then its +contents are used to decide which objects are private.

+ +

A timestamp below the bottom navigation bar indicates when each +page was last updated.

+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/identifier-index.html b/html/identifier-index.html new file mode 100644 index 0000000..147d9cf --- /dev/null +++ b/html/identifier-index.html @@ -0,0 +1,1056 @@ + + + + + Identifier Index + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+ +
+

Identifier Index

+
+[ + A + B + C + D + E + F + G + H + I + J + K + L + M + N + O + P + Q + R + S + T + U + V + W + X + Y + Z + _ +] +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

A

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

B

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

C

+ + + + + + + + +

D

+ + + + + + + + +

E

+ + + + + + + + +

F

+ + + + + + + + +

G

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

H

+ + + + + + + + + + + + + + + + + + + + + + +

I

+ + + + + + + + +

J

+ + + + + + + + + + + + +

K

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

L

+ + + + + + + + +

M

+ + + + + + + + +

N

+ + + + + + + + +

O

+ + + + + + + + +

P

+ + + + + + + + +

Q

+ + + + + + + + +

R

+ + + + + + + + +

S

+ + + + + + + + + + + + + + + + + + + + + + +

T

+ + + + + + + + +

U

+ + + + + + + + + + + + +

V

+ + + + + + + + +

W

+ + + + + + + + +

Y

+ + + + + + + + +

_

+ + + + + + + + + + + + + + + + + +
+

+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..e222973 --- /dev/null +++ b/html/index.html @@ -0,0 +1,17 @@ + + + + + API Documentation + + + + + + + + + diff --git a/html/interactive-module.html b/html/interactive-module.html new file mode 100644 index 0000000..e50d4d3 --- /dev/null +++ b/html/interactive-module.html @@ -0,0 +1,1972 @@ + + + + + interactive + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Module interactive

source code

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Classes[hide private]
+
+   + + GameView
+ this view handles displaying most of the things. +
+   + + GameModel
+ This is the model for the game +
+   + + Wall
+ it walls +
+   + + ExitBlock
+ It exits +
+   + + Connection
+ It exits +
+   + + GameController
+ This is the controller for the game. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
Variables[hide private]
+
+   + + ACTIVEEVENT = 1 +
+   + + ANYFORMAT = 268435456 +
+   + + ASYNCBLIT = 4 +
+   + + AUDIO_S16 = 32784 +
+   + + AUDIO_S16LSB = 32784 +
+   + + AUDIO_S16MSB = 36880 +
+   + + AUDIO_S16SYS = 32784 +
+   + + AUDIO_S8 = 32776 +
+   + + AUDIO_U16 = 16 +
+   + + AUDIO_U16LSB = 16 +
+   + + AUDIO_U16MSB = 4112 +
+   + + AUDIO_U16SYS = 16 +
+   + + AUDIO_U8 = 8 +
+   + + BIG_ENDIAN = 4321 +
+   + + BLEND_ADD = 1 +
+   + + BLEND_MAX = 5 +
+   + + BLEND_MIN = 4 +
+   + + BLEND_MULT = 3 +
+   + + BLEND_RGBA_ADD = 6 +
+   + + BLEND_RGBA_MAX = 16 +
+   + + BLEND_RGBA_MIN = 9 +
+   + + BLEND_RGBA_MULT = 8 +
+   + + BLEND_RGBA_SUB = 7 +
+   + + BLEND_RGB_ADD = 1 +
+   + + BLEND_RGB_MAX = 5 +
+   + + BLEND_RGB_MIN = 4 +
+   + + BLEND_RGB_MULT = 3 +
+   + + BLEND_RGB_SUB = 2 +
+   + + BLEND_SUB = 2 +
+   + + BUTTON_X1 = 6 +
+   + + BUTTON_X2 = 7 +
+   + + DOUBLEBUF = 1073741824 +
+   + + FULLSCREEN = -2147483648 +
+   + + GL_ACCELERATED_VISUAL = 15 +
+   + + GL_ACCUM_ALPHA_SIZE = 11 +
+   + + GL_ACCUM_BLUE_SIZE = 10 +
+   + + GL_ACCUM_GREEN_SIZE = 9 +
+   + + GL_ACCUM_RED_SIZE = 8 +
+   + + GL_ALPHA_SIZE = 3 +
+   + + GL_BLUE_SIZE = 2 +
+   + + GL_BUFFER_SIZE = 4 +
+   + + GL_DEPTH_SIZE = 6 +
+   + + GL_DOUBLEBUFFER = 5 +
+   + + GL_GREEN_SIZE = 1 +
+   + + GL_MULTISAMPLEBUFFERS = 13 +
+   + + GL_MULTISAMPLESAMPLES = 14 +
+   + + GL_RED_SIZE = 0 +
+   + + GL_STENCIL_SIZE = 7 +
+   + + GL_STEREO = 12 +
+   + + GL_SWAP_CONTROL = 16 +
+   + + HAT_CENTERED = 0 +
+   + + HAT_DOWN = 4 +
+   + + HAT_LEFT = 8 +
+   + + HAT_LEFTDOWN = 12 +
+   + + HAT_LEFTUP = 9 +
+   + + HAT_RIGHT = 2 +
+   + + HAT_RIGHTDOWN = 6 +
+   + + HAT_RIGHTUP = 3 +
+   + + HAT_UP = 1 +
+   + + HWACCEL = 256 +
+   + + HWPALETTE = 536870912 +
+   + + HWSURFACE = 1 +
+   + + IYUV_OVERLAY = 1448433993 +
+   + + JOYAXISMOTION = 7 +
+   + + JOYBALLMOTION = 8 +
+   + + JOYBUTTONDOWN = 10 +
+   + + JOYBUTTONUP = 11 +
+   + + JOYHATMOTION = 9 +
+   + + KEYDOWN = 2 +
+   + + KEYUP = 3 +
+   + + KMOD_ALT = 768 +
+   + + KMOD_CAPS = 8192 +
+   + + KMOD_CTRL = 192 +
+   + + KMOD_LALT = 256 +
+   + + KMOD_LCTRL = 64 +
+   + + KMOD_LMETA = 1024 +
+   + + KMOD_LSHIFT = 1 +
+   + + KMOD_META = 3072 +
+   + + KMOD_MODE = 16384 +
+   + + KMOD_NONE = 0 +
+   + + KMOD_NUM = 4096 +
+   + + KMOD_RALT = 512 +
+   + + KMOD_RCTRL = 128 +
+   + + KMOD_RMETA = 2048 +
+   + + KMOD_RSHIFT = 2 +
+   + + KMOD_SHIFT = 3 +
+   + + K_0 = 48 +
+   + + K_1 = 49 +
+   + + K_2 = 50 +
+   + + K_3 = 51 +
+   + + K_4 = 52 +
+   + + K_5 = 53 +
+   + + K_6 = 54 +
+   + + K_7 = 55 +
+   + + K_8 = 56 +
+   + + K_9 = 57 +
+   + + K_AMPERSAND = 38 +
+   + + K_ASTERISK = 42 +
+   + + K_AT = 64 +
+   + + K_BACKQUOTE = 96 +
+   + + K_BACKSLASH = 92 +
+   + + K_BACKSPACE = 8 +
+   + + K_BREAK = 318 +
+   + + K_CAPSLOCK = 301 +
+   + + K_CARET = 94 +
+   + + K_CLEAR = 12 +
+   + + K_COLON = 58 +
+   + + K_COMMA = 44 +
+   + + K_DELETE = 127 +
+   + + K_DOLLAR = 36 +
+   + + K_DOWN = 274 +
+   + + K_END = 279 +
+   + + K_EQUALS = 61 +
+   + + K_ESCAPE = 27 +
+   + + K_EURO = 321 +
+   + + K_EXCLAIM = 33 +
+   + + K_F1 = 282 +
+   + + K_F10 = 291 +
+   + + K_F11 = 292 +
+   + + K_F12 = 293 +
+   + + K_F13 = 294 +
+   + + K_F14 = 295 +
+   + + K_F15 = 296 +
+   + + K_F2 = 283 +
+   + + K_F3 = 284 +
+   + + K_F4 = 285 +
+   + + K_F5 = 286 +
+   + + K_F6 = 287 +
+   + + K_F7 = 288 +
+   + + K_F8 = 289 +
+   + + K_F9 = 290 +
+   + + K_FIRST = 0 +
+   + + K_GREATER = 62 +
+   + + K_HASH = 35 +
+   + + K_HELP = 315 +
+   + + K_HOME = 278 +
+   + + K_INSERT = 277 +
+   + + K_KP0 = 256 +
+   + + K_KP1 = 257 +
+   + + K_KP2 = 258 +
+   + + K_KP3 = 259 +
+   + + K_KP4 = 260 +
+   + + K_KP5 = 261 +
+   + + K_KP6 = 262 +
+   + + K_KP7 = 263 +
+   + + K_KP8 = 264 +
+   + + K_KP9 = 265 +
+   + + K_KP_DIVIDE = 267 +
+   + + K_KP_ENTER = 271 +
+   + + K_KP_EQUALS = 272 +
+   + + K_KP_MINUS = 269 +
+   + + K_KP_MULTIPLY = 268 +
+   + + K_KP_PERIOD = 266 +
+   + + K_KP_PLUS = 270 +
+   + + K_LALT = 308 +
+   + + K_LAST = 323 +
+   + + K_LCTRL = 306 +
+   + + K_LEFT = 276 +
+   + + K_LEFTBRACKET = 91 +
+   + + K_LEFTPAREN = 40 +
+   + + K_LESS = 60 +
+   + + K_LMETA = 310 +
+   + + K_LSHIFT = 304 +
+   + + K_LSUPER = 311 +
+   + + K_MENU = 319 +
+   + + K_MINUS = 45 +
+   + + K_MODE = 313 +
+   + + K_NUMLOCK = 300 +
+   + + K_PAGEDOWN = 281 +
+   + + K_PAGEUP = 280 +
+   + + K_PAUSE = 19 +
+   + + K_PERIOD = 46 +
+   + + K_PLUS = 43 +
+   + + K_POWER = 320 +
+   + + K_PRINT = 316 +
+   + + K_QUESTION = 63 +
+   + + K_QUOTE = 39 +
+   + + K_QUOTEDBL = 34 +
+   + + K_RALT = 307 +
+   + + K_RCTRL = 305 +
+   + + K_RETURN = 13 +
+   + + K_RIGHT = 275 +
+   + + K_RIGHTBRACKET = 93 +
+   + + K_RIGHTPAREN = 41 +
+   + + K_RMETA = 309 +
+   + + K_RSHIFT = 303 +
+   + + K_RSUPER = 312 +
+   + + K_SCROLLOCK = 302 +
+   + + K_SEMICOLON = 59 +
+   + + K_SLASH = 47 +
+   + + K_SPACE = 32 +
+   + + K_SYSREQ = 317 +
+   + + K_TAB = 9 +
+   + + K_UNDERSCORE = 95 +
+   + + K_UNKNOWN = 0 +
+   + + K_UP = 273 +
+   + + K_a = 97 +
+   + + K_b = 98 +
+   + + K_c = 99 +
+   + + K_d = 100 +
+   + + K_e = 101 +
+   + + K_f = 102 +
+   + + K_g = 103 +
+   + + K_h = 104 +
+   + + K_i = 105 +
+   + + K_j = 106 +
+   + + K_k = 107 +
+   + + K_l = 108 +
+   + + K_m = 109 +
+   + + K_n = 110 +
+   + + K_o = 111 +
+   + + K_p = 112 +
+   + + K_q = 113 +
+   + + K_r = 114 +
+   + + K_s = 115 +
+   + + K_t = 116 +
+   + + K_u = 117 +
+   + + K_v = 118 +
+   + + K_w = 119 +
+   + + K_x = 120 +
+   + + K_y = 121 +
+   + + K_z = 122 +
+   + + LIL_ENDIAN = 1234 +
+   + + MOUSEBUTTONDOWN = 5 +
+   + + MOUSEBUTTONUP = 6 +
+   + + MOUSEMOTION = 4 +
+   + + NOEVENT = 0 +
+   + + NOFRAME = 32 +
+   + + NUMEVENTS = 32 +
+   + + OPENGL = 2 +
+   + + OPENGLBLIT = 10 +
+   + + PREALLOC = 16777216 +
+   + + QUIT = 12 +
+   + + RESIZABLE = 16 +
+   + + RLEACCEL = 16384 +
+   + + RLEACCELOK = 8192 +
+   + + SCRAP_BMP = 'image/bmp' +
+   + + SCRAP_CLIPBOARD = 0 +
+   + + SCRAP_PBM = 'image/pbm' +
+   + + SCRAP_PPM = 'image/ppm' +
+   + + SCRAP_SELECTION = 1 +
+   + + SCRAP_TEXT = 'text/plain' +
+   + + SRCALPHA = 65536 +
+   + + SRCCOLORKEY = 4096 +
+   + + SWSURFACE = 0 +
+   + + SYSWMEVENT = 13 +
+   + + TIMER_RESOLUTION = 10 +
+   + + USEREVENT = 24 +
+   + + UYVY_OVERLAY = 1498831189 +
+   + + VIDEOEXPOSE = 17 +
+   + + VIDEORESIZE = 16 +
+   + + YUY2_OVERLAY = 844715353 +
+   + + YV12_OVERLAY = 842094169 +
+   + + YVYU_OVERLAY = 1431918169 +
+   + + __package__ = None +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/interactive-pysrc.html b/html/interactive-pysrc.html new file mode 100644 index 0000000..905d59e --- /dev/null +++ b/html/interactive-pysrc.html @@ -0,0 +1,367 @@ + + + + + interactive + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module interactive

+
+  1  #vim : tabstop=8 expandtab shiftwidth=4 softtabstop=4 
+  2  import pygame 
+  3  from pygame.locals import * 
+  4  import time 
+  5  from random import choice, random 
+  6  from spritesheet_functions import SpriteSheet 
+  7  from player import CharacterSprite 
+  8  from level import Level, WallSprite, DoorSprite, FloorSprite 
+  9   
+ 10  """globals: walls, exit_blocks""" 
+ 11   
+ 12   
+
13 -class GameView(object): +
14 """this view handles displaying most of the things. + 15 + 16 attributes: model, screen, background""" +
17 - def __init__(self, model, size): +
18 self.model = model + 19 self.screen = pygame.display.set_mode(size) + 20 pygame.mixer.music.load('sounds/TheDarkLake.mp3') # this music plays + 21 pygame.mixer.music.play(-1) + 22 self.background = 'images/room2.png' +
23 +
24 - def draw(self, filename): +
25 """ Draw the game to the pygame window""" + 26 background = pygame.image.load(filename).convert() + 27 # print filename + 28 scaled_bg = pygame.transform.scale(background, size) + 29 self.screen.blit(scaled_bg, (0,0)) + 30 char = self.model.char.image + 31 self.screen.blit(char, (self.model.char.x,self.model.char.y)) + 32 + 33 pygame.display.flip() +
34 +
35 - def build_surface(self, room_map): +
36 """Builds the random rooms image for our procdurally generated rooms""" + 37 surf = pygame.Surface(size) + 38 x = 0 + 39 y = 0 + 40 wallsprite = WallSprite() + 41 wall = wallsprite.image + 42 doorsprite = DoorSprite() + 43 door = doorsprite.image + 44 floorsprite = FloorSprite() + 45 floor = floorsprite.image + 46 for row in room_map: + 47 for col in row: + 48 if col == "W": + 49 surf.blit(wall,(x, y)) + 50 if col == "C": + 51 surf.blit(door,(x, y)) + 52 if col == ".": + 53 surf.blit(floor,(x,y)) + 54 x += 32 + 55 y += 32 + 56 x = 0 + 57 pygame.image.save(surf, 'currentroom.png') +
58 + 59 +
60 -class GameModel(object): +
61 """This is the model for the game + 62 + 63 attributes: height, width, char, start_map, room_map""" +
64 - def __init__(self, width, height): +
65 self.height = height + 66 self.width = width + 67 + 68 self.start_map = ["....................", + 69 "....................", + 70 "....................", + 71 "....................", + 72 "....................", + 73 "......WCWW..........", + 74 "....WWW..WWWWW......", + 75 "....W........W......", + 76 "....W........WWW....", + 77 "....W..........W....", + 78 "....W..........W....", + 79 "....W..........W....", + 80 "....WWWWWXXWWWWW....", + 81 "....................", + 82 "...................."] + 83 self.room_map = self.start_map + 84 + 85 self.generate_room(self.room_map) + 86 + 87 self.char = CharacterSprite(384,224,walls) +
88 + 89 # Parse the level string above. W = wall, X = exit, C = connection +
90 - def generate_room(self, room): +
91 """feed it a list of strings and it populates the globals with rects""" + 92 del walls[:] # List to hold the walls + 93 del exit_blocks[:] # List to hold the exits + 94 del connections[:] # List to hold all connections + 95 self.room_map = room + 96 x = y = 0 + 97 for row in self.room_map: + 98 for col in row: + 99 if col == "W": +100 Wall((x, y)) +101 if col == "X": +102 ExitBlock((x, y)) +103 if col == "C": +104 Connection((x,y)) +105 x += 32 +106 y += 32 +107 x = 0 +
108 +109 +
110 - def update(self, control=0): +
111 """ update the model state""" +112 self.char.update(control) +
113 +114 +
115 -class Wall(object): +
116 """it walls +117 +118 attribute: rect""" +
119 - def __init__(self, pos): +
120 walls.append(self) +121 self.rect = pygame.Rect(pos[0], pos[1], 32, 32) +
122 +123 +
124 -class ExitBlock(object): +
125 """It exits +126 +127 attribute: rect""" +
128 - def __init__(self, pos): +
129 exit_blocks.append(self) +130 self.rect = pygame.Rect(pos[0], pos[1], 32, 32) +
131 +
132 -class Connection(object): +
133 """It exits +134 +135 attribute: rect""" +136 +
137 - def __init__(self, pos): +
138 connections.append(self) +139 self.rect = pygame.Rect(pos[0], pos[1], 32, 32) +140 self.rect.inflate_ip(2,2) +
141 +142 +
143 -class GameController(object): +
144 """This is the controller for the game. It contains a counter for each +145 direction that controls animation state. +146 +147 attributes: model, li, di, ri, ui, room_counter""" +
148 - def __init__(self, model, view): +
149 """ initializes the model and counters""" +150 self.model = model +151 self.view = view +152 self.li = 0 +153 self.di = 0 +154 self.ri = 0 +155 self.ui = 0 +156 self.waking = 0 +157 self.room_counter = 0 +
158 +
159 - def update(self): +
160 """ Updates the game state based on keypresses. +161 Also animates walking ALL DIRECTIONS now""" +162 pressed = pygame.key.get_pressed() +163 global timer +164 if pressed[pygame.K_9]: +165 #This is the wake up function +166 self.waking += 1 +167 if self.waking * random() > 2: +168 timer = True +169 self.model.char.x = 384 +170 self.model.char.y = 224 +171 self.room_counter = 0 +172 +173 self.model.char.image = self.model.char.walking_frames_d[1] +174 self.model.char.rect = self.model.char.image.get_rect().inflate(-4,-32) +175 self.model.char.rect.move_ip(self.model.char.x,self.model.char.y + 16) +176 +177 self.model.room_map = self.model.start_map +178 self.model.generate_room(self.model.start_map) +179 self.view.background = 'images/room2.png' +180 self.model.char.walls = walls +181 +182 +183 if pressed[pygame.K_LEFT]: +184 self.li = (self.li + 1) % 4 +185 self.model.char.move_left(self.li) +186 +187 if pressed[pygame.K_RIGHT]: +188 self.ri = (self.ri + 1) % 4 +189 self.model.char.move_right(self.ri) +190 +191 if pressed[pygame.K_UP]: +192 self.ui = (self.ui + 1) % 4 +193 self.model.char.move_up(self.ui) +194 +195 if pressed[pygame.K_DOWN]: +196 self.di = (self.di + 1) % 4 +197 self.model.char.move_down(self.di) +198 +199 #these functions check for collisions with interactive blocks +200 for exit_block in exit_blocks: +201 if self.model.char.rect.colliderect(exit_block): +202 raise SystemExit, "You won't go out there." +203 for connection in connections: +204 if self.model.char.rect.colliderect(connection): +205 new_spaces = [(40, 200), (560,200), (240,10),(240, 380)] +206 new_space = choice(new_spaces) +207 self.model.char.x = new_space[0] +208 self.model.char.y = new_space[1] +209 +210 self.model.char.image = self.model.char.walking_frames_d[1] +211 self.model.char.rect = self.model.char.image.get_rect().inflate(-4,-32) +212 self.model.char.rect.move_ip(self.model.char.x,self.model.char.y + 16) +213 +214 self.room_counter += 1 +215 self.model.room_map = level.random_gen(self.room_counter) +216 self.model.generate_room(self.model.room_map) +217 self.view.build_surface(self.model.room_map) +218 self.view.background = 'currentroom.png' +219 self.model.char.walls = walls +
220 +221 if __name__ == '__main__': +222 pygame.init() +223 size = (640, 480) # useful +224 # size = (320, 240) # 'native' +225 walls = [] # List to hold the walls +226 exit_blocks = [] # List to hold the exits +227 connections = [] # List to hold all connections +228 model = GameModel(size[0], size[1]) +229 view = GameView(model, size) +230 controller = GameController(model, view) +231 level = Level() +232 running = True +233 timer = False +234 countdown = 5 +235 while running: +236 for event in pygame.event.get(): +237 if event.type == QUIT: +238 running = False +239 model.update() +240 controller.update() +241 view.draw(view.background) +242 time.sleep(.05) +243 if timer == True: +244 countdown -= .05 +245 pygame.mixer.music.load('sounds/Uboa_long.wav') +246 if countdown < .25: +247 pygame.mixer.music.play(0) +248 uboa = pygame.image.load('images/UBOAAAAA.png') +249 uboa = pygame.transform.scale(uboa, size) +250 view.screen.blit(uboa,(0,0)) +251 pygame.display.update() +252 if countdown < 0: +253 running = False +254 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/interactive.Connection-class.html b/html/interactive.Connection-class.html new file mode 100644 index 0000000..f1c0f26 --- /dev/null +++ b/html/interactive.Connection-class.html @@ -0,0 +1,239 @@ + + + + + interactive.Connection + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive :: + Class Connection + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Connection

source code

+
+
+ + + + +
+
+
+

It exits

+

attribute: rect

+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + pos)
+ x.__init__(...) initializes x; see help(type(x)) for signature
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + pos) +
(Constructor) +

+
source code  +
+ +

x.__init__(...) initializes x; see help(type(x)) for signature

+
+
Overrides: + object.__init__ +
(inherited documentation)
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/interactive.ExitBlock-class.html b/html/interactive.ExitBlock-class.html new file mode 100644 index 0000000..978afc4 --- /dev/null +++ b/html/interactive.ExitBlock-class.html @@ -0,0 +1,239 @@ + + + + + interactive.ExitBlock + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive :: + Class ExitBlock + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class ExitBlock

source code

+
+
+ + + + +
+
+
+

It exits

+

attribute: rect

+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + pos)
+ x.__init__(...) initializes x; see help(type(x)) for signature
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + pos) +
(Constructor) +

+
source code  +
+ +

x.__init__(...) initializes x; see help(type(x)) for signature

+
+
Overrides: + object.__init__ +
(inherited documentation)
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/interactive.GameController-class.html b/html/interactive.GameController-class.html new file mode 100644 index 0000000..27614a7 --- /dev/null +++ b/html/interactive.GameController-class.html @@ -0,0 +1,279 @@ + + + + + interactive.GameController + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive :: + Class GameController + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class GameController

source code

+
+
+ + + + + +
+
+
+

This is the controller for the game. It contains a counter for each + direction that controls animation state.

+

attributes: model, li, di, ri, ui, room_counter

+ + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + model, + view)
+ initializes the model and counters
+ source code + +
+ +
+   + + + + + + +
update(self)
+ Updates the game state based on keypresses.
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + model, + view) +
(Constructor) +

+
source code  +
+ +

initializes the model and counters

+
+
Overrides: + object.__init__ +
+
+
+
+ +
+ +
+ + +
+

update(self) +

+
source code  +
+ +

Updates the game state based on keypresses. Also animates walking ALL + DIRECTIONS now

+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/interactive.GameModel-class.html b/html/interactive.GameModel-class.html new file mode 100644 index 0000000..4d96c05 --- /dev/null +++ b/html/interactive.GameModel-class.html @@ -0,0 +1,279 @@ + + + + + interactive.GameModel + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive :: + Class GameModel + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class GameModel

source code

+
+
+ + + + + + +
+
+
+

This is the model for the game

+

attributes: height, width, char, start_map, room_map

+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + width, + height)
+ x.__init__(...) initializes x; see help(type(x)) for signature
+ source code + +
+ +
+   + + + + + + +
generate_room(self, + room)
+ feed it a list of strings and it populates the globals with rects
+ source code + +
+ +
+   + + + + + + +
update(self, + control=0)
+ update the model state
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + width, + height) +
(Constructor) +

+
source code  +
+ +

x.__init__(...) initializes x; see help(type(x)) for signature

+
+
Overrides: + object.__init__ +
(inherited documentation)
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/interactive.GameView-class.html b/html/interactive.GameView-class.html new file mode 100644 index 0000000..8398957 --- /dev/null +++ b/html/interactive.GameView-class.html @@ -0,0 +1,279 @@ + + + + + interactive.GameView + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive :: + Class GameView + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class GameView

source code

+
+
+ + + + + + +
+
+
+

this view handles displaying most of the things.

+

attributes: model, screen, background

+ + + + + + + + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + model, + size)
+ x.__init__(...) initializes x; see help(type(x)) for signature
+ source code + +
+ +
+   + + + + + + +
draw(self, + filename)
+ Draw the game to the pygame window
+ source code + +
+ +
+   + + + + + + +
build_surface(self, + room_map)
+ Builds the random rooms image for our procdurally generated rooms
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + model, + size) +
(Constructor) +

+
source code  +
+ +

x.__init__(...) initializes x; see help(type(x)) for signature

+
+
Overrides: + object.__init__ +
(inherited documentation)
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/interactive.Wall-class.html b/html/interactive.Wall-class.html new file mode 100644 index 0000000..daf1667 --- /dev/null +++ b/html/interactive.Wall-class.html @@ -0,0 +1,239 @@ + + + + + interactive.Wall + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Module interactive :: + Class Wall + + + + + + +
[hide private]
[frames] | no frames]
+
+ +

Class Wall

source code

+
+
+ + + + +
+
+
+

it walls

+

attribute: rect

+ + + + + + + + + + + + + +
+ + + + + +
Instance Methods[hide private]
+
+   + + + + + + +
__init__(self, + pos)
+ x.__init__(...) initializes x; see help(type(x)) for signature
+ source code + +
+ +
+

Inherited from object: + __delattr__, + __format__, + __getattribute__, + __hash__, + __new__, + __reduce__, + __reduce_ex__, + __repr__, + __setattr__, + __sizeof__, + __str__, + __subclasshook__ +

+
+ + + + + + + + + +
+ + + + + +
Properties[hide private]
+
+

Inherited from object: + __class__ +

+
+ + + + + + +
+ + + + + +
Method Details[hide private]
+
+ +
+ +
+ + +
+

__init__(self, + pos) +
(Constructor) +

+
source code  +
+ +

x.__init__(...) initializes x; see help(type(x)) for signature

+
+
Overrides: + object.__init__ +
(inherited documentation)
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/module-tree.html b/html/module-tree.html new file mode 100644 index 0000000..10ac249 --- /dev/null +++ b/html/module-tree.html @@ -0,0 +1,105 @@ + + + + + Module Hierarchy + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  + + + + +
[hide private]
[frames] | no frames]
+
+
+ [ Module Hierarchy + | Class Hierarchy ] +

+

Module Hierarchy

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/html/redirect.html b/html/redirect.html new file mode 100644 index 0000000..a71b751 --- /dev/null +++ b/html/redirect.html @@ -0,0 +1,38 @@ +Epydoc Redirect Page + + + + + + + + +

Epydoc Auto-redirect page

+ +

When javascript is enabled, this page will redirect URLs of +the form redirect.html#dotted.name to the +documentation for the object with the given fully-qualified +dotted name.

+

 

+ + + + + diff --git a/html/toc-everything.html b/html/toc-everything.html new file mode 100644 index 0000000..5dce5a1 --- /dev/null +++ b/html/toc-everything.html @@ -0,0 +1,292 @@ + + + + + Everything + + + + + +

Everything

+
+

All Classes

+ interactive.Connection
interactive.ExitBlock
interactive.GameController
interactive.GameModel
interactive.GameView
interactive.Wall

All Variables

+ interactive.ACTIVEEVENT
interactive.ANYFORMAT
interactive.ASYNCBLIT
interactive.AUDIO_S16
interactive.AUDIO_S16LSB
interactive.AUDIO_S16MSB
interactive.AUDIO_S16SYS
interactive.AUDIO_S8
interactive.AUDIO_U16
interactive.AUDIO_U16LSB
interactive.AUDIO_U16MSB
interactive.AUDIO_U16SYS
interactive.AUDIO_U8
interactive.BIG_ENDIAN
interactive.BLEND_ADD
interactive.BLEND_MAX
interactive.BLEND_MIN
interactive.BLEND_MULT
interactive.BLEND_RGBA_ADD
interactive.BLEND_RGBA_MAX
interactive.BLEND_RGBA_MIN
interactive.BLEND_RGBA_MULT
interactive.BLEND_RGBA_SUB
interactive.BLEND_RGB_ADD
interactive.BLEND_RGB_MAX
interactive.BLEND_RGB_MIN
interactive.BLEND_RGB_MULT
interactive.BLEND_RGB_SUB
interactive.BLEND_SUB
interactive.BUTTON_X1
interactive.BUTTON_X2
interactive.DOUBLEBUF
interactive.FULLSCREEN
interactive.GL_ACCELERATED_VISUAL
interactive.GL_ACCUM_ALPHA_SIZE
interactive.GL_ACCUM_BLUE_SIZE
interactive.GL_ACCUM_GREEN_SIZE
interactive.GL_ACCUM_RED_SIZE
interactive.GL_ALPHA_SIZE
interactive.GL_BLUE_SIZE
interactive.GL_BUFFER_SIZE
interactive.GL_DEPTH_SIZE
interactive.GL_DOUBLEBUFFER
interactive.GL_GREEN_SIZE
interactive.GL_MULTISAMPLEBUFFERS
interactive.GL_MULTISAMPLESAMPLES
interactive.GL_RED_SIZE
interactive.GL_STENCIL_SIZE
interactive.GL_STEREO
interactive.GL_SWAP_CONTROL
interactive.HAT_CENTERED
interactive.HAT_DOWN
interactive.HAT_LEFT
interactive.HAT_LEFTDOWN
interactive.HAT_LEFTUP
interactive.HAT_RIGHT
interactive.HAT_RIGHTDOWN
interactive.HAT_RIGHTUP
interactive.HAT_UP
interactive.HWACCEL
interactive.HWPALETTE
interactive.HWSURFACE
interactive.IYUV_OVERLAY
interactive.JOYAXISMOTION
interactive.JOYBALLMOTION
interactive.JOYBUTTONDOWN
interactive.JOYBUTTONUP
interactive.JOYHATMOTION
interactive.KEYDOWN
interactive.KEYUP
interactive.KMOD_ALT
interactive.KMOD_CAPS
interactive.KMOD_CTRL
interactive.KMOD_LALT
interactive.KMOD_LCTRL
interactive.KMOD_LMETA
interactive.KMOD_LSHIFT
interactive.KMOD_META
interactive.KMOD_MODE
interactive.KMOD_NONE
interactive.KMOD_NUM
interactive.KMOD_RALT
interactive.KMOD_RCTRL
interactive.KMOD_RMETA
interactive.KMOD_RSHIFT
interactive.KMOD_SHIFT
interactive.K_0
interactive.K_1
interactive.K_2
interactive.K_3
interactive.K_4
interactive.K_5
interactive.K_6
interactive.K_7
interactive.K_8
interactive.K_9
interactive.K_AMPERSAND
interactive.K_ASTERISK
interactive.K_AT
interactive.K_BACKQUOTE
interactive.K_BACKSLASH
interactive.K_BACKSPACE
interactive.K_BREAK
interactive.K_CAPSLOCK
interactive.K_CARET
interactive.K_CLEAR
interactive.K_COLON
interactive.K_COMMA
interactive.K_DELETE
interactive.K_DOLLAR
interactive.K_DOWN
interactive.K_END
interactive.K_EQUALS
interactive.K_ESCAPE
interactive.K_EURO
interactive.K_EXCLAIM
interactive.K_F1
interactive.K_F10
interactive.K_F11
interactive.K_F12
interactive.K_F13
interactive.K_F14
interactive.K_F15
interactive.K_F2
interactive.K_F3
interactive.K_F4
interactive.K_F5
interactive.K_F6
interactive.K_F7
interactive.K_F8
interactive.K_F9
interactive.K_FIRST
interactive.K_GREATER
interactive.K_HASH
interactive.K_HELP
interactive.K_HOME
interactive.K_INSERT
interactive.K_KP0
interactive.K_KP1
interactive.K_KP2
interactive.K_KP3
interactive.K_KP4
interactive.K_KP5
interactive.K_KP6
interactive.K_KP7
interactive.K_KP8
interactive.K_KP9
interactive.K_KP_DIVIDE
interactive.K_KP_ENTER
interactive.K_KP_EQUALS
interactive.K_KP_MINUS
interactive.K_KP_MULTIPLY
interactive.K_KP_PERIOD
interactive.K_KP_PLUS
interactive.K_LALT
interactive.K_LAST
interactive.K_LCTRL
interactive.K_LEFT
interactive.K_LEFTBRACKET
interactive.K_LEFTPAREN
interactive.K_LESS
interactive.K_LMETA
interactive.K_LSHIFT
interactive.K_LSUPER
interactive.K_MENU
interactive.K_MINUS
interactive.K_MODE
interactive.K_NUMLOCK
interactive.K_PAGEDOWN
interactive.K_PAGEUP
interactive.K_PAUSE
interactive.K_PERIOD
interactive.K_PLUS
interactive.K_POWER
interactive.K_PRINT
interactive.K_QUESTION
interactive.K_QUOTE
interactive.K_QUOTEDBL
interactive.K_RALT
interactive.K_RCTRL
interactive.K_RETURN
interactive.K_RIGHT
interactive.K_RIGHTBRACKET
interactive.K_RIGHTPAREN
interactive.K_RMETA
interactive.K_RSHIFT
interactive.K_RSUPER
interactive.K_SCROLLOCK
interactive.K_SEMICOLON
interactive.K_SLASH
interactive.K_SPACE
interactive.K_SYSREQ
interactive.K_TAB
interactive.K_UNDERSCORE
interactive.K_UNKNOWN
interactive.K_UP
interactive.K_a
interactive.K_b
interactive.K_c
interactive.K_d
interactive.K_e
interactive.K_f
interactive.K_g
interactive.K_h
interactive.K_i
interactive.K_j
interactive.K_k
interactive.K_l
interactive.K_m
interactive.K_n
interactive.K_o
interactive.K_p
interactive.K_q
interactive.K_r
interactive.K_s
interactive.K_t
interactive.K_u
interactive.K_v
interactive.K_w
interactive.K_x
interactive.K_y
interactive.K_z
interactive.LIL_ENDIAN
interactive.MOUSEBUTTONDOWN
interactive.MOUSEBUTTONUP
interactive.MOUSEMOTION
interactive.NOEVENT
interactive.NOFRAME
interactive.NUMEVENTS
interactive.OPENGL
interactive.OPENGLBLIT
interactive.PREALLOC
interactive.QUIT
interactive.RESIZABLE
interactive.RLEACCEL
interactive.RLEACCELOK
interactive.SCRAP_BMP
interactive.SCRAP_CLIPBOARD
interactive.SCRAP_PBM
interactive.SCRAP_PPM
interactive.SCRAP_SELECTION
interactive.SCRAP_TEXT
interactive.SRCALPHA
interactive.SRCCOLORKEY
interactive.SWSURFACE
interactive.SYSWMEVENT
interactive.TIMER_RESOLUTION
interactive.USEREVENT
interactive.UYVY_OVERLAY
interactive.VIDEOEXPOSE
interactive.VIDEORESIZE
interactive.YUY2_OVERLAY
interactive.YV12_OVERLAY
interactive.YVYU_OVERLAY
interactive.__package__

+[hide private] + + + + diff --git a/html/toc-interactive-module.html b/html/toc-interactive-module.html new file mode 100644 index 0000000..3f68941 --- /dev/null +++ b/html/toc-interactive-module.html @@ -0,0 +1,292 @@ + + + + + interactive + + + + + +

Module interactive

+
+

Classes

+ Connection
ExitBlock
GameController
GameModel
GameView
Wall

Variables

+ ACTIVEEVENT
ANYFORMAT
ASYNCBLIT
AUDIO_S16
AUDIO_S16LSB
AUDIO_S16MSB
AUDIO_S16SYS
AUDIO_S8
AUDIO_U16
AUDIO_U16LSB
AUDIO_U16MSB
AUDIO_U16SYS
AUDIO_U8
BIG_ENDIAN
BLEND_ADD
BLEND_MAX
BLEND_MIN
BLEND_MULT
BLEND_RGBA_ADD
BLEND_RGBA_MAX
BLEND_RGBA_MIN
BLEND_RGBA_MULT
BLEND_RGBA_SUB
BLEND_RGB_ADD
BLEND_RGB_MAX
BLEND_RGB_MIN
BLEND_RGB_MULT
BLEND_RGB_SUB
BLEND_SUB
BUTTON_X1
BUTTON_X2
DOUBLEBUF
FULLSCREEN
GL_ACCELERATED_VISUAL
GL_ACCUM_ALPHA_SIZE
GL_ACCUM_BLUE_SIZE
GL_ACCUM_GREEN_SIZE
GL_ACCUM_RED_SIZE
GL_ALPHA_SIZE
GL_BLUE_SIZE
GL_BUFFER_SIZE
GL_DEPTH_SIZE
GL_DOUBLEBUFFER
GL_GREEN_SIZE
GL_MULTISAMPLEBUFFERS
GL_MULTISAMPLESAMPLES
GL_RED_SIZE
GL_STENCIL_SIZE
GL_STEREO
GL_SWAP_CONTROL
HAT_CENTERED
HAT_DOWN
HAT_LEFT
HAT_LEFTDOWN
HAT_LEFTUP
HAT_RIGHT
HAT_RIGHTDOWN
HAT_RIGHTUP
HAT_UP
HWACCEL
HWPALETTE
HWSURFACE
IYUV_OVERLAY
JOYAXISMOTION
JOYBALLMOTION
JOYBUTTONDOWN
JOYBUTTONUP
JOYHATMOTION
KEYDOWN
KEYUP
KMOD_ALT
KMOD_CAPS
KMOD_CTRL
KMOD_LALT
KMOD_LCTRL
KMOD_LMETA
KMOD_LSHIFT
KMOD_META
KMOD_MODE
KMOD_NONE
KMOD_NUM
KMOD_RALT
KMOD_RCTRL
KMOD_RMETA
KMOD_RSHIFT
KMOD_SHIFT
K_0
K_1
K_2
K_3
K_4
K_5
K_6
K_7
K_8
K_9
K_AMPERSAND
K_ASTERISK
K_AT
K_BACKQUOTE
K_BACKSLASH
K_BACKSPACE
K_BREAK
K_CAPSLOCK
K_CARET
K_CLEAR
K_COLON
K_COMMA
K_DELETE
K_DOLLAR
K_DOWN
K_END
K_EQUALS
K_ESCAPE
K_EURO
K_EXCLAIM
K_F1
K_F10
K_F11
K_F12
K_F13
K_F14
K_F15
K_F2
K_F3
K_F4
K_F5
K_F6
K_F7
K_F8
K_F9
K_FIRST
K_GREATER
K_HASH
K_HELP
K_HOME
K_INSERT
K_KP0
K_KP1
K_KP2
K_KP3
K_KP4
K_KP5
K_KP6
K_KP7
K_KP8
K_KP9
K_KP_DIVIDE
K_KP_ENTER
K_KP_EQUALS
K_KP_MINUS
K_KP_MULTIPLY
K_KP_PERIOD
K_KP_PLUS
K_LALT
K_LAST
K_LCTRL
K_LEFT
K_LEFTBRACKET
K_LEFTPAREN
K_LESS
K_LMETA
K_LSHIFT
K_LSUPER
K_MENU
K_MINUS
K_MODE
K_NUMLOCK
K_PAGEDOWN
K_PAGEUP
K_PAUSE
K_PERIOD
K_PLUS
K_POWER
K_PRINT
K_QUESTION
K_QUOTE
K_QUOTEDBL
K_RALT
K_RCTRL
K_RETURN
K_RIGHT
K_RIGHTBRACKET
K_RIGHTPAREN
K_RMETA
K_RSHIFT
K_RSUPER
K_SCROLLOCK
K_SEMICOLON
K_SLASH
K_SPACE
K_SYSREQ
K_TAB
K_UNDERSCORE
K_UNKNOWN
K_UP
K_a
K_b
K_c
K_d
K_e
K_f
K_g
K_h
K_i
K_j
K_k
K_l
K_m
K_n
K_o
K_p
K_q
K_r
K_s
K_t
K_u
K_v
K_w
K_x
K_y
K_z
LIL_ENDIAN
MOUSEBUTTONDOWN
MOUSEBUTTONUP
MOUSEMOTION
NOEVENT
NOFRAME
NUMEVENTS
OPENGL
OPENGLBLIT
PREALLOC
QUIT
RESIZABLE
RLEACCEL
RLEACCELOK
SCRAP_BMP
SCRAP_CLIPBOARD
SCRAP_PBM
SCRAP_PPM
SCRAP_SELECTION
SCRAP_TEXT
SRCALPHA
SRCCOLORKEY
SWSURFACE
SYSWMEVENT
TIMER_RESOLUTION
USEREVENT
UYVY_OVERLAY
VIDEOEXPOSE
VIDEORESIZE
YUY2_OVERLAY
YV12_OVERLAY
YVYU_OVERLAY
__package__

+[hide private] + + + + diff --git a/html/toc.html b/html/toc.html new file mode 100644 index 0000000..80bb2c2 --- /dev/null +++ b/html/toc.html @@ -0,0 +1,33 @@ + + + + + Table of Contents + + + + + +

Table of Contents

+
+ Everything +
+

Modules

+ interactive

+ [hide private] + + + + diff --git a/html/uml_class_diagram_for_interact.gif b/html/uml_class_diagram_for_interact.gif new file mode 100644 index 0000000..e524c68 Binary files /dev/null and b/html/uml_class_diagram_for_interact.gif differ diff --git a/html/uml_class_diagram_for_interact_2.gif b/html/uml_class_diagram_for_interact_2.gif new file mode 100644 index 0000000..d8a16e1 Binary files /dev/null and b/html/uml_class_diagram_for_interact_2.gif differ diff --git a/html/uml_class_diagram_for_interact_3.gif b/html/uml_class_diagram_for_interact_3.gif new file mode 100644 index 0000000..226261b Binary files /dev/null and b/html/uml_class_diagram_for_interact_3.gif differ diff --git a/html/uml_class_diagram_for_interact_4.gif b/html/uml_class_diagram_for_interact_4.gif new file mode 100644 index 0000000..b48e51e Binary files /dev/null and b/html/uml_class_diagram_for_interact_4.gif differ diff --git a/html/uml_class_diagram_for_interact_5.gif b/html/uml_class_diagram_for_interact_5.gif new file mode 100644 index 0000000..91d7266 Binary files /dev/null and b/html/uml_class_diagram_for_interact_5.gif differ diff --git a/html/uml_class_diagram_for_interact_6.gif b/html/uml_class_diagram_for_interact_6.gif new file mode 100644 index 0000000..9e0e2d0 Binary files /dev/null and b/html/uml_class_diagram_for_interact_6.gif differ diff --git a/images/Starting_room_shot.png b/images/Starting_room_shot.png new file mode 100644 index 0000000..5414131 Binary files /dev/null and b/images/Starting_room_shot.png differ diff --git a/images/UBOAAAAA.png b/images/UBOAAAAA.png new file mode 100644 index 0000000..ebbfc35 Binary files /dev/null and b/images/UBOAAAAA.png differ diff --git a/images/images.png b/images/images.png new file mode 100644 index 0000000..922b188 Binary files /dev/null and b/images/images.png differ diff --git a/images/room2.png b/images/room2.png new file mode 100644 index 0000000..0e07d76 Binary files /dev/null and b/images/room2.png differ diff --git a/images/rooms/Mado_Balcony_Nite.png b/images/rooms/Mado_Balcony_Nite.png new file mode 100644 index 0000000..ca56e03 Binary files /dev/null and b/images/rooms/Mado_Balcony_Nite.png differ diff --git a/images/rooms/Tileset.png b/images/rooms/Tileset.png new file mode 100644 index 0000000..df560e3 Binary files /dev/null and b/images/rooms/Tileset.png differ diff --git a/images/rooms/yume-24.png b/images/rooms/yume-24.png new file mode 100644 index 0000000..ce28e5b Binary files /dev/null and b/images/rooms/yume-24.png differ diff --git a/images/smallspritesheet.png b/images/smallspritesheet.png new file mode 100644 index 0000000..788f13b Binary files /dev/null and b/images/smallspritesheet.png differ diff --git a/images/spritesheet.png b/images/spritesheet.png new file mode 100644 index 0000000..056d4dd Binary files /dev/null and b/images/spritesheet.png differ diff --git a/images/tilesets/doors.png b/images/tilesets/doors.png new file mode 100644 index 0000000..4994ed6 Binary files /dev/null and b/images/tilesets/doors.png differ diff --git a/images/tilesets/floors.png b/images/tilesets/floors.png new file mode 100644 index 0000000..e6fa0f9 Binary files /dev/null and b/images/tilesets/floors.png differ diff --git a/images/tilesets/walls.png b/images/tilesets/walls.png new file mode 100644 index 0000000..2e892c7 Binary files /dev/null and b/images/tilesets/walls.png differ diff --git a/images/transparent.png b/images/transparent.png new file mode 100644 index 0000000..24d2c16 Binary files /dev/null and b/images/transparent.png differ diff --git a/images/white.png b/images/white.png new file mode 100644 index 0000000..6b1264d Binary files /dev/null and b/images/white.png differ diff --git a/interactive.py b/interactive.py new file mode 100644 index 0000000..980d109 --- /dev/null +++ b/interactive.py @@ -0,0 +1,298 @@ +#vim : tabstop=8 expandtab shiftwidth=4 softtabstop=4 +import pygame +from pygame.locals import * +import time +from random import choice, random +from spritesheet_functions import SpriteSheet +from player import CharacterSprite +from level import Level, WallSprite, DoorSprite, FloorSprite + +""" +This is the main function for the game; run to initialize and play. +Try to escape the dream. +Arrow keys to move, 9 to wake up. + +classes: GameView, GameModel, GameController, Wall, ExitBlock, Connection +globals: walls, exit_blocks +""" + + +class GameView(object): + """this view handles displaying most of the things. + + attributes: model, screen, background""" + def __init__(self, model, size): + self.model = model + self.screen = pygame.display.set_mode(size) + + # this music plays + pygame.mixer.music.load('sounds/TheDarkLake.mp3') + pygame.mixer.music.play(-1) + + # starting room image + self.background = 'images/room2.png' + + def draw(self, filename): + """ Draw the game to the pygame window""" + # draws the background + background = pygame.image.load(filename).convert() + scaled_bg = pygame.transform.scale(background, size) + self.screen.blit(scaled_bg, (0,0)) + + # draws the character model + char = self.model.char.image + self.screen.blit(char, (self.model.char.x,self.model.char.y)) + + # update + pygame.display.flip() + + def build_surface(self, room_map): + """Builds the random rooms image for our procedurally generated rooms""" + + # initialize room surface and sprites to use for the specific room + surf = pygame.Surface(size) + wallsprite = WallSprite() + wall = wallsprite.image + doorsprite = DoorSprite() + door = doorsprite.image + floorsprite = FloorSprite() + floor = floorsprite.image + + # build room image based on character map + x = 0 + y = 0 + for row in room_map: + for col in row: + if col == "W": + surf.blit(wall,(x, y)) + if col in ["T","B","L","R"]: + surf.blit(door,(x, y)) + if col == ".": + surf.blit(floor,(x,y)) + x += 32 + y += 32 + x = 0 + + # save to file + pygame.image.save(surf, 'currentroom.png') + + +class GameModel(object): + """This is the model for the game. It contains most of the functional bits + of the level. + + attributes: height, width, char, start_map, room_map""" + def __init__(self, width, height): + self.height = height + self.width = width + + # character map of the starting room + self.start_map = ["....................", + "....................", + "....................", + "....................", + "....................", + "......WTWW..........", + "....WWW..WWWWW......", + "....W........W......", + "....W........WWW....", + "....W..........W....", + "....W..........W....", + "....W..........W....", + "....WWWWWXXWWWWW....", + "....................", + "...................."] + self.room_map = self.start_map + + self.generate_room(self.room_map) + + self.char = CharacterSprite(384,224,walls) + + + def generate_room(self, room): + """Parses the level string above and populates the globals with rects + W = wall, X = exit, C = connection""" + + # clears the global rect lists + del walls[:] # List to hold the walls + del exit_blocks[:] # List to hold the exits + del connections[:] # List to hold all connections + self.room_map = room + + # build global rect lists based on character map + x = 0 + y = 0 + for row in self.room_map: + for col in row: + if col == "W": + Wall((x, y)) + if col == "X": + ExitBlock((x, y)) + if col in ["T","B","L","R"]: + Connection((x, y), col) + x += 32 + y += 32 + x = 0 + + + def update(self, control=0): + """ update the model state""" + self.char.update(control) + + +class GameController(object): + """This is the controller for the game. It contains a counter for each + direction that controls animation state. + + attributes: model, li, di, ri, ui, room_counter""" + + def __init__(self, model, view): + """ initializes the model and counters""" + self.model = model + self.view = view + self.li = 0 + self.di = 0 + self.ri = 0 + self.ui = 0 + self.waking = 0 + self.room_counter = 0 + + def reset_state(self): + """clean slate for initial room generation, all subsequent resets""" + global timer + self.waking += 1 + if self.waking * random() > 2: + timer = True + self.model.room_map = self.model.start_map + self.model.generate_room(self.model.start_map) + self.view.background = 'images/room2.png' + self.model.char.walls = walls + self.model.char.x = 384 + self.model.char.y = 224 + self.room_counter = 0 + + self.model.char.image = self.model.char.walking_frames_d[1] + self.model.char.rect = self.model.char.image.get_rect().inflate(-4,-32) + self.model.char.rect.move_ip(self.model.char.x,self.model.char.y + 16) + + + def update(self): + """ Updates the game state based on keypresses. + Also animates walking ALL DIRECTIONS now""" + self.effect = pygame.mixer.Sound('sounds/Uboa_short.wav') + pressed = pygame.key.get_pressed() + if pressed[pygame.K_9]: + #This is the wake up function + self.reset_state() + + # move in directions + if pressed[pygame.K_LEFT]: + self.li = (self.li + 1) % 4 + self.model.char.move_left(self.li) + + if pressed[pygame.K_RIGHT]: + self.ri = (self.ri + 1) % 4 + self.model.char.move_right(self.ri) + + if pressed[pygame.K_UP]: + self.ui = (self.ui + 1) % 4 + self.model.char.move_up(self.ui) + + if pressed[pygame.K_DOWN]: + self.di = (self.di + 1) % 4 + self.model.char.move_down(self.di) + + #these functions check for collisions with interactive blocks + for exit_block in exit_blocks: + if self.model.char.rect.colliderect(exit_block): + print "You won't go out there." + self.effect.play() + time.sleep(0.50) + self.reset_state() + + for connection in connections: + if self.model.char.rect.colliderect(connection): + #maps directions from which you exit the old room to positions in + #the new room, so directional continuity + new_spaces = {"R":(40, 200), "L":(560,200), "B":(240,10), "T":(240, 380)} + new_space = new_spaces[connection.side] + self.model.char.x = new_space[0] + self.model.char.y = new_space[1] + + self.model.char.image = self.model.char.walking_frames_d[1] + self.model.char.rect = self.model.char.image.get_rect().inflate(-4,-32) + self.model.char.rect.move_ip(self.model.char.x,self.model.char.y + 16) + + # increments counter to gradually decrease likelihood of doors generating + self.room_counter += 1 + self.model.room_map = level.random_gen(self.room_counter) + self.model.generate_room(self.model.room_map) + self.view.build_surface(self.model.room_map) + self.view.background = 'currentroom.png' + self.model.char.walls = walls + + +class Wall(object): + """it walls + + attribute: rect""" + def __init__(self, pos): + walls.append(self) + self.rect = pygame.Rect(pos[0], pos[1], 32, 32) + + +class ExitBlock(object): + """It exits + + attribute: rect""" + def __init__(self, pos): + exit_blocks.append(self) + self.rect = pygame.Rect(pos[0], pos[1], 32, 32) + +class Connection(object): + """Links to a new room. Tracks which side of the room it is on. + + attribute: rect, side""" + + def __init__(self, pos, side): + connections.append(self) + self.side = side + self.rect = pygame.Rect(pos[0], pos[1], 32, 32) + self.rect.inflate_ip(2,2) + + +if __name__ == '__main__': + pygame.init() + size = (640, 480) # useful + # size = (320, 240) # 'native' + walls = [] # List to hold the walls + exit_blocks = [] # List to hold the exits + connections = [] # List to hold all connections + model = GameModel(size[0], size[1]) + view = GameView(model, size) + controller = GameController(model, view) + level = Level() + running = True + timer = False + countdown = 5 + while running: + for event in pygame.event.get(): + if event.type == QUIT: + running = False + model.update() + controller.update() + view.draw(view.background) + time.sleep(.05) + if timer == True: + countdown -= .05 + pygame.mixer.music.load('sounds/Uboa_long.wav') + if countdown < .25: + pygame.mixer.music.play(0) + size = (1920,1080) + pygame.display.set_mode(size) + uboa = pygame.image.load('images/UBOAAAAA.png') + uboa = pygame.transform.scale(uboa, size) + view.screen.blit(uboa,(0,0)) + pygame.display.update() + if countdown < 0: + running = False diff --git a/level.py b/level.py new file mode 100644 index 0000000..61a140b --- /dev/null +++ b/level.py @@ -0,0 +1,108 @@ +import pygame +from pygame.locals import * +from spritesheet_functions import SpriteSheet +import random + +class Level(object): + """This builds the level as a text mapping of the tiles + + attributes: None""" + def __init__(self, x=0): + self.x = x + + def choose(self,side): + res = '' + r = random.randint(0,100) + if r < self.threshold: + res += side + else: + res += 'W' + return res + + def random_gen(self,count): + #probably should take size + #15 strings of 20 characters + + #generate top wall + self.threshold = 13. - (count*1.5) + twall = '' + for x in range(20): + if x < 1 or x > 18: + twall+= 'W' + else: + twall += self.choose('T') + + #generate bottom wall + bwall = '' + for x in range(20): + if x < 1 or x > 18: + bwall += 'W' + else: + bwall += self.choose('B') + + #generate middle walls + middlewalls = [] + for x in range(13): + wall = '' + if x < 2 or x > 10: + wall += self.choose('L') + wall += '..................' + wall += self.choose('R') + + else: + wall += self.choose('L') + wall += '..' + for y in range(14): + wall += random.choice(['.','.','.','.','W']) + wall += '..' + wall += self.choose('R') + middlewalls.append(wall) + + walls = [] + walls.append(twall) + for wall in middlewalls: + walls.append(wall) + walls.append(bwall) + return walls + + +class WallSprite(pygame.sprite.Sprite): + """This is the class for all of the wall sprites + + attributes: image""" + def __init__(self): + super(WallSprite, self).__init__() + + sprite_sheet = SpriteSheet('images/tilesets/walls.png')#3 x 4 + horiz = [0, 32, 64] + vert= [0, 32, 64, 96] + self.image = sprite_sheet.get_image(random.choice(horiz),random.choice(vert),32,32) + + +class DoorSprite(pygame.sprite.Sprite): + """This is the class for all of the door sprites + + attributes: image""" + + def __init__(self): + super(DoorSprite, self).__init__() + + sprite_sheet = SpriteSheet('images/tilesets/doors.png')#4 x 1 + horiz = [0, 32, 64, 96] + vert= [0] + + self.image = sprite_sheet.get_image(random.choice(horiz),random.choice(vert),32,32) + + +class FloorSprite(pygame.sprite.Sprite): + """This is the class for all of the floor sprites + + attributes: image""" + def __init__(self): + super(FloorSprite, self).__init__() + + sprite_sheet = SpriteSheet('images/tilesets/floors.png')#7x6 + horiz = [0, 32, 64, 96, 128, 160, 192] + vert= [0, 32, 64, 96, 128, 160] + + self.image = sprite_sheet.get_image(random.choice(horiz),random.choice(vert),32,32) diff --git a/player.py b/player.py new file mode 100644 index 0000000..4c3e902 --- /dev/null +++ b/player.py @@ -0,0 +1,92 @@ +import pygame +from pygame.locals import * +from spritesheet_functions import SpriteSheet +class CharacterSprite(pygame.sprite.Sprite): + """Sprite representation of the character. + + attributes: x, y, walking_frames_l, walking_frames_r, walking_frames_u, + walking_frames_d, walls, step_size, direction, image, rect""" + def __init__(self, x_coor, y_coor, walls): + + super(CharacterSprite, self).__init__() + + self.x = x_coor + self.y = y_coor + self.step_size = 5 + self.walls = walls + + self.walking_frames_l = [] + self.walking_frames_r = [] + self.walking_frames_u = [] + self.walking_frames_d = [] + self.effect = pygame.mixer.Sound('sounds/step.wav') + + sprite_sheet = SpriteSheet('images/smallspritesheet.png') + for i in range(0,109, 36): + image = sprite_sheet.get_image(i,0,36, 60) + self.walking_frames_d.append(image) + for i in range(0,109, 36): + image = sprite_sheet.get_image(i,62,36, 60) + self.walking_frames_l.append(image) + for i in range(0,109, 36): + image = sprite_sheet.get_image(i,126,36, 60) + self.walking_frames_r.append(image) + for i in range(0,109, 36): + image = sprite_sheet.get_image(i,185,36, 70) + self.walking_frames_u.append(image) + + self.walking_frames_d[3] = self.walking_frames_d[1] + self.walking_frames_l[3] = (self.walking_frames_l[1]) + self.walking_frames_u[3] = (self.walking_frames_u[1]) + self.walking_frames_r[3] = (self.walking_frames_r[1]) + self.image = self.walking_frames_d[1] + self.rect = self.image.get_rect().inflate(-10,-32) + self.rect.move_ip(self.x,self.y + 16) + + def move_left(self, li): + self.x -= self.step_size + self.rect.move_ip(-self.step_size, 0) + + for wall in self.walls: + if self.rect.colliderect(wall.rect): + self.rect.left = wall.rect.right + self.x += self.step_size + + self.image = self.walking_frames_l[li] + self.effect.play() + + def move_right(self, ri): + self.x += self.step_size + self.rect.move_ip(self.step_size, 0) + + for wall in self.walls: + if self.rect.colliderect(wall.rect): + self.rect.right = wall.rect.left + self.x -= self.step_size + + self.image = self.walking_frames_r[ri] + self.effect.play() + + def move_up(self, ui): + self.y -= self.step_size + self.rect.move_ip(0, -self.step_size) + + for wall in self.walls: + if self.rect.colliderect(wall.rect): + self.rect.top = wall.rect.bottom + self.y += self.step_size + + self.image = self.walking_frames_u[ui] + self.effect.play() + + def move_down(self, di): + self.y += self.step_size + self.rect.move_ip(0, self.step_size) + + for wall in self.walls: + if self.rect.colliderect(wall.rect): + self.rect.bottom = wall.rect.top + self.y -= self.step_size + + self.image = self.walking_frames_d[di] + self.effect.play() diff --git a/sounds/TheDarkLake.mp3 b/sounds/TheDarkLake.mp3 new file mode 100644 index 0000000..3b2c624 Binary files /dev/null and b/sounds/TheDarkLake.mp3 differ diff --git a/sounds/Uboa_long.ogg b/sounds/Uboa_long.ogg new file mode 100644 index 0000000..5b297a4 Binary files /dev/null and b/sounds/Uboa_long.ogg differ diff --git a/sounds/Uboa_long.wav b/sounds/Uboa_long.wav new file mode 100644 index 0000000..3f6c0d3 Binary files /dev/null and b/sounds/Uboa_long.wav differ diff --git a/sounds/Uboa_short.wav b/sounds/Uboa_short.wav new file mode 100644 index 0000000..fcd26a8 Binary files /dev/null and b/sounds/Uboa_short.wav differ diff --git a/sounds/step.wav b/sounds/step.wav new file mode 100644 index 0000000..2531229 Binary files /dev/null and b/sounds/step.wav differ diff --git a/spritesheet_functions.py b/spritesheet_functions.py new file mode 100644 index 0000000..c774ac4 --- /dev/null +++ b/spritesheet_functions.py @@ -0,0 +1,19 @@ +import pygame + +class SpriteSheet(object): + """Class used to grab images out of a sprite sheet. + + attributes: sprite_sheet""" + def __init__(self, file_name= 'images/smallspritesheet.png'): + self.sprite_sheet = pygame.image.load(file_name) + def get_image(self, x, y, width, height): + """grab an image out of the spritesheet""" + image = pygame.Surface([width, height]) + + image.blit(self.sprite_sheet, (0,0), (x, y, width, height)) + + image.set_colorkey((0,0,0)) + + return image + +