Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / Game Engine Foundations Lab Eight In lab seven, the player is able to spawn a bullet by pressing a key

Game Engine Foundations Lab Eight In lab seven, the player is able to spawn a bullet by pressing a key

Computer Science

Game Engine Foundations

Lab Eight

In lab seven, the player is able to spawn a bullet by pressing a key. However, the bullet does not move in the scene. In this lab, we are going to modify our code to make the bullet move once it is spawned in the scene.

In this case, the bullet moves continuously along the “looking direction” vector of our player. Therefore, you will need to set the direction of bullet to be the “looking direction” at the time that the bullet is fired. (Remember:  the direction is one property of a game object as we defined in lab seven)

 

Moving objects on a game scene:

You can develop the motion of objects in various ways. One method is as follows:

Develop a function called updateScene(). This function iterates through the scene-graph. A Scene-Graph is a collection that contains all game objects in a game (we named it a gameScene in lab seven). During iteration, the function updates the position of all game objects in the scene graph. Specifically, you will need to move the game objects toward their direction.

This is great! So far, we have developed a function that updates the positions of all objects on the scene.

The last step, is to simply call this function for every frame that is rendered. Correct! We call this function in idle() function.

To submit:

ONLY submit the .cpp file that you develop. Please do NOT zip your file.

Option 1

Low Cost Option
Download this past answer in few clicks

22.99 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions