Apologies
Ok, so it’s fair to say that as I am publishing this today (Tuesday) instead of Friday that I have bitten off more than I can chew with this fortnights targets.
The fact that the temperature has been in excess of 30 degrees C for the last week hasn’t helped much. I don’t fair well in hot weather, and AC is not common in houses in the UK.
Zones
The goal was simple, to get the basics of the zones working, but I had greatly underestimated how many “behind the scenes” systems I would need to implement before I could get this finished.
The theory is simple enough. There is a pool of sprites created at run time which are used to display the current zone on screen.
These are assigned and positioned when the SpawnZone() function is called.
The SpawnZone() function is responsible for taking the zone data (stored in a csv string currently) and breaking it down and using the data to set the sprite properties (position, rotation, and image ID)
The zone sprite positions are updated by the UpdateZone() function, which simply moves all the sprites along to the left at the correct speed. It also measures the distance the sprites have travelled so it knows when to spawn a new zone.
The zone sprites are removed once they pass a set position (currently -192 px off the left hand edge of the screen) and placed back into the pool ready to be used again/
I have written a function specifically to get the next unused sprite from the pool. This allows the zones to transition from one to the other seamlessly without sprites disappearing, which would happen if the sprite was still on screen when it was re-assigned.
I also have created a couple of images, the zone marker and a pipe, to make demonstrating the zones stuff easier. Once again, these are only placeholders and are likely to change significantly as the development progresses.
In the next update
And that’s where we are now. I will carry on with the same task list again for the next two weeks, and hopefully have a lot more to share when the progress report day comes around next, which should be Friday the 21st.