# Changeset 519

Ignore:
Timestamp:
04/17/12 03:29:14 (3 years ago)
Message:

optimized rendering; fixed bug with alerts; lots of tweaks with hover events

Files:
1 deleted
18 edited

Unmodified
Removed
• ## .pydevproject

 r513 /mt /mt/src /mt/dim /cs121sp2012_5 /cs121sp2012_5/src /cs121sp2012_5/dim python 2.7
• ## design/testing/test_plans.tex

 r518 EC & 4/16/12 & 12:00 AM & Updated test for \hypl{state:check}{\tc{blue}{Check Thresholds}} with new space requirements & Passed \\ \hline JE & 4/17/12 & 1:00 AM & Rerunning regression test for \hypl{top:save}{\tc{blue}{Save and Load}} to ensure confirmation message works with new alert design & Failed, see \hypl{bug:saveloadalert}{\tc{blue}{save and load alert bug}}\\ \hline \end{longtable} \end{center} ID & Date & Time & Description & Context \\ \hline \hypt{bug:negres}{JE} & 3/23/12 & 4:00 PM & State erroneously allows more research to be performed than the current money, resulting in negative money. Moreover, it allows for negative research to be performed, which would provide a way to generated money. & This bug was found on the alpha release. It was found by running the Python unit test $$\verb+test_research()+$$ in the class$$\verb+/src/tests/test_state+$$ The assertion failures catch and describe the bug with a specified message.\\ \hline \hypt{bug:button}{JE} & 3/26/12 & 11:00 PM & The right arrow button on the map display disappears & This bug was found on the March 26 prototype release. It was found by launching the game, then New Game $\rightarrow$ Build $\rightarrow$ Power $\rightarrow$ Windmill $\rightarrow$ Buy $\rightarrow$ End Turn. Then click on the icon of the windmill on the map and the right button disappears. Notice, however, that it disappears only for that block (which you can tell by selecting the icon of any of the other blocks)\\ \hypt{bug:negres}{JE} & 3/23/12 & 4:00 PM & State erroneously allows more research to be performed than the current money, resulting in negative money. Moreover, it allows for negative research to be performed, which would provide a way to generated money.\newline \textbf{Update}: Bug has been corrected -- JE, 4/16/12 & This bug was found on the alpha release. It was found by running the Python unit test $$\verb+test_research()+$$ in the class$$\verb+/src/tests/test_state+$$ The assertion failures catch and describe the bug with a specified message.\\ \hline \hypt{bug:button}{JE} & 3/26/12 & 11:00 PM & The right arrow button on the map display disappears \newline\textbf{Update}: Bug has been corrected -- JE, 4/16/12 & This bug was found on the March 26 prototype release. It was found by launching the game, then New Game $\rightarrow$ Build $\rightarrow$ Power $\rightarrow$ Windmill $\rightarrow$ Buy $\rightarrow$ End Turn. Then click on the icon of the windmill on the map and the right button disappears. Notice, however, that it disappears only for that block (which you can tell by selecting the icon of any of the other blocks)\\ \hline \hypt{bug:loadFalse}{EC} & 4/02/12 & 11:30 PM & The game just creates a new game and starts there without providing an alert that the user was unable to load or giving the user a second opportunity to load a game. & This bug was found by attempting to load a game that does not exist, i.e., one that was not previously saved.\\ \hypt{bug:refreshBlock}{EC} & 4/02/12 & 11:30 PM & The map blocks do not reset to block 0 or whatever the correct block is for the saved game.  & This bug was found by starting a new game or loading a previously saved game after beginning progress on a new game and switching blocks.  The block that was open in the new game is the same which is open after these actions are preformed.  However, the menus are reset and any open ones are closed upon either of these actions. \\ \hline \hypt{bug:skipinto}{JE} & 4/03/12 & 1:00 AM & The introduction scene can be skipped by starting a new game, going back and then resuming. Essentially, the scene can be truncated since resuming does not take the progression of the scene into consideration. & This bug was found in the most recent release of the game by doing: New Game $\rightarrow$ [Left arrow] $\rightarrow$ Resume. This will bring the player to the main screen, thereby skipping the remainder of the introduction scene.\\ \hypt{bug:skipinto}{JE} & 4/03/12 & 1:00 AM & The introduction scene can be skipped by starting a new game, going back and then resuming. Essentially, the scene can be truncated since resuming does not take the progression of the scene into consideration.\newline \textbf{Update}: Bug has been corrected -- JE, 4/16/12 & This bug was found in the most recent release of the game by doing: New Game $\rightarrow$ [Left arrow] $\rightarrow$ Resume. This will bring the player to the main screen, thereby skipping the remainder of the introduction scene.\\ \hline \hypt{bug:outOfMemory}{EC} & 4/09/12 & 11:00 PM & The game runs out of memory by building one object and then continuously clicking end turn. & This bug was found in the April 10 Prototype by clicking New Game $\rightarrow$ Clicking through intro $\rightarrow$ Clicking through tutorial $\rightarrow$ End Turn (many times quickly).  Pygame crashes with error message Pygame.error Out of Memory.  Repeating this also gives various chains of updates where it crashes with the same error. \\ \hline \hypt{bug:skipTutorial}{EC} & 4/09/12 & 11:00 PM & The tutorial can be skipped by using the left or right arrow keys to switch map blocks. & The bug was found in the April 10 Prototype by clicking New Game $\rightarrow$ Clicking through intro $\rightarrow$ [Left arrow] or [Right arrow].  This will bring the player to the main screen, skipping the entire tutorial.\\ \hypt{bug:skipTutorial}{EC} & 4/09/12 & 11:00 PM & The tutorial can be skipped by using the left or right arrow keys to switch map blocks. \newline \textbf{Update}: Bug has been corrected -- JE, 4/16/12 & The bug was found in the April 10 Prototype by clicking New Game $\rightarrow$ Clicking through intro $\rightarrow$ [Left arrow] or [Right arrow].  This will bring the player to the main screen, skipping the entire tutorial.\\ \hline \hypt{bug:emptyMenuPage}{RT} & 4/16/12 & 4:00 PM & If the number of buildings in a build category is an even multiple of the page size there will be an extra blank page at the end. & The bug was found in the April 17th prototype by clicking [Right arrow]  $\rightarrow$ [Right arrow] in the vehicles menu with a page size of 2.\\ \hline \hypl{bug:saveloadalert}{JE} & 4/17/12 & 1:00 AM & Save and load confirmation windows only work by clicking any \emph{except} the confirmation button; response must be improperly tied to the window itself, rather than its button & In pre-beta release, Main Menu $\rightarrow$ Save $\rightarrow$ [any input] $\rightarrow$ Save $\rightarrow$ OK\\ \hline \end{longtable}

 r511 """ def __init__(self, pos, visible, message, yesResponse=None, yesText="Ok"): def __init__(self, pos, visible, message, yesResponses=None, yesText="Ok"): """ Initializes object. input type: (int int)(pos) bool(visible) str(message) function(yesResponse) str(yesText) FAKEBLACK, DIM.MSG_WIDTH)) if yesResponse is not None: if yesResponses is not None: yesButton = SimpleButton((self.pos[0] + self.pos[1] + 150 - 30), self.visible, yesText, True) yesButton.addResponse(yesResponse) for response in yesResponses: yesButton.addResponse(response) yesButton.addResponse((self.closeWindow,)) self.subwindows.append(yesButton) """ adds the function to call when the affirmative button is pressed. input type: function(response) return type: none """ opens the window and subwindows. input type: none return type: none runs default windows response and then returns true. This ensures that no other windows will respond. input type: pygame.event(e) return type: bool """ Allows the update function to be redefined. input type: function(updateFunc) return type: none """ updates the window and all subwindows. input type: state(state) return type: none
• ## src/alien.py

 r511 The alien class creates random aliens on blocks. """ def __init__(self, pos, visible, blockNum, alienArt, message=None): """ self.subwindows.append(responseAlert) self.hoverDescription = HoverDescription('Click to talk!') def hover(self,surface): """ Define the hover window for the object, by default none. input type: None return type: None
• ## src/background.py

 r511 @author: TechTrek ''' import pygame from window import Window Background is an image that does not interact with the user. """ def __init__(self, pos, visible, image, doRestore=False): """

• ## src/dim/hoverDescriptionDim.py

 r495 POS = (680, 500) POS = (680, 660)
• ## src/globals.py

 r490 # 5 == NONE DEBUG = 5 NO_HOVER = -1
• ## src/hoverDescription.py

 r512 from window import Window from rectangle import Rectangle from text import Text from image import Image from dim import hoverDescriptionDim as DIM import dimensions from globals import * The general hover description for other buttons. """ def __init__(self, text): """ initializes the hover description. input type: str(text) return type: none Window.__init__(self, DIM.POS, True) self.images.append(Image(DIM.POS, 400, 60, buttonDir + "info_background")) self.images.append(Image(DIM.POS, 400, 80, buttonDir + "info_background")) self.text.append(Text((DIM.POS[0] + 5, DIM.POS[1] + 5), text, XSM_TEXT, WHITE, width=380)) text, SM_TEXT, WHITE, width=380)) def render(self, surface): if surface is not None: self.resize(dimensions.SCREEN_W / float(ORIG_SCREEN_W), dimensions.SCREEN_H / float(ORIG_SCREEN_H)) Window.render(self, surface)
• ## src/image.py

 r508 raw_image = pygame.image.load(os.path.join(imagePath + imgExt)) imageLUT[imagePath] = raw_image self.image = pygame.transform.smoothscale(raw_image, (width, height)) self.pos = (self.left, self.top) = pos
• ## src/lang.py

 r509 """ Helper function for language analysis input type: [str(items)] return type: str(output)
• ## src/leftRight.py

 r509 self.images.append(Image(self.pos, ARROW_SIZE, ARROW_SIZE, icon))
• ## src/main.py

 r513 output type: none """ print "Main menu updating" self.buildWindow() Window.update(self, state)
• ## src/mapBuilding.py

 r513 deleteAlert = Alert((300, 200), False, message, (deleteResponse, self.blockNum, self.buildingSlot), [(deleteResponse, self.blockNum, self.buildingSlot)], "Delete")

• ## src/window.py

 r500 """ initializes a window input type: int((x, y)), bool(visible), bool(stayBack) """ if window.isVisible(): returnValue = window.event(e) if returnValue != False: if returnValue is not False: if not window.stayBack: self.subwindows.remove(window) """ call response functions that had been designated to window input type: none return type: none for r in self.rectangles: r.resize(xScale, yScale) for i in self.images: i.resize(xScale, yScale) for t in self.text: t.resize(xScale, yScale) self.subwindows.pop(i) def hover(self,surface): def hover(self, surface): """ returns the hover description to display, by default none. return type: None """ return None return NO_HOVER
Note: See TracChangeset for help on using the changeset viewer.