Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Deliverable 3

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Deliverable 3

Avatar for abchiaravalle

abchiaravalle

March 06, 2018

Other Decks in Technology

Transcript

  1. Recap — Simple 2D platformer game — Pixel art —

    Built in Unity with C# Adam Chiaravalle
  2. Interaction Model Description — The player interacts with the video

    game by input. The player uses the keyboard to provide the input to the system. The system uses the input to determine which script to perform. Then the system compiles the code if necessary. Finally, the system sends the compiled code to the display to show the user the output. Gabrielle Hubble
  3. (1/4) New Game — Primary Actor: Player — Goal: Starting

    a new game — Preconditions: 1. Game is supported by the operating system 2. The game is launched and running — Triggers: The player selects start new game — Scenario: 1. Player is at the main menu 2. Player selects start new game 3. System loads new game — Exception: New game was paused when loading — Priority: Has to be implemented — When Available: Second round of coding Gabrielle Hubble
  4. (2/4) Select Level — Primary Actor: Player — Goal: The

    selected level plays — Preconditions: 1. Selected level is unlocked 2. Game recorded the previous unlocked levels — Triggers: Load the level — Scenario: 1. Player goes to main menu 2. Player selects the level 3. Level starts — Exception: Level doesn’t load — Priority: Extra feature, not a priority — When Available: third round of coding Gabrielle Hubble
  5. (3/4) Resumes Game — Primary Actor: Player — Goal: Player

    resumes the game from the previous time playing it — Preconditions: 1. Game was previously played 2. Game recorded last checkpoint 3. User saved last checkpoint — Triggers: Resuming the game Scenario: 1. Player is at the main menu 2. Player selects resume game 3. The game is loaded — Exception: Level doesn’t load — Priority: Somewhat important, should be implemented — When Available: third round of coding Gabrielle Hubble
  6. (4/4) Exits Game — Primary Actor: Player — Goal: Player

    leaves the game — Preconditions: Player is currently playing the game — Triggers: Exiting the game — Scenario: 1. Player pauses game 2. Player returns to menu 3. Game saves the current state of game 4. Player exits the game — Exception: Player isn’t playing the game — Priority: Has to be implemented — When Available: second round of coding Gabrielle Hubble
  7. (1/3) View Score — Primary Actors: Player — Goal: View

    the scoreboard — Precondition: 1. Game system is on 2. Game keeps score 3. Player logins 4. Player views score — Trigger: Player viewing score — Scenario: 1. Player goes to main menu 2. Player chooses view scoreboard option 3. Game shows the scores — Exception: There are no scores entered yet — Priority: Extra Feature — When Available: third round of coding Gabrielle Hubble
  8. (2/3) Changes Score — Primary Actors: Player — Goal: Player

    achieves new score — Precondition: 1. Game is running on system 2. Game has a scoreboard 3. Player has an old score — Trigger: Player achieves new score — Scenario: 1. Player goes to main menu 2. Player plays game 3. Player achieves new score 4. Player enters new score — Exception: No previous score — Priority: Extra feature — When Available: third round of coding Gabrielle Hubble
  9. (3/3) Achieves Score — Primary Actors: Player — Goal: Player

    achieves a score — Precondition: 1. System is running game 2. Player is playing game 3. Player does well enough to achieve a score — Trigger: Player gets a score — Scenario: 1. Player goes to main menu 2. Player starts game 3. Player does well in game 4. Player achieves a score — Exception: Player does not do well enough to get a score — Priority: Extra Feature — When Available: third round of coding Gabrielle Hubble
  10. Layered architecture design. — Layer 1 starts with user input

    and controls. — Layer 2 is where the game system receives the user input and authorizes the user — Layer 3: the game design will simulate for the user to see. This allows the functionality of the game to begin. — Layer 4: The user’s input will start showing the way the application functions. — Layer 5: In addition, the 2D graphics of the game will appear. — Layer 6:The coding is underlying these aspects. The code allows for the above layers to function correctly. — Layer 7: Lastly, the operating system is how the game can run. Gabrielle Hubble
  11. Design Pa!erns Used (23 GoF Pa!erns) — State Pa!ern: In

    the State pattern, we create objects which represent various states and a context object whose behavior varies as its state object changes. — Problem application: This pattern is useful when applied to state changes made within the player in the game environment. We used similar logic when working on the moving platform object. Nicholas Haymore
  12. Code Reuse: APIs from Unity Examples — MonoBehaviour: https:// docs.unity3d.com/ScriptReference/

    MonoBehaviour.html — Transform: https://docs.unity3d.com/ ScriptReference/Transform.html — Rigidbody2D: https://docs.unity3d.com/ ScriptReference/Rigidbody2D.html Nicholas Haymore
  13. Code Reuse Levels abstract, object, component, system level We are

    mostly reusing code on an object level. Unity already has coding libraries for everything that we need, however we still need to code the logic for the actual methods. Nicholas Haymore
  14. Implementation Host & Target Platforms — Unity for Development —

    Cross Platform Editor and Targeting — WebGL, Android, iOS, Windows, Mac, Linux, PS4 — Development environment and target environment become irrelevant as Unity abstracts them away Adam Chiaravalle
  15. Details of IDE and Package Management System — C#, and

    MonoDevelop (code completion for Unity libraries in C#) — Scripts written in one language and then can be used in cross-platform players Adam Chiaravalle
  16. IDE, Deployment, Architecture — Unity Engine and underlying components are

    written in C and C++1 (Editor is mostly C#) — C Libraries (Unity libraries, etc.) are compiled and then become accessible from a higher level language like C# — C# classes that can access this underlying C code are called "wrappers" — Allows for native performance Adam Chiaravalle 1 Sometimes I Code
  17. More IDE Architecture — IL2CPP is also used more recently

    for Unity (Intermediate Language to C++)2 — For compatible platforms, this becomes available as a build option as alternative to running code on traditional Mono VM platform — Converts C# to C++ for a 2x-3x performance boost — Has become only option for iOS and WebGL (our demo today) Adam Chiaravalle 2 Unity Manual - IL2CPP
  18. Code Snippet for MovingPlatform.cs void Update () { platform.transform.position =

    Vector3.MoveTowards (platform.transform.position, currentPoint.position, Time.deltaTime * moveSpeed); if (platform.transform.position == currentPoint.position) { pointSelection++; if (pointSelection == points.Length) { pointSelection = 0; } currentPoint = points [pointSelection]; } } Nicholas Haymore