Symbiosis week 2

This week I’ve been doing several things for this game. First I started coding the interaction between terra’s water and Lumi’s fire. When those things collide its meant to create a cloud that lumi can walk on and raise while terra can’t walk on it but can lower it with her water canon.

2g7nhn8

What the script that i coded does is that it first of all checks if Lumis fire collides with terra’s water. If that’s the case it takes the premade invisible cloud object and makes it visible and moves to the position between Terra and Lumi. If the player then holds those hitboxes together the scale in the x axis of the cloud increases making it longer. I therefore made a max limit so that the cloud couldn’t become too large.

When the player has created the cloud and the two characters projectiles are no longer colliding is when i allow for the cloud to go up and down. It goes up when it’s hit with Lumi’s fire and it goes down when it’s hit with Terra’s Water.

The second thing i did this week was a lightdetector that it’s going to be used later in the game. It’s function is to set a bool to true when it’s hit by a spotlight. The way i did it was to combine a spotlight together with a cone hitbox. If the LightDetector object is inside one of these cones it send five linecasts with different origin points towards the light it’s colliding with. If one of these don’t collide with an object that is tagged with either ground or cloud the bool inlight is set to true.

sgpzzc4

That’s it for this week.

About Oskar Hernberg

2014  Programming