Devlog 1: Player Movement


Frog Game Is Underway!

Forg is on the move!

As the game was entirely built around a movement ability, getting good feeling player movement was very important to me.

My main character’s a cute lil’ froggy, so I had to make him bounce! But how? I wanted to rely mostly on Unity’s inbuilt physics system rather than building a whole new one from scratch. Sounds… a little bit easier.

So Forg’s regular movements are actually just adding force. Whether this force is directly up (for a jump) or left and right (for his movement), the force is applied while you’re holding the button. This technically means the longer you hold the left or right buttons in the air, the faster you’ll move. This visually looked and worked much better than just manipulating his position with commands.

So then cometh the jump. The jump I just decide to add a charging system. When you just tap the button the frog does a tiny little bounce. (I might increase the base jump a little more later depending on how the level blocking goes)

https://i.imgur.com/YYfCCUB.mp4

Holding the space button longer charges up the jump to a max of 500 units of force!

https://i.imgur.com/oWB5wS6.mp4

Much bouncier.

And here comes the big draw of the game:

https://i.imgur.com/fcS8AG7.mp4

A laser beam! Frogs… with lasers! Can’t believe it.

This took a lot of work to get right. Less so the movement, but much more the laser.

The movement shoots a beam towards the mouse, transforms it into the direction from the frog to mouse, and sends him flying in the opposite direction. Not too difficult! But the tricky part was getting the laser working. Originally, it just went to the mouse, and you could fire it through walls. But then I dipped into the wonders of raycasting! Now I just fire a beam towards the mouse, and through it, and once it hits something it stops!

Then the laser beam is simply a line drawn from point A (Forg), to point B (the raycast point), via a line renderer. Amazing! Here comes the trouble though. Lasers cut through things. And my laser was a glorified sketch drawn on the screen. I went through several attempts to rectify this, following many tutorials.

They showed ways like adding meshes or adding colliders. I couldn’t get any of them to work even with a lot of adaptation. So, I went with the easy way. The laser’s a bit small, it’s not really built for hitting a lot of things at once. I just turned the raycast hit (point B from earlier) into the trigger for destroying things. And it works!

I threw up some targets for my play-testers to shoot.

And then it was complete, the beautiful build v0.01. Ready for the world.

What Went Wrong

I received some compliments on the movement, but there were several notes given to me.

Primarily, the camera and the way the frog slides.

First issue was that the field of view was a bit too small. You can fire yourself off into oblivion, but you certainly aren’t going to be able to see where you’re going.

https://i.imgur.com/a7uJwDU.mp4

I made a simple quick fix, doubling the amount you’re able to see around Forg. BUT, thanks to a fantastic suggestion a work-in-progress feature to draw back the camera (zooming out) when you start to reach higher speeds is underway.

https://i.imgur.com/ukM38bG.mp4

Controller support was also suggested, and due to the way the frog’s force physics and such is calculated, it doesn’t seem like a crazy big add. Thus, it has also been added to my to-do list.

And the final criticism I was given was about Forg’s inability to not skid all over the place. Forg reaches high levels of momentum (… from shooting a big laser!) and when he touches down, he decides to veer off into the abyss.

https://i.imgur.com/pBdiPJt.mp4

Efforts are being made, such as using a material that gives him far more friction, to reduce this.

https://i.imgur.com/irUNrFR.mp4

 Final Statement

Overall things are going pretty well. Most of the player’s actual movement is implemented, and besides things like health there isn’t much more to be added to Forg himself. Now comes the time to plan around this and build ourselves some levels. Frogkingdom wasn’t built in a day. 

Comments

Log in with itch.io to leave a comment.

I couldn't quite get the gifs to reach itch.io's file size limit (3mb) without completely dropping the quality to zero, so I had to use imgur links. The ones which could work are still there, but I hope the others count towards the gif marks.