CoilBrew / sidescroller

0 stars 0 forks source link

Unhardcode these percentages #7

Closed chrisgrounds closed 6 years ago

chrisgrounds commented 6 years ago

src/Obstacle.py

vertices = [                                                                                                                              
    self.bottom_left_location,                                                                                                        
    (self.width * 0.75, self.height * 0.75 - self.obstacle_height),                                                                   
    (self.width * 0.75 - self.obstacle_length, self.height * 0.75 - self.obstacle_height),                                            
    (self.width * 0.75 - self.obstacle_length, self.height * 0.75)                                                                    
]

This is what sets where the obstacles appear. Want to make the percentage not hardcoded. Assign it to a variable in the class and then use that instead.

Also, you could maybe make it so is uses some data from the Floor object to determine where it is set, rather than hardcoding 75%.

chrisgrounds commented 6 years ago

In fact, you could use the settings object for this, because there is now a floor_height_percentage property on that object that sets the floor height.