Kovak / CBL_SECRET_PROTOTYPE_RUNNING_GAME

0 stars 0 forks source link

World Object and Platform Code Separation #34

Closed Kovak closed 11 years ago

Kovak commented 11 years ago

The main goal of this fix is to separate the code for world objects and platforms, making world objects dependent upon the platforms list found in scrollingforeground, without the scrollingforeground being dependent on world objects.

This involves

  1. moving the add_coins method out of scrollingforeground and into worldobject
  2. instead of each platform having a platform.coins list, the coins will just be added to the world_objects list
  3. rather than coins being generated when a platform is generated, the worldobject add coins method will read the scrollingforegrounds platforms list and place coins based off the data found there
  4. writing a _check_collision method for the world_objects that separates the current collision code in _advance_time into it's own method (similar to _check_collision in PlayerCharacter)
  5. Basing probabilistic generation off of a 0-1 random generation rather than integer numbers
KerbySmith commented 11 years ago

foreground is no longer dependent on world object. There are a couple preliminary coin placement operations which are chosen randomly at the moment. Need to refine placement code and come up with an intelligent way to implement coin placement.