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

Add variable block hardness. Closes GH-17 #101

Merged
merged 5 commits into from
May 8, 2017
Merged

Add variable block hardness. Closes GH-17 #101

merged 5 commits into from
May 8, 2017

Conversation

satoshinm
Copy link
Owner

#17 Block-breaking time with block hardness and breaking animation (vs instamine)

@satoshinm
Copy link
Owner Author

satoshinm commented May 7, 2017

This basically works, but a visual block breaking progress indicator is necessary to let the player know there is progress being made and the game is not merely lagging (#100 Lag when mining/building many blocks repeatedly?)


To indicate the progress, should display an ever-increasing texture over the block textures. This only needs a textured quad, similar to text rendering. Or more to plant rendering? gen_plant_buffer() calls gen_faces(10, 4), two quads crosshatched:

screen shot 2017-05-07 at 2 30 36 pm

(not billboards, tutorial: http://www.opengl-tutorial.org/intermediate-tutorials/billboards-particles/billboards/)

gen_player_buffer() uses gen_faces(10, 6). 6 faces = cube, 4 for two quads, each side. The block-breaking indicator would only need 1 face.

@satoshinm satoshinm changed the title [WIP] Add variable block hardness. Closes GH-17 Add variable block hardness. Closes GH-17 May 8, 2017
@satoshinm
Copy link
Owner Author

Merging what I have for now, separated out the block breaking animation into #106

@satoshinm satoshinm merged commit 2829226 into master May 8, 2017
@satoshinm satoshinm deleted the hardness branch May 8, 2017 02:41
@satoshinm
Copy link
Owner Author

Note, 62b4f94 broke variable hardness since hit_test_face() returns a boolean (1 or 0), not the block type id! (todo: stdbool? good idea?). Changed to use _face() since wanted to draw the block break animation on the face, but GH-106 isn't implemented yet, and it breaks variable hardness, therefore reverted in #108 d502b94 as I found while implementing the block info text, it was always returning 1 not w.

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

Successfully merging this pull request may close these issues.

None yet

1 participant