Ground Check In

I’ve added in a ground check for my player. This ensures that you can’t double, triple, and infinity jump after leaving the ground. Just one jump is all you got (says no when you try to jump in the air).

The only problem is that whenever there’s a small, unnoticeable gap between the ground and the player, the ground check thinks that the player is still in the air. Thus, not allowing the player to jump. I plan to get that fixed the next Free Friday, hopefully leaving me with enough time to work on more important matters.

Downtown gravity

The player is now affected by gravity. And to polish upward movement, I left some parts of the code commented(if I truly need it again, but I doubt I will). Going up is more powerful than elevator music for this block. However, I need to add a ground check to ensure that the player doesn’t float up into space whenever I leave the spacebar. Speaking of which, I should make it so that the spacebar can be used to go up. Anyways, enjoy this comparison.

Before

        Vector2 direction = new Vector2(xInput, yInput).normalized;
        body.velocity = direction * speed;

After

        //Vector2 direction = new Vector2(xInput, yInput).normalized;
        //body.velocity = direction * speed;

Tossing them boxes

Remember that goal I set last Free Friday(not counting the Django post) to start tossing boxes? Well if you haven’t seen the video I posted first, I call mission accomplished. So instead of the mouse doing the work, I plan on having the hand(circle) drag the boxes whenever it’s colliding with them.

Unorthodox for the standard drag and drop, but that’s the point. I predict that this concept will have dirty execution, which will make this a big accomplishment when done right.

Dragging them boxes

After telling myself ” I’ll work on the hard stuff(mouse radius and fixing collisions) later “, I decided to make a drag script for my objects. Fun fact, it works(kinda).

There’s some iffy moments in the code, but what I plan to focus on the next Free Friday is being able to throw the objects whenever I let go.

I should let you know that this senior project is more of me learning about C Sharp instead of creating an actual game that would normally take less time to make than the time I’m taking right now.

Also, I’ve disabled collisions on the hand so I can test this stuff out.

Fixed it!

Good news: I was able to get the hand to not collide with the player.

Bad news: I didn’t establish the establish the radius between my mouse and player

Weird news: I’ve now offset the hand from my cursor, and the collisions between the hand and blue 0 gravity box is weird.

At least the bug has been squashed. Now we got a couple more(probably more than that) to go.

Moving issues and Collision detection

So I decided to move all my mouse code into the player and… Well, you can see for yourself.

This issue can easily be resolved by having the hand collision not apply to the player, but that would require me to detect the collisions. Now pay attention to 0.09 to 0.11 in the video. If you couldn’t tell, whenever the player collides with the blue box, it prints ” yay ” in the log. Now all I need to do is have it apply to the hand, and instead of printing messages, have it not slingshot my character out of existence.

Moving with the mouse

Today, I was able to get a circle like object in my project to move with my mouse.

Later on, I will establish a radius on how far it can move from the player. The green circle is the radius the red circle is allowed to travel in. Going out of it won’t be possible. The red square is the player(the center point of the radius).

Overall, good progress(really all I have to say right now).