Dara is designing a videogame using PlayCanvas. Which type of conditional does Dara use to check if a condition is true

before running a block of code?
(1 point)

if conditional

switch conditional

design conditional

variable conditional

if conditional

Dara uses the "if conditional" to check if a condition is true before running a block of code.

The type of conditional that Dara would use to check if a condition is true before running a block of code in PlayCanvas is the "if conditional".

To explain how to use the "if conditional", here are the steps:

1. First, Dara needs to identify the condition that needs to be checked. This condition can be a comparison between values, a logical operation, or any expression that evaluates to a boolean value (true or false).

2. Dara writes the "if" keyword followed by parentheses. Inside the parentheses, Dara writes the condition that needs to be checked.

3. After the closing parenthesis, Dara writes an opening curly brace ({) to start the block of code that should run if the condition is true.

4. Dara then writes the code that should be executed if the condition is true inside the block (between the curly braces).

Here's an example of how Dara would use the "if conditional" in PlayCanvas:

```
if (playerHealth <= 0) {
gameOver(); // This is the code that runs if the player's health is less than or equal to 0
}
```

In this example, Dara checks if the player's health is less than or equal to 0. If it is, the "gameOver" function is called, which contains the code for ending the game.