Variable Length Jumps | Coding a 2D Game Engine in Java #50
GamesWithGabe GamesWithGabe
59K subscribers
5,426 views
101

 Published On Jun 12, 2021

Join the Discord:   / discord  

In this episode I go over a method to create variable length jumps. This method involves counting a certain number of frames, and after enough frames have passed ignoring the player input if they are pressing space. If they stop pressing space early, then we stop applying a jump force. I also scale the jump force linearly so that it runs smoothly and you get the same jump every time if you supply the same input. Next, I go over how to make a block "bop" when Mario hits the bottom of it. I extend this same concept to question blocks, and finally I implement a question block that spits out a coin when Mario hits it.

Code: https://github.com/codingminecraft/Ma...

0:00 Intro
0:55 Checking if Player is on Ground
4:18 Visualizing the Raycasts
7:51 Creating the Variable Length Jump
14:36 Updating Animations for Jumping
16:24 Stopping Momentum on Collisions
18:56 Bopping Blocks
27:19 Fixing Physics Bug
29:52 Creating the Question Block
34:28 Making a Coin Question Block

---------------------------------------------------------------------
Website: https://ambrosiogabe.github.io/
Github: https://github.com/ambrosiogabe

Here are some books I recommend if you want to learn about game engine development more thoroughly. I do not profit off any of these sales, these are just some books that have helped me out :)

My Recommended Game Engine Books:
Game Engine Architecture: https://www.gameenginebook.com/
Game Physics Cookbook (Read this before the next physics book): https://www.amazon.com/Game-Physics-C...
Game Physics (Ian Millington): https://www.amazon.com/Game-Physics-E...
Game Programming Patterns (Free): https://gameprogrammingpatterns.com/

My Recommended Beginning Game Programming Books:
JavaScript Game Design: https://www.apress.com/gp/book/978143...

My Recommended Java Books:
Data Structures/Algorithms: https://www.amazon.com/Data-Structure...
LWJGL (Free, but I haven't read this thoroughly): https://lwjglgamedev.gitbooks.io/3d-g...

show more

Share/Embed