Thursday, August 30, 2018

Loops

 Compare and contrast the different loops (for, while, do-while) we use in class.
Loops are very good for making games and other programs you need to run more than once. Lets start off with a for loop, a for loop is a loop where you know how many times you know its going to run. If you need it to run 5 times then you can use a for loop. Now a while loop can run infinite. If you need something that needs to run for a long amount of time, for example a game like pacman. It checks at the top of the code/ loop then it loops. A do-while is the same as a while loop but instead of checking to loop at the top it will check at the bottom of your code.

Wednesday, August 29, 2018

Random function

 How do generate random numbers in C++? Provide 2-3 examples and explain what numbers they generate.
Generating random numbers can be used in multiple ways. You are going to have to type the random function in the perimeter you want, the code you have to type is, rand(). and you can restrict the randomness by adding a module and a number to go with the module, it will look like this rand() %700. One example is you can draw a rectangle and put the rand number function in the color parameters and get random colors for the shape each time you run the code or every time the code loops. Another example is putting the rand function in the shapes position and size parameter. Each time you run the code or the code loops, you'll have a random rectangle with a random size and position.

Tuesday, August 28, 2018

Functions-

In your own words, describe what the following functions do: al_flip_display(), al_init(), al_clear_to_color().
To start off, al_init() is important because it initializes the library so you can access all the code in it. The clear to color function is helpful when you are running a loop, where you are moving an drawing on the scree. It is used hear because the purpose of this function is to clear off the objects previous location on the screen, if you do not put this function on the screen it is going to look like its leaving a trail of that object and will cover the screen with clones of itself. Now the flip display function allows objects the computer to draw to the screen. Anything you draw will show up on the screen and if you do not not have this line of code your screen will be blank.

Monday, August 27, 2018

Game Projects

What individual game projects would you like to work on this semester?

I would like to work on Tetris with other 3 semesters and try to give each other ideas.