CSE 251: Introduction to Game Programming Assignment #1 Due 1 September, 11:59 pm
1. (2 points) Consider the gure below:
Figure 1: A Triangle
(a) Given the values a = 6, b = 8 and = 75 , nd the values of c, and . (b) Given the values a = 6, b = 9 and = 50 , nd the values of c, and . 2. (2 points) Find the point (x, y) at which the two lines intersect: 3y y = = 5.1x + 7 4.88x 11
3. (2 points) Without changing the slopes of the lines in problem 2, how would you modify the two lines so that they intersect exactly at the point (1, 1)? 4. Programming: (6 points) Modify your Game1.cs le from lab 1 so that the image only relocates when you click on it. Note that images are imported within rectangular boundaries, so an image of a round smiley face will be relocated whenever you click inside the square containing the image, not just on the round part of the smiley face. (a) To make the mouse pointer visible, add the line IsMouseVisible = true; to your Initialize method. (b) The mouse automatically keeps track of the cursor position in the game window using the Mouse object. You can access the X and Y coordinates of the cursor using Mouse.GetState().X and Mouse.GetState().Y. (c) You will need to modify the if statement in the Draw method using some lengthy compound logic. Ask yourself how you can mathematically and logically describe the situation when the mouse has been clicked in the image. (A good, brief tutorial on the C# if statement including compound logic can be found in lesson 3 at http://www.csharp-station.com/Tutorials/Lesson03.aspx).