Comments (7)
Well documented. It's strange that it only happens at certain times of day, perhaps those are the times it's noticeable. It could have something to do with (float) --> (int) pixel conversions in world.draw(...).
from minicraft.
Where is this documented, for my future reference?
from minicraft.
I was saying you documented the bug well... Minicraft is woefully lacking in documentation mostly due to the way in which it was conceived.
Perhaps it wouldn't be a bad idea to document the genearl flow of the game for things like this...
from minicraft.
A quick check shows that casting is the issue
Changing:
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
int posX = (int) ((i - cameraX) * tileSize);
int posY = (int) ((j - cameraY) * tileSize);
To:
int cameraPosX = (int) (cameraX * tileSize);
int cameraPosY = (int) (cameraY * tileSize);
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
int posX = i * tileSize - cameraPosX;
int posY = j * tileSize - cameraPosY;
Pushes the gapped tiles together, but also causes many other problems, because everything it being drawn using the one transition function from StockMethods.computeDrawLocationInPlace(...) so other things end up being "off by a pixel". This will require further review.
from minicraft.
I switched drawing to all floats and stumbled across this, kind of a cool style!:
from minicraft.
Heh, nice! Maybe using doubles would fix it?
from minicraft.
Draw calls now simply have a round in them instead of an effective floor by the (int) call. This might slow things down a bit since it happens so often but for now it fixes this issue.
from minicraft.
Related Issues (17)
- Life Stats HOT 6
- Stand on top of wood
- Tile tinting HOT 6
- Achievements / Statistics
- Make inventories per-LivingEntity, instead of global HOT 1
- Load button crashes when no save file is present
- Toss objects toward the mouse HOT 1
- Add torches HOT 4
- Add Lava
- Port to Android
- Add Furnaces
- Allow placement of torches inside player's bounding box
- Can I add this to my Minicraft compilation?
- Escape key doesn't work on Mac HOT 2
- load item definitions from an external file HOT 1
- Use numeric IDs for items HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minicraft.