Friday, January 25, 2019

Moving shapes

 How do you move shapes on a game screen? What variables do you use, and how do they change?
To move the shapes on the screen you can use a variable called offset. They can change determining on what project you are working on. Offset can make the shape go left, right, up, down and you can make it go in a loop.

Offset

Tell me what offsets are, and how to use them. Provide specific code examples. How can I use an offset to move an image horizontally, versus vertically? How do you set it up so it scrolls across and reappears on the other side?
Offset is what moves the map with the player. One example of this is from this plat former I am working on right now is:
al_draw_filled_rectangle(j * 50 + offset, i * 50, j * 50 + 50 + offset, i * 50 + 50, al_map_rgb(255, 0, 0));
Now for moving the object horizontal vs vertically, you just have to add it to either the x-axis or the y-axis. X-axis is moving the object horizontally and adding offset the the Y- axis moves it vertically. For the object to reappear back on the other side you need to add a reset coordinate, which mean once the object gets to a certain coordinate you would reset the offset by subtracting how far you want to go. 

Math in programming

Using 5 or more sentences, compare and contrast how the math in this class is similar to the math in your core math class, and how it is different?
Math in this class for me I feel like is way easier equations. The difference is sometimes you don't even notice the math in this class. There was one time I used programming for a physics project, so the equations and math was the same. 

drawing a triangle

 You have a 300x300 game screen. Explain what numbers you'd use as parameters in al_draw_triangle if you wanted to slice the square game screen in half diagonally. Make sure you both type the function out AND explain each number please :)

For al_draw_triangle i would do al_draw_triangle(100,100, 250, 250, 100, 250, al_map_rgb(128, 0, 0);

The first 2 100 are the coordinates of the first coordinates of a point on the triangle, the  two 250's are the second point of the triangle, and the last 2 cordinates are the the last points of the triangle. The last part is the color of the triangle.


allegro drawing a circle

 You have a 800x800 game screen, and need to draw a circle with a radius of 200 directly in the center. How would you go about drawing this? What would the Draw_Circle function call look like, and what parameters would it take and why?
al_draw_circle(400, 400, 200, al_map_rgb(128, 0, 0), 5)

Tuesday, January 15, 2019

Paired programming

 When you were paired up with someone to do a programming assignment, what were your strengths? In what ways were you most helpful? What were your weaknesses? Where could you improve?
My strength is I would always think similarly to my partner. One big thing that is helpful is that when I didn't know where to start we would brainstorm with each other and we solve the problem. Sometimes I would be too tired to talk so I wouldn't help that much and it sucks. 
I need to improve my sleep schedule. 

Thursday, January 10, 2019