mcoombs32 / edu.ycp.cs481.YCPGames

YCP Games app for android devices.
0 stars 2 forks source link

Mike Coombs Weekly Journal #21

Closed mcoombs32 closed 10 years ago

mcoombs32 commented 11 years ago

I got the GUI up and running, creating the various touch buttons and establishing clickListeners() to interact with the data model. I also added an mUpdate method to change the button's drawn image and notify the users when the game is over.

mcoombs32 commented 11 years ago

https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/40b275663bde2fa20111f9272d341f490d202dae https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/4ff26ac5fa9e80df41889aa60c761a98ee29a27f https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/569b004bf915a9b21e2958de1e7275965a15c4d7 https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/8b85cdb459ede70da2efab91b42696489a06b782 https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/d076378bd96a6b20ca6c658785e9e4e46b10168d https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/342ce6cd7a4c2cb37393fb88a9aae5955c6317e0 https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/4c9ae2fef1e70221f12dde7784771e99738f9517 https://github.com/mcoombs32/edu.ycp.cs481.YCPGames/commit/4b667f71f0a5c1d78afd829352632a9cb49b7339

Relevant commits

mcoombs32 commented 10 years ago

10/27 I further improved the TicTacToe GUI this week, adding code to force the activity to use the full screen (app no longer shows notification bar/android buttons on each tap) as well as fixed it so the app would remain in portrait mode, but rotate if the devices was detected to be upside down. I also originally had the app display Toast notifications when the game was over, but now uses an AlertDialog to inform the user of the game ending, as well as giving the option to exit to the menu, or replay the game. Relevant Commits: 8318325b6104aab4e7b3e12144551114a79a7bd3 e2e6ebb929581c009874603af986b264510a1c15 fe7bdd483dee8d50aa17c50c2111f6e17a3079b0 28f19445d8b8aa42954b4a5655881758d8516cbd

Brian and I also fixed the build errors he was having which were caused by files not being added to the repo. We used the debug code I added in commits 55b729dfe2188a3f2cd52ffc10b87ed063d296c3 and 1d0a2a2d41bba2784725d498037838e457a2093f to figure out that the grid object was being redeclared in one of our classes, which was fixed in commit d17ac4546505fe10fd70ce0d22726c3143a7638a

Finally, I merged the TickTacToe_Backend branch into the master branch, as most of our work is completed for TicTacToe. f829efb9ff633bd6a4bbef65c05308cccef8ea76

mcoombs32 commented 10 years ago

11/4 I created and started work on a DotsActivity to connect to the backend that @brianmichaelmartin was setting up this week. fb71dd2d50838cd71da5de0ecda6abdd563b5900 I started to research the best way to handle the user input for this style of game. I decided on using a SurfaceView Component to draw on. I created an overlay for the SurfaceView that divides the screen into a grid, with the number of cells retrieved from the app's Settings. It gets the device's screen size in pixels, then passes that to DotsGrid which contains an array of DotsGridCells. DotsGrid then initializes these cells, which contain fields for cell length, width, x and y points (upper left), x1 and y1 points (bottom right) and a center point for that cell(commit 0e07b56638bc5c1ddbd7774048307da5b6d32f80). The SurfaceView will use this to draw a circle at the center point for each cell's relative location on the screen, and will translate the backend array that contains the current game state into something drawable.

I also fixed the bugs we were having in the TicTacToeActivity that were causing a delay in registering touch events, as well as fixed the code for the game over popup window that would appear if the player selected an invalid move. (commit 6716b9baf4b65b7b61954b1ef57b6b37ed806bc7)

mcoombs32 commented 10 years ago

11/11 This week was mostly devoted to the DotsGUI. I continued working on DotsGrid to use as an overlay for the surface view, as shown in commits 0e07b56638bc5c1ddbd7774048307da5b6d32f80 and c671475d00664918418f052979235fac3127b597. I got the SurfaceView to draw successfully, using a separate thread to call onDraw, which handles all of the actual drawing to the canvas. I got the user input working, the score display to draw properly, and I implemented error checking for valid moves on the GUI side. There's an issue with the backend that @brianmichaelmartin and I need to take a look at, having to do with how the nodes in the backend grid for DotsBoard are aliased. 2661a9ad2268d97ccc59a6255c6eb57f48005fef has all of the user interaction code.

mcoombs32 commented 10 years ago

11/18 This week, Brian and I worked to fix some of the bugs we had with the draw code, the scoring, and the aliasing for the backend grid. As shown in commits 15504d8fe2afb50201b422a41d56cfab9380ab9c and 75d4f6395ff1e4e986b7f35f7ce2c842b3c38d6d, we used Dr. Hovemeyer's suggestion to create a DotsLine object to handle assigning a reference between aliased lines. We also fixed the update code so that the score updates properly, as well as drawing the correct lines where they should be.

mcoombs32 commented 10 years ago

11/25 This week I refined the Draw code to work better with dots (0c32cbfecfed3d79a5b4c59c021d44f74f4ed474 and f274dea255436185345264fe8c47b33f7f61383f). There was a bug causing the dots to be drawn differently on the emulator and on my device, which i managed to rectify. I also started working on a Settings menu, but had a little trouble because the main way to do that in Android is depreciated since v3.0, so I reverted it SettingsActivity to a blank activity so i can use more modern techniques. I also made sure Tic Tac Toe works with both multiplayer and single player, changed some game code up for the user prompt and touch interactions, based on what game mode they are in (91bc16e5ec34b0ec279f29c1a5d544e8c4c9e967) and fixed the bug that caused. I also found a decent bug in the DotsAI when testing for single player (4539663c42bcae89819fb5b1f70c3f4e8ef7b8f9)