|
Good day today, Gustav said he got the sound working and took over the HUD which will display a text as a speedometer while i started working on how to build the track. Meanwhile Martin is working hard on actually drawing objects on the screen.
Gustav looked at a way to import models into the game and made the assertion that we did not have the time to implement it before the deadline. Because of this we’re going to have to use the budget version of what we had planned for models. Players and obstacles will be rectangles, although if there’s time i might make the obstacles’ sizes partially randomized to make some variation.
The pipe will be a simple shape made up of several planes. what i made today was to flesh out the track object to be more than just a game object handled in the track manager. Now it contains a vector of other game objects which are aligned around the center of the game object when initialized. They are placed using the same way i used to place the players and the obstacles but also taking into consideration the amount of segments i want which is simply a variable integer. The formula for placing the objects looks like this:
newpos.m_x = pf_radius * cos(i * ((M_2_PI) / pf_segments));
With the corresponding value for y using sin rather than cos of course. z is set to zero.
pf_radius is a private float which determines the size of the track for easy change.
i is the number of the current object in the list.
M_2_PI it the double value of Pi and pf_segments is the total number of segments.
The parts within the parenthesis calculates the angle between two segments and multiplies it with the current number to get the angle to the center of the current segment. After that it takes the cos value multiplied with the radius to determine the final value in x.
What i realize i had forgotten about was to also set it’s rotation. I’ll get on that tomorrow.

|