DIGITAL INNOVATION
  • Pathway
    • Week 1 - Define your project
    • Week 2 - Construct your timeline
    • Week 3 - Relevant Implications
    • Github Setup
    • Award Information
  • Develop a Design
    • Design Overview
    • Year 12 >
      • Conventions and Design - Yr12
      • AS91891 - Design Assessment
    • Year 13 >
      • User Experience Methodologies - Yr13
      • AS91891 - Design Assessment
  • Develop an Outcome
    • Outcome Development
    • Year 12 >
      • Advanced Processes
      • AS91897 - Develop an Advanced Outcome
    • Year 13 >
      • Complex Techniques
      • AS91907 - Develop an Outcome using complex tools
  • Media Outcome
    • Create a Digital Media Outcome
    • Year 12 >
      • Advanced Techniques
      • AS91893 - Media Outcome Advanced Techniques
    • Year 13 >
      • Complex Techniques
      • AS91903 Media Outcome - Complex Techniques
  • Programming
    • Basics
    • Year 12 >
      • Advanced Programming Techniques
      • AS91896 - Advanced Programming
    • Year 13 >
      • Complex Programming Techniques
      • AS91906 - Complex Programming
  • Electronics
    • Basics
    • Year 12 >
      • Advanced Techniques
      • AS91894 - Advanced Electronics
  • Externals
    • 12 Summary
    • 13 Reflective Summary
    • 12 Optional - Computer Science
    • 13 Optional - Computer Science
  • Freyberg Digital

Complex Coding Techniques

Introduction

The Year 13 Programming assessment requires that you also include 2 complex techniques.
You only need to pick two techniques from this list:
● programming or writing code for a graphical user interface (GUI)
● reading from, or writing to, files or other persistent storage
● object-oriented programming using class(es) and objects defined by the student
● using types defined by the student
● using third party or non-core API, library or framework
​● using complex data structures (e.g. stacks, queues, trees). 

Writing code for a graphical user interface

In year 12 you are required to create a program that Responds to events in a graphical user interface.

This means that the buttons etc already exist and you are writing code that responds lets say to a user clicking a button.

In year 13 the GUI has to be programmed. When writing a video game you will be doing this by default. If you for example program health to appear and disappear then you will be meeting this criteria.
Picture

Reading and/or writing to persistent storage.

In order to meet this complex technique, you would need to write to persistent storage or read from persistent storage.

There are two places when making a game where this would be easiest:

a.) Writing a save file, that saves your game
b.) Creating a Config file to save the settings for the game. i.e. A user adjusts the volume to 70%, next time it loads the volume gets set to 70%.


Why is this important?

To help improve the quality of the experience the user should be able to set settings to ensure a consistent experience.

If you were doing an electronics project, you might have to use an EPRAM module to store data.
Picture
Picture

Object orientated programming using classes and objects.

In year 12 you are required to use multidimensional lists. Which often means using objects within an array.

​This year you may wish to use classes and objects. A good breakdown in unity is found here:

https://www.studica.com/blog/unity-tutorial-classes/

Here is an example of a player class in unity. Please note you cannot use the default classes created by unity, but have to have user defined ones.
​public class Player
{
    // Properties of the Player
    public string Name { get; private set; }
    public int Health { get; private set; }
    public int Score { get; private set; }

    // Constructor to initialize a new Player object
    public Player(string name, int health)
    {
        Name = name;
        Health = health;
        Score = 0; // Start with a score of 0
    }

    // Method to deal damage to the player
    public void TakeDamage(int damage)
    {
        Health -= damage;
        Health = Mathf.Max(Health, 0); // Ensure health doesn't go below 0
        Debug.Log($"{Name} took {damage} damage. Remaining health: {Health}");
    }

    // Method to add score
    public void AddScore(int points)
    {
        Score += points;
        Debug.Log($"{Name} gained {points} points. Total score: {Score}");
    }

    // Method to check if the player is alive
    public bool IsAlive()
    {
        return Health > 0;
    }
}

public class PlayerManager : MonoBehaviour
{
    void Start()
    {
        // Create a new player
        Player player = new Player("Hero", 100);

        // Display player's status
        Debug.Log($"Player {player.Name} created with {player.Health} health.");

        // Simulate gameplay
        player.TakeDamage(30);
        player.AddScore(50);
        player.TakeDamage(80);

        // Check if the player is alive
        if (!player.IsAlive())
        {
            Debug.Log($"{player.Name} has been defeated.");
        }
    }
}
Picture
Picture

Defining and using your own types.

When creating a game you may have use for creating your own types.

This is so we can define enemies/weapons/players with types so we can give them certain stats.

A complex technique is to create your own types.
public class Weapon
{
    public string Name;          // Name of the weapon
    public int Damage;           // Damage dealt by the weapon
    public float Range;          // Range of the weapon
    public WeaponType Type;      // Type of the weapon (using an enum)

    // Constructor to initialize a weapon
    public Weapon(string name, int damage, float range, WeaponType type)
    {
        Name = name;
        Damage = damage;
        Range = range;
        Type = type;
    }
​
public enum WeaponType
{
    Melee,
    Ranged,
    Magic
}

Picture
Picture

Using Third Party or Non-Core API's, Library or Frameworks

People often make code libraries to make their games work better.

They then sell or make these libraries available.

Using or downloading third party(non unity) API's/Libraries or frame works is considered a complex tool.
Picture

Complex Data Structures

A complex data structure is a type of data structure that combines multiple elements or data types into a single unit, allowing for more sophisticated data organization.

An example would be a Dictionary of Lists as a complex data structure in Unity to organize inventory items in a game. This allows you to categorize items (e.g., Weapons, Potions, etc.) and store multiple items under each category.

Example:
Category: Weapons
  Item: Sword, Quantity: 1
  Item: Bow, Quantity: 2
Category: Potions
  Item: Health Potion, Quantity: 5
  Item: Mana Potion, Quantity: 3

You can

​
Picture
Powered by Create your own unique website with customizable templates.
  • Pathway
    • Week 1 - Define your project
    • Week 2 - Construct your timeline
    • Week 3 - Relevant Implications
    • Github Setup
    • Award Information
  • Develop a Design
    • Design Overview
    • Year 12 >
      • Conventions and Design - Yr12
      • AS91891 - Design Assessment
    • Year 13 >
      • User Experience Methodologies - Yr13
      • AS91891 - Design Assessment
  • Develop an Outcome
    • Outcome Development
    • Year 12 >
      • Advanced Processes
      • AS91897 - Develop an Advanced Outcome
    • Year 13 >
      • Complex Techniques
      • AS91907 - Develop an Outcome using complex tools
  • Media Outcome
    • Create a Digital Media Outcome
    • Year 12 >
      • Advanced Techniques
      • AS91893 - Media Outcome Advanced Techniques
    • Year 13 >
      • Complex Techniques
      • AS91903 Media Outcome - Complex Techniques
  • Programming
    • Basics
    • Year 12 >
      • Advanced Programming Techniques
      • AS91896 - Advanced Programming
    • Year 13 >
      • Complex Programming Techniques
      • AS91906 - Complex Programming
  • Electronics
    • Basics
    • Year 12 >
      • Advanced Techniques
      • AS91894 - Advanced Electronics
  • Externals
    • 12 Summary
    • 13 Reflective Summary
    • 12 Optional - Computer Science
    • 13 Optional - Computer Science
  • Freyberg Digital