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

Advanced Programming Techniques

Introduction

The Year 12 Programming assessment requires that you also include 2 advanced techniques.
You only need to pick two techniques from this list:
​
● modifying data stored in collections (e.g. lists, arrays, dictionaries)
● storing multidimensional data in collections 
● creating methods, functions, or procedures that use parameters and/or return values
● responding to events generated by a graphical user interface (GUI) 
● using non-trivial string manipulation
● using additional non-core libraries. 

Responding to events generated by a GUI

For those creating a video game this is the most obvious advanced technique to use.

As you have a GUI programmed with a video game then you will be able to  respond to events that occur

For example if touching enemy lose health.

For an electronics project it becomes more difficult, you have to create a graphical user interface though an LCD screen and allow the user buttons to interact with it.

​
Picture

Modifying data store in collections


In JavaScript year 11 we were forced to use an array like the following:

let fruits = ["banana", "apple", "orange", "pear"]
alert(fruits[2])

In year 12 it is not good enough to use the data in an array, you must manipulate the data inside.

You could do this by, modifying, deleting, or adding data into the array.

fruits.pop() will delete the last entry in Javascript removing "pear"
fruits.splice(3,1) to remove the pear.

In a video game a good place to use an array is spawning collectables, the array could be used to store the locations of different coins for example.

Keep in mind that the collections is plural so you will need at least two different collections.


Picture

Storing multidimensional data in collections

Multidimensional data is sets of data in a collection. For example storing not only the fruit name, but color and cost also.

In JavaScript it looks like storing objects in an array:
const students = [
{ name: "Alice", age: 20, grades: [90, 85, 88] },
{ name: "Bob", age: 22, grades: [78, 82, 91] },
];

This could be used to store different enemies and their locations.

You do not need to manipulate the data in these multidimensional collections

Keep in mind that the collections is plural so you will need at least two different multidimensional collections.


Picture

Creating functions that return values or pass through parameters.

A function is a separate set of code you can call when needed.

However as an advanced technique you need two functions that receive input and return output.

an example from chatGPT for calculating damage:
​
public class CombatSystem : MonoBehaviour
{
    // Function to calculate damage dealt
    public int CalculateDamage(int attackPower, int enemyDefense)
    {
        // Calculate raw damage
        int rawDamage = attackPower - enemyDefense;

        // Ensure damage is at least 1
        return Mathf.Max(rawDamage, 1);
    }

    // Example of using the function in gameplay
    void Start()
    {
        int playerAttackPower = 25;
        int enemyDefense = 18;

        int damage = CalculateDamage(playerAttackPower, enemyDefense);

        Debug.Log($"Damage dealt to the enemy: {damage}");
    }
}
Picture
Picture
Picture

Non-Trivial String Manipulation

Before we start we need to know the different between trivial and non-trivial.

Trivial:
Single, straightforward operations (e.g., concatenation, simple slicing).
Non-Trivial: Involves multiple steps, complex logic, or pattern-based manipulation.

Trivial Example:

alert("john" + " Doe");

Non-Trivial Example:

​// Non-trivial example
const tweet = "Loving the #JavaScript life! #Coding #100DaysOfCode";

// Extract all hashtags
const hashtags = tweet.match(/#[a-zA-Z0-9_]+/g) || [];

console.log(hashtags); 
// Output: ["#JavaScript", "#Coding", "#100DaysOfCode"]
Picture

Non-Core Libraries

When you install Unity for the first time it will come by default a bunch of libraries with the code.

However we can install non-core libraries produced by unity as an advanced technique.

here are some of them:
Unity Cinemachine
Unity Input System
Unity ProBuilder
Unity ArtEngine

​ETC
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