Finished implementing penetrating projectiles. A new spell, ice spike is able to make dents into DestructibleObjects although I have yet to make ice spikes DestructableObjects themselves so they can be penetrated and exploded. An unforseen issue with this implementation was with body.getRotation. I turns out that the value returned by the aforementioned method call isn't always correct (or what one would reasonably expect (still don't know what it actually returns)). Took a while and some debugging to find out that it wasn't working and some more time beyond that to find a fix.
Also moved on and implemented the force push spell. I had to adjust the direction of the projectiles to give more of a force push feel. Beforehand, they left the player's hand in a spherical fashion.
Feeling kind of tired but if I'm up for it, I really want to implement a fire spell. The main focus here is to have a fire get started. DestructableObjects will be eligible to catch on fire and spread that fire based on their fireResistance and fireSpread. fireResistance is to simulate the different flamability of paper vs. wood. The fire needs to reach a certain heatLevel before it can overcome the fireResistance of certain objects and begin to melt/burn them. fireSpread is meant to distinguish between "burning" ice spikes and a burning wall. An ice spike can't spread a fire too well but a wall can, more so if it's made of wood.
A single fire will be made up of multiple fire dots. These fire dots will be simple polygons that cut their outline from their victim DestructableObjects. The first step, however, is for these fire dots to attach themselves to a DestructableObject. After a certain number of animation steps, the fire dot will call a PolyManager.cutPolygon from its "host" DestructableObject" and then spawn more fire dots that will spread in random directions (spawn number determiend by fireSpread of host object).
To make things simple, each new fire dot will have a higher heatLevel than its parent. A more realistic approach would be to make heatLevel dependent on number of fire dots nearby.
After I finish that spell, I might work on a force-like spell that allows the user to grab and throw objects. If I get to this point, I'll be able to fix some things up.
Firstly, I need to convert from meters to pixels and update the display accordingly.
Secondly, get conditional jumping to work.
Thirdly, tweak explosionShapes and creationShapes. Make explosionShapes weaken structures by calling PolyCuts and seeing if more than the original number of polygons are returned.
If I get to that point, I will have the basic framework of a singleplayer version of the game done. I would then proceed to designing a destructible world that the player can cast spells in and interact with.
No comments:
Post a Comment