Minecraft in C # (19 lines of code)
In continuation of the general, pre-New Year hysteria, I decided to write my toy. It is based on the game Minecraft, and the programming language C #.
The game has the following blocks:
- Air
- Water
- Land
- Stairs
- Bedrock
Opportunities:
- Water spreads over the accessible surface.
- Gravity affects character
- The character can create all blocks except the bedrock.
- Character can destroy land and stairs
Update1:
Added bedrock.')
Update2:
Removed the flicker and twitching of the screen.Update3:
Added a binary demo.Picture to attract attention:
Control:
- WSAD - character movement
- WSAD + Shift - remove blocks in the appropriate direction
- 1 2 3 4 - creating blocks of air, earth, stairs and water
When creating the code, I didn’t use “dishonest” tricks to reduce the size and adhered to the following codecode:
- There is no more than one assignment on each line and no more than one semicolon respectively.
- When using statements such as for, the body is on a separate line.
- If curly brackets are used, then each curly brace on its own line
- Named constants
- The code is documented!
GoggleCode source codeThank you all for your attention!
Source: https://habr.com/ru/post/202840/
All Articles