Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gameplay optimizations. Part 1 #9

Merged
merged 10 commits into from
Jul 21, 2022

Conversation

Timofffee
Copy link

A small but large list of improvements:

  1. Slabs. Now the player jumps on them automatically. (Fix You can only jump on the half-blocks #4)
  2. You can now put another half-block on the half-block and then they will be replaced with an alternative block.
  3. The raycast now also returns normal. This added a lot of opportunities and saved from unpleasant consequences. However, the raycast may still work somewhat incorrectly on the edges of the blocks.
  4. The raycast additionally checks whether it has hit the block.
  5. Now the raycast has the ignoreLiquid parameter, which allows you to ignore liquid blocks. Now this is quite enough, but in the future you will most likely have to use something like a mask.
  6. In fact, this is a continuation of 2. Now you can choose the block installation logic for each block. As an example, now flowers can only be placed on the ground, grass or sand.
  7. Now, after placed block, there is a check for a collision of the block with the player.
  8. The player can no longer jump while in the air.
  9. Player movement is now normalized. Previously, the player could move faster by holding down 2 keys.
  10. Fixed the size of the player's collider. (Fix Wrong player collision size #5)
  11. The maximum shadow is now not so dark. (Part Bug with lighting #2)
  12. Lava now has colliderType = BlockColliderType_Liquid

Also, some things that worked well before my changes were made were corrected. In addition, I had to copy some of the code from the raylib master branch, since they should appear only in a future version (I needed the Vector3ClampValue() function, which is not in raylib 4.0.0).

image

game_gp5hTUBGH5.mp4

@Sirvoid Sirvoid merged commit ac4fe16 into Sirvoid:main Jul 21, 2022
@Sirvoid
Copy link
Owner

Sirvoid commented Jul 21, 2022

Awesome, thanks! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong player collision size You can only jump on the half-blocks
2 participants