Revenge of Teddy – Group Troll – HP Light Test
|
Today I worked on a system which should use light in the level to show the player’s HP. For now I’m using a point light in unity which changes in intensity and range as the player’s health changes. This first image shows what the screen looks like when the player has full HP:
(The white box is a placeholder for a teddy bear that the player controls in addition to the main character. Th grey box is a placeholder for a pickup.) Every update, the HPLightController modifies the light’s range . The change in light range per second is the difference between the current light level and the current hp level multiplied by a given integer switchTime. This makes the light range follow a converging geometric series. The light intensity follows a similar series, but only half of the intensity changes. The range ranges from 0-50, whereas the intensity ranges from 2-4, so there is at least a level 2 intensity light at all times. This is what the same level looks like at very low HP:
(The white big white boxes are enemies and the small ones are projectiles.) Currently it looks like a blue sun in the background, which is a result of my using a point light in unity, which concentrates the light in the middle of it. The decision to use a point light was just that it was what the tutorial I watched on sprite lighting used, so to be safe I used the same type of light. I will most likely change it later, since the light is supposed to be more of an ambient, unobtrusive light rather than strong flashlight-esque light. However, for now, a working light system is good enough since the game has just reached the pre-alpha phase. I intentionally make the light system only affect the background. The idea of the light system is to be a more aesthetically pleasing way to show HP, rather than a bar. If the enemies and pickups were affected, it would mean that the game becomes harder as you get lower HP, which intrudes on gameplay design. |

