FMC – 07/10/24 – Week 2: Programming Interactions Variables and Conditional Statements
07/10/24 – Week 2: Programming Interactions Variables and Conditional Statements
Back End and Front End Software

-Two parts of a software programme that work to allow users to interact with an application
Data Types
-Numbers: 1, 0.99, 2345, 3.14 etc
-String: ‘Hello World’, ‘Creative Computing’ etc
-Boolean: False, True
-Undefined
-Other Data Types (To check data type – console.log(typeof(myVariable))
Global Variable
Global Variables
-Width: Canvas width
-Height: Canvas height
-mouseX: X position of the cursor on the canvas
-mouseY: Y position of the cursor on the canvas
-frameCount: The number of the current animation frame
Comparison Operators in JS
== Equal value
=== Equal value and data type
!= Not equal value
!== Not equal value or data type
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
Logical Operators in JS
&& And
|| Or
! Not
https://www.w3schools.com/js/js_comparisons.asp
My ‘Game’
https://editor.p5js.org/minmoo.o/sketches/oJBsoHlfU

^In this section of code I used a conditional ‘if’ statement to turn the screen the colour green when the cursor was dragged over the yellow square (cheese). Similarly, in the attachment below when the cursor was dragged within the box the text would be printed on the canvas alongside the screen turning green.
