summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4b230b)
raw | patch | inline | side by side (parent: d4b230b)
author | fred-boy <fred-boy@protonmail.com> | |
Thu, 26 Apr 2018 07:35:48 +0000 (14:35 +0700) | ||
committer | fred-boy <fred-boy@protonmail.com> | |
Thu, 26 Apr 2018 07:35:48 +0000 (14:35 +0700) |
diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameInput.java b/core/src/ru/deadsoftware/cavecraft/game/GameInput.java
index 08f6e368f0fbb067a821b962f68594412be56aa5..9aa90f2b1d335a64d16e1e49ac8bbf3f39366e80 100644 (file)
screenY<gameProc.renderer.camera.viewportHeight/2+Assets.creativeInv.getRegionHeight()/2) {
int ix = (int) (screenX - (gameProc.renderer.camera.viewportWidth / 2 - Assets.creativeInv.getRegionWidth() / 2 + 8)) / 18;
int iy = (int) (screenY - (gameProc.renderer.camera.viewportHeight / 2 - Assets.creativeInv.getRegionHeight() / 2 + 18)) / 18;
- int item = gameProc.creativeScroll*40+(ix + iy * 8);
+ int item = gameProc.creativeScroll*8+(ix + iy * 8);
if (ix>=8 || ix<0 || iy<0 || iy>=5) item=-1;
if (item >= 0 && item < Items.BLOCKS.size) {
for (int i = 8; i > 0; i--) {
screenX<gameProc.renderer.camera.viewportWidth/2+Assets.creativeInv.getRegionWidth()/2 &&
screenY>gameProc.renderer.camera.viewportHeight/2-Assets.creativeInv.getRegionHeight()/2 &&
screenY<gameProc.renderer.camera.viewportHeight/2+Assets.creativeInv.getRegionHeight()/2) {
- if (screenX<gameProc.renderer.camera.viewportWidth/2+Assets.creativeInv.getRegionWidth()/2-24)
- gameProc.creativeScroll -= (screenY - gameProc.touchDownY) / 16;
- else gameProc.creativeScroll += (screenY - gameProc.touchDownY) / 16;
+ gameProc.creativeScroll -= (screenY - gameProc.touchDownY) / 16;
gameProc.touchDownX = screenX;
gameProc.touchDownY = screenY;
if (gameProc.creativeScroll < 0) gameProc.creativeScroll = 0;
diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameProc.java b/core/src/ru/deadsoftware/cavecraft/game/GameProc.java
index 5ba62a2e1307fc7dd16e0169dc0624960ce46217..4b841bd47af0fd7103b3ac70b50f9cd73e67adc4 100644 (file)
renderer = new GameRenderer(this,480,
480*((float)GameScreen.getHeight()/GameScreen.getWidth()));
}
- maxCreativeScroll = Items.BLOCKS.size/40;
+ maxCreativeScroll = Items.BLOCKS.size/8;
GameSaver.save(this);
}
diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java b/core/src/ru/deadsoftware/cavecraft/game/GameRenderer.java
index 3ba99c3ec2c999dc7faa9866e3cb3bc5cc1d4430..38680f94db6ddf347491736c18872f5c80e544b1 100644 (file)
spriteBatch.draw(Assets.creativeInv, x, y);
spriteBatch.draw(Assets.creativeScroll, x+156,
y+18+(gameProc.creativeScroll*(72/gameProc.maxCreativeScroll)));
- for (int i=gameProc.creativeScroll*40; i<(gameProc.creativeScroll+1)*40; i++) {
+ for (int i=gameProc.creativeScroll*8; i<(gameProc.creativeScroll+1)*40; i++) {
if (i>0 && i<Items.BLOCKS.size)
spriteBatch.draw(Assets.blockTextures[Items.BLOCKS.getValueAt(i).getTexture()],
- x+8+((i-gameProc.creativeScroll*40)%8)*18,
- y+18+((i-gameProc.creativeScroll*40)/8)*18);
+ x+8+((i-gameProc.creativeScroll*8)%8)*18,
+ y+18+((i-gameProc.creativeScroll*8)/8)*18);
}
for (int i=0; i<9; i++) {
if (gameProc.player.inventory[i]>0)