Progress Report # 1 – Pong Game Dev

So far, thanks to the tutorial from the game that is developed, the Pong game is now in development.

—-

Note: All progress reports are personally experienced from my perspective of things. Ultimately, these progress reports are all optional suggestions that you could use but not something that is recommended depending on your style of coding.

The codes created from the development of the Pong game derived from the basic concept of using a controller to move the puck within the game. It has no objective at the moment and has no scoring system. There isn’t much to discuss in terms of the programming. The tutorial made on the development of Pong is basically developed on the formation of the colliders and the rigidbodies.

Colliders and Rigidbodies on the 2D platform is created based on the attachment of the platform. Then, the collision is created onto the square in order to make it move.

Afterwards, the game developed is created formed on the basis that the player can move up or down if need to be. The game is simple, utlizing the OnCollisionEnter and OnTriggerEnter 2D formatted in order to make the colliders stick with the object.

The ball itself is also affected by the velocity and the movement of the area in order to interact with the player controller. Using colliders helps to build the interaction of the game’s design into full view and bring out the interaction into the game.

The focus of the pong design is to implement the basics of rigidbodies and implement the 2d structure into the game.

The pong game is implemented in order to provide the basic of the 2d development game and the foundation of game creation.

The game simply is to ensure that interaction between one object and the other is placed on the following. Scaling the background and the outline for the game is beneficial in order to make the pong game feel as fleshed out as simply as possible.

Implementing the wall with colliders and rigidbodies helps to ensure that the object sticks in and flows in the program.

The rackets, the player square box, helps movement using this function and increment it into the pong game.

By resizing and reformatting the position of the rackets, we can make it move by inputting instructions directly on the input manager in the Unity Engine.

The function on the collider’s entrance, quoted from the source code created by noobtuts is as follows:

This is what happens when the gameObject collides with the object named RacketLeft and 
RacketRight. The hit factor helps to transform the position of the object collided, in this case, the ball, and reflects based on the velocity and speed of the ball's force 
being put into the start of the game. It greatly helps when triggering colliders on a zone.

    if (col.gameObject.name == "RacketLeft") {
   
        float y = hitFactor(transform.position,
                            col.transform.position,
                            col.collider.bounds.size.y);

        
        Vector2 dir = new Vector2(1, y).normalized;

      
        GetComponent<Rigidbody2D>().velocity = dir * speed;
    }

    if (col.gameObject.name == "RacketRight") {
      
        float y = hitFactor(transform.position,
                            col.transform.position,
                            col.collider.bounds.size.y);

       
        Vector2 dir = new Vector2(-1, y).normalized;
        
        
        GetComponent<Rigidbody2D>().velocity = dir * speed;
    }

To conclude, learning about creating the basics of Pong game comes from the development of the colliders, the rigidbodies and the implementation of code inside the program to  create an interactive game experience.

References:

noobtuts – Unity 2D Pong Game. (2012). Retrieved from http://noobtuts.com/unity/2d-pong-game

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s