This week has been busy with preparations for Chinese new year but game wise it was focused on getting the game towards a state where someone would be willing to try it

most of the week was put towards bringing back physical projectiles. previously we had this but it was removed as i remade the trajectory system. the problem then was readding it as the new system didnt make it as easy as expected.

it raised a question: should we forecast the entire trajectory? or do it step by step.

in the end step by step won out, as it makes it easier for moving targets later, this then lead to remaking the projectile logic. in essense the projectile is made of 2 things, the sprite and the munition payload.

the sprite could be thought of as a loading bar, it has a source, destination, and a speed and just tracks its way along until it gets to the end.

the munition payload contains all the calculations needed for determining what the source, destination, and speed will be. it took a lot of fiddling around but in the end it was decided that each tick, each projectile goes though the following:

  1. was i just fired? if so, fire a raycast then update the direction and destination for the sprite
  2. has my sprite reached its destination?
    1. if so
      1. check what my last raycast hit and do new calculations
      2. then, if we’re not at speed zero or destroyed, fire a new ray
      3. then update the direction and destination for the sprite
    2. if not
      1. tick my sprite forward

i then was thinking about adding hit effects, which are what will give the projectiles their punch and make them feel powerful.

in the end i opted to add a new Effects Handler that watches projectiles and plays effects based off of what they hit and how they’re behaving. this lets us kick up dust or have projectiles explode on impact without needing to include that into the already pretty bloated munition payload

this is how it ended up looking

new flying projectiles with a bit of dirt kick

new powerful projectiles that explode

in other news i added a way to easily save levels thats probably going to evolve into a level editor eventually, as well as adding a pause function to the factory side.

and i fixed the enemy aiming sytem to work with indirect fire. its not perfect as its very slow to acquire but so may be the player.

a final finding; i accidentally left the game on for 8 hours and 40 mins hours while i went to pick up my saxophone, have dinner, and have a long and comfortable bath. in the meantime it produced this firing pattern

it was still successfully hitting the player, admire the commitment