User Tools

Site Tools


milestone_5

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

milestone_5 [2023/01/16 22:04]
scott [Milestone 5]
milestone_5 [2023/03/27 10:30] (current)
scott [Code Submission]
Line 12: Line 12:
  
 ==== Source Code ==== ==== Source Code ====
 +Note that the following files are provided in your ecen390 project directory. Refer to the comments above each function for more detail.
  
-The file ''​runningModes2.c''​ is provided as a place for you to write your game-play codeFeel free to copy code in ''​runningModes.c''​ to jump start your implementation of game-play modeHowever, you will be responsible for making sure any "​copied"​ code still meets the coding standard.+  * lasertag/​main.c 
 +  * lasertag/game.
 +  * lasertag/​sound/​sound.h 
 +  * lasertag/​sound/​sound.c 
 +  * lasertag/​support/​runningModes.
 +  * lasertag/​support/​runningModes.c
  
-[[https://​github.com/​byu-cpe/​ecen330_student/​blob/​master/​lasertag/​runningModes.h|runningModes.h]]+You are expected to create and implement the following fileSee the provided header file (.h) for more detail.
  
-[[https://​github.com/​byu-cpe/​ecen330_student/​blob/​master/​lasertag/runningModes.c|runningModes.c]]+  * lasertag/game.c
  
-[[https://​github.com/​byu-cpe/​ecen330_student/​blob/​master/​lasertag/​runningModes2.c|runningModes2.c]]+----
  
-==== Sound Code and Sound Data ====+==== Making ​Sound ====
  
-You are provided working sound code and sound data. All sound data are contained ​in the sounds ​subdirectory ​of the lasertag directory. While coding this milestone, you need to add calls to the sound functions so that sounds are correctly activated ​during game play.+You are provided working sound code and sound data in the sound subdirectory. While coding this milestone, you need to add calls to these sound functions so that various ​sounds are made during game play.
  
-Please read the comments and the function ​sound_runTest() function in [[https://​github.com/​byu-cpe/​ecen330_student/​blob/​master/​lasertag/​sound.c#​L281|sound.c]] to see how to use the sound code (it is straightforward). ​+Please read the comments and the sound_runTest() function in sound.c to see how to use the sound code (it is straightforward). ​
  
-//Note: Make sure to add ''​sound_tick()''​ to isr_function() along with all of the ''​_tick()''​ functions.//​+//Note: Make sure to add ''​sound_tick()''​ to isr_function() along with all of the other ''​_tick()''​ functions.//​
  
-WARNING!!! WHEN SET TO ITS MAXIMUM VALUE, THE SOUND VOLUME MAY DAMAGE YOUR HEARING IF YOU PLUG EARPHONES INTO THE ZYBO BOARD. THE INSTRUCTOR STRONGLY RECOMMENDS USING THE ATTACHED SPEAKER WITH VOLUME SET TO ITS LOWEST SETTING WHEN IMPLEMENTING YOUR GAME. Volume can be controlled by using the function '​sound_setVolume()',​ found in the sound.c file. Please read sound.c for more detail on how to use this function.+WARNING!!! WHEN SET TO ITS MAXIMUM VALUE, THE SOUND VOLUME MAY DAMAGE YOUR HEARING IF YOU PLUG EARPHONES INTO THE ZYBO BOARD. Volume can be controlled by using the function '​sound_setVolume()',​ found in the sound.c file. Please read sound.c for more detail on how to use this function.
  
-==== Videos ​====+=== Videos ===
  
 These videos demonstrate when sounds should be played and also show more detailed behavior of the game. These videos demonstrate when sounds should be played and also show more detailed behavior of the game.
Line 75: Line 81:
   - A voice will inform a player when they must drop from the game and "​return to base." This voice sound will be infinitely repeated, alternated with 1 second of silence. ​   - A voice will inform a player when they must drop from the game and "​return to base." This voice sound will be infinitely repeated, alternated with 1 second of silence. ​
  
-These videos demonstrate when sounds should be played and also show more detailed behavior ​of the game. +---- 
-  [[https://youtu.be/klppe7oTng4|Sounds related ​to the gun, how the clip works, reloading, etc.]] + 
-  ​- [[https://youtu.be/IDhDzBggeeo|Sounds made when hit by an opponent.]] +===== Implementation Details ===== 
-  ​- [[https://youtu.be/TV2oLZurPTU|Sounds that occur at the end of the game.]]+ 
 +==== Game Code Sketch ==== 
 +A sketch is given below as a starting point for an implementation ​of game.c. You will need to finish ​the implementation. 
 + 
 +Feel free to copy code in ''​runningModes.c''​ to jump start your implementation of game-play mode. However, you will be responsible for making sure any "​copied"​ code still meets the coding standard
 + 
 +<file C game.c>​ 
 +/* 
 +The code in runningModes.c can be an example for implementing the game here. 
 +*/ 
 + 
 +#include <​stdio.h>​ 
 + 
 +#include "​hitLedTimer.h"​ 
 +#include "​interrupts.h"​ 
 +#include "​runningModes.h"​ 
 + 
 +// This game supports two teams, Team-A and Team-B. 
 +// Each team operates on its own configurable frequency. 
 +// Each player has a fixed set of lives and once they 
 +// have expended all lives, operation ceases and they are told 
 +// to return to base to await the ultimate end of the game. 
 +// The gun is clip-based and each clip contains a fixed number of shots 
 +// that takes a short time to reload a new clip. 
 +// The clips are automatically loaded. 
 +// Runs until BTN3 is pressed. 
 +void game_twoTeamTag(void) { 
 +  uint16_t hitCount = 0; 
 +  runningModes_initAll();​ 
 + 
 +  // Configuration... 
 + 
 +  ​// Implement game loop... 
 + 
 +  // End game loop... 
 +  interrupts_disableArmInts(); ​// Done with game loop, disable ​the interrupts. 
 +  hitLedTimer_turnLedOff(); ​   // Save power :-) 
 +  runningModes_printRunTimeStatistics();​ // Print the run-time statistics. 
 +
 +</​file>​
  
 ---- ----
Line 102: Line 147:
 ===== Code Submission ===== ===== Code Submission =====
  
-Assuming you added your code to runningModes2.c,​ you will use ''​./​check_and_zip.py 390m5''​ to prepare your zip file for submission to Learning Suite. It will be checked for adherence to the [[http://​byu-cpe.github.io/​ecen330/​other/​coding-standard/​|coding standard]].+You will use ''​./​check_and_zip.py 390m5''​ to prepare your zip file for submission to Learning Suite. It will be checked for adherence to the [[http://​byu-cpe.github.io/​ecen330/​other/​coding-standard/​|coding standard]].
  
milestone_5.1673931860.txt.gz · Last modified: 2023/01/16 22:04 by scott