-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlatform.pde
29 lines (23 loc) · 1 KB
/
Platform.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//TODO #5: Finish the Platform class
// Adding Instance Variables
// - Add 4 ints storing the x & y positions and size of the platform
// - Add a boolean for tracking whether the block has passed the player yet (for scoring)
class Platform{
// - Create a constructor with the input parameters x, y, w, h
Platform(){
}
// - Create a function that draws the platform (Hint: TODO #4)
void drawPlatform(){
}
// - Create a function that returns whether a block has collided with a player
// - Parameter: takes in a player
// - Doing this can be alittle tricky:
// - I recommend finding the distance between the two objects first
// - Then you can compare the distances to the actual space between the two blocks
// - Create 2 variables distanceX and distanceY that store the distances
// - Then create two booleans sotring whether the distances are greater that
// - (the width of the block + the width of the player) divided by 2
// - (Hint: Use your Homework)
boolean isCollided(){
}
}