Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Some improvements

A topic by Not A Bot created Apr 09, 2018 Views: 272 Replies: 3
Viewing posts 1 to 4

Ok so it's a good game idea but I can tell you're new to gave dev so here is some constructive criticism:

  • I noticed that the player can rotate, in the player's rigidbody2D component (assuming you're using Unity which I think you are based on the buttons) you can go to constraints and check freeze rotation.
  • after you stop moving you keep gliding for a bit. This can be checked with this code

if(Input.GetAxisRaw("Horizontal") == 0) {

               GetComponent<Rigidbody2D>().velocity = new Vector2(0, GetComponent<Rigidbody2D>().velocity.y);

}

  • I like the fact that the music changes but it doesn't continue into the win screen. Make a piece of code in the script for the audio controller with this separate to the already existing voids:

public void Awake()
    {

        if (instance == null)
            instance = this;
        else
        {
            Destroy(gameObject);
            return;
        }

        DontDestroyOnLoad(gameObject);

    }

  • The movement is a bit strange as you move whenever you push a key. Here is some free code that will make the movement a lot better:

public float moveSpeed;

public float jumpHeight;

public GameObject groundCheck;

public LayerMask whatIsGround;

public float groundCheckRadius = 0.2f;

private bool isGrounded;

private Rigidbody2D myRB;

void Start() {

myRB = GetComponent<Rigidbody2D>();

}

void Update() {

            isGrounded = Physics2D.OverlapCircle(groundCheck.transform.position, groundCheckRadius, whatIsGround);

            if (Input.GetAxisRaw("Horizontal") > 0.1)
            {
                myRigidbody.velocity = new Vector2(moveSpeed, myRigidbody.velocity.y);
                myRigidbody.transform.localScale = new Vector2(1, 1);
                moving = true;
            }
            else if (Input.GetAxisRaw("Horizontal") < -0.1)
            {
                myRigidbody.velocity = new Vector2(-moveSpeed, myRigidbody.velocity.y);
                myRigidbody.transform.localScale = new Vector2(-1, 1);
                moving = true;
            }
            else
            {
                myRigidbody.velocity = new Vector2(0, myRigidbody.velocity.y);
                moving = false;
            }

            if (Input.GetKeyDown(KeyCode.UpArrow) && isGrounded)
            {
                myRigidbody.velocity = new Vector2(myRigidbody.velocity.x, jumpHeight);
            }

           // the groundCheck should be a game object slightly underneath the player. The whatIsGround should be the layer the ground is on.

}

  • Finally I'm not sure how this fits with the theme of mood change

I'm not trying to be rude I'm just trying to give you some advice for the future. Hope you do well in the ratings!

(1 edit)

I don't think that velocity is what I would use, but rather addForce because it isn't instant, but that is just me. Also, I would use linecasts for the easiest jump script, but I usually just use if (<something> && transform.velocity.y == 0)

Developer

Probably the best comment I have ever got,  thank you!  I will try and add those improvements when the jam is over.

(1 edit)

Yeah, it looks like you did Input.GetKeyDown (KeyCode.LeftArrow) rather than Input.GetKey (KeyCode.LeftArrow).