I spent most of today revising for the up and coming maths exam. I did some overall revision of a lot of the maths involved in the code for my game, and answered some questions aimed specifically at learning these answers.
Draw the FlightController class out as a Class Diagram
List the different data types used in the code
Float, Vector 2.
Explain the use of an ‘if’ statement
‘If’ statements work so that if a condition is within specified parameters, the statement is true, but if the conditions are not within the specified parameters, the statement is false. This can be used to make different events happen based on whether the conditions meet specific parameters.
Identify one use of Vector arithmetic
Transform code to make a player, enemy, or anything move.
Explain dot products and why they are useful for the navigation of the aeroplane
A dot product performs a series of multiplications with 2 vectors to give a single, scalar value. It multiplies corresponding values from the vectors, then adds all of those values together to make one overall value. This could be used to add the current vector direction to the direction that the plane needs to be at, to work out the angle that the plane needs to turn at.