• Register

THE GAME In „Into the Belly of the Beast“ you are the last hope of Sploosh. A lovely worm who needs to rescue his kidnapped children. Manage your way through a series of beautifully designed levels that take place inside the body of a giant sea monster. Meet all kinds of enemies and master techniques to fool them. Solve a variety of riddles to reach new sections. Face frightening bosses and beat them in thrilling fights. You are wondering how to be succesful on such a dangerous journey? You can make use of the entire environment! There will be different kinds of bacteria inside the body of the sea monster. Eat them and form a symbiotic relationship with your surroundings. Your hard work will pay off. Become the mightiest worm that our universe has ever seen!

Post news Report RSS Riddle-Element: Electro Rotator

“Into the Belly of the Beast” is a 3D action-adventure game with a two-dimensional playing field where you jump into the role of Sploosh, a seaworm who is heading out to bring back his swallowed children out of the belly of a gigantic waterbeast. On your journey through the diverse and unique locations of its guts, you make use of the given properties of this special environment to solve physic- and bodyelement puzzles. Master fights against DNA based enemies in creative and inventive ways.

Posted by on

Hello there,

in our third update we want to present you one of our puzzle elements and most important one of the problems we had while coding it (and it’s solution).

New Puzzle-Element: Electro-Rotator

The Electro-Rotator was created to bring a new dynamic obstacle to the game. It moves in a clockwise direction making it more difficult for the player to pass this section.

When we first implemented the Electro-Rotator, it didn’t collide with the walls the way we wanted it nor adjust it's length dynamically. A collision with life forms didn’t stop the beam from passing through them.

The Solution: „RayCast“

A „RayCast“ involves intersecting a ray with the objects in an environment. In other words, a ray cast tells you what objects in the environment the ray runs into, and may return additional information as well (for example such as the intersection point).

All values were set to the positions we already had defined and damage dealt to lifeforms was also included.

void Start () {
        //initial_setted speed
        electroAnim.speed = speed;
        ///box_collider will be set on a releative correct distance as setted
        rayCollider.size=new Vector3(rayCollider.size.x,rayCollider.size.y,maxDistance*10f);
        ///box_collider center will be setted to 
        rayCollider.center=new Vector3(0,0,rayCollider.size.z/2f);

        ///The MainParticle is setted by an factor 12.5f because of mesh and size of created particle may be different on other particles
        mainParticle.startSize=maxDistance/factorLaser;
        /// Maximum Radius is set
        maxParticelRadius=mainParticle.startSize;

        /// Our sub-particle such as dust and electro is transformed to the end of the Main_Particle
        subParticle.transform.localPosition=new Vector3(subParticle.transform.localPosition.x,subParticle.transform.localPosition.y,((maxDistance*initialZPositionOfSubParticle)/factorLaser));
        subParticle.enableEmission=false;
        dustParticle.enableEmission=false;
        /// for propotinal calculating         initialZPositi
    }


void FixedUpdate(){

        /// Determine Fwd direction
        Vector3 fwd = transform.TransformDirection(Vector3.forward);

        /// Fire Raycast => Fwd with MaxDistance
        if (Physics.Raycast(transform.position, fwd, maxDistance)){

            RaycastHit hit;
            float distanceToObject = 0;
            
                if (Physics.Raycast(transform.position, fwd, out hit)){
                /// New Distance because => is in maxDistance and there is a hit
                distanceToObject = hit.distance-distanceToObjectOffset;
                /// Reset of Main_Particle_size
                mainParticle.startSize=distanceToObject/factorLaser;
                /// Repositioning of subParticle and enabled the emission
                subParticle.transform.localPosition=new Vector3(subParticle.transform.localPosition.x,subParticle.transform.localPosition.y,((distanceToObject*initialZPositionOfSubParticle)/factorLaser));
                subParticle.enableEmission=true;
                dustParticle.enableEmission=true;

                /// If is LifeForm => Damage it!!!!
                LifeForm lifeForm;
                lifeForm = LifeForm.GetLifeFormFromTransform(hit.transform);

                if(lifeForm!=null){
                    lifeForm.handleDamage(null,damagePerHit);
                }
            }
        }
        else{
            /// If is nothing in range here set mainParticle to max and dont emit sub_Particle
            mainParticle.startSize=maxParticleRadius;
            subParticle.enableEmission=false;
            dustParticle.enableEmission=false;
        }
    }

The result of using „RayCast“ was awesome. Everything works as planned before, we are happy!

Hope you guys like it, thanks for reading!

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: