Sunday, September 7, 2014

Harmonizing the code

Since project is getting close to the end (hopefully), I'm trying to improve those parts of the code that I'm not happy, so this time it was about splitting render code into Render() and Tick() methods, before it was a bit of a mess.

what's new?

HBF)
  • New enemy Sam (not used yet)
  • HandlingMovingPlatform() finally uses spatial partitioning
  • Fire emit some light 
  • Some different backgrounds tiles
  • Cardride response to the changes of slope with proper angle 
  • Slope detection simplified a bit
  • New property TGameSprite.Sticky
  • Cardride now uses new sticky property in order to not move away from rails
  • Slope calculations are now more accurate
  • Removed some singleton classes and adding them as interfaces via GameServices 
  • Removed an extra explosion sound when bomb exploded
  • Gatashi didn't kill the screen sprite spawner when dying
  • Darkness detection code improved, old code was slowing down the performance
  • GameServices is now fully working, no need for extra information
  • Updating all elements to use the new Tick() rather than have all the code in Render()
  • New credits screen 

BB)
  • TSpriteEngine render method was wrongly assuming that all sprites were TSprite 
  • New interface IShadow
  • Heights for slopes are calculated on demand
  • It is possible to get the angle of the slope 
  • New closure event for rendering
  • Slope angle can be retrieved more accurately
  • Many fields changed to cardinal rather than integer
  • Slope initialization was wrong
  • New Tick() function that is called when sprites are not in pause 
  • OnRenderClosure() has a serious problem with the Die param