• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

無人機動兵器ダンジョン探索ゲーム JAVAベース


Commit MetaInfo

Revisão44 (tree)
Hora2015-07-24 17:38:19
Autormanjihq

Mensagem de Log

タイルの基本サイズをブランクフロアタイルから取得、基本サイズに応じて各種タイルを変形して表示するようにした
弾丸タイルを他のタイルと同じ大きさに表示する様に変更

Mudança Sumário

Diff

--- CarnageHack2/trunk/src/CarnageHack/CarnageHack.java (revision 43)
+++ CarnageHack2/trunk/src/CarnageHack/CarnageHack.java (revision 44)
@@ -25,7 +25,7 @@
2525 */
2626 public final class CarnageHack extends Panel implements ActionListener {
2727
28- public static final String version = "CarnageHack2 V1.4.0 alpha";
28+ public static final String version = "CarnageHack2 V1.5.0 alpha";
2929 public static final ResourceBundle resource;
3030 public static CHArrayList main_weapon_list;
3131 public static CHArrayList sub_weapon_list;
--- CarnageHack2/trunk/src/CarnageHack/CHviewSplash.java (revision 43)
+++ CarnageHack2/trunk/src/CarnageHack/CHviewSplash.java (revision 44)
@@ -49,10 +49,12 @@
4949 public void paint(Graphics g) {
5050 int y = 0;
5151 int n;
52+ int cx;
5253 n = FloorTile.startup_image(g, 0, y, 256, this);
53- y += ((n / 16) + 1) * 16;
54+ cx = 256 / FloorTile.tileBaseX;
55+ y += ((n / cx) + 1) * FloorTile.tileBaseY;
5456 n = OkeDungeon.startup_image(g, 0, y, 256, this);
55- y += ((n / 16) + 1) * 16;
57+ y += ((n / cx) + 1) * FloorTile.tileBaseY;
5658 n = OkeSoftChipPanel.startup_image(g, 0, y, 256, this);
5759 y += ((n / 8) + 1) * 32;
5860 g.drawImage(banner, 0, y, this);
--- CarnageHack2/trunk/src/CarnageHack/DungeonFloor.java (revision 43)
+++ CarnageHack2/trunk/src/CarnageHack/DungeonFloor.java (revision 44)
@@ -428,9 +428,11 @@
428428 for (y = 0; y < cy; y++) {
429429 if (x + bx > 0 && x + bx < FLOOR_X && y + by > 0 && y + by
430430 < FLOOR_Y) {
431- tile[x + bx][y + by].draw(g, x * 16, y * 16, compo);
431+ tile[x + bx][y + by].draw(g, x * FloorTile.tileBaseX,
432+ y * FloorTile.tileBaseY, compo);
432433 } else {
433- wall.draw(g, x * 16, y * 16, compo);
434+ wall.draw(g, x * FloorTile.tileBaseX,
435+ y * FloorTile.tileBaseY, compo);
434436 }
435437 }
436438 }
--- CarnageHack2/trunk/src/CarnageHack/OkeBullette.java (revision 43)
+++ CarnageHack2/trunk/src/CarnageHack/OkeBullette.java (revision 44)
@@ -292,7 +292,9 @@
292292 break;
293293 }
294294 if (icon != null) {
295- g.drawImage(icon, (x - bx) * 16, (y - by) * 16, compo);
295+ g.drawImage(icon, (x - bx) * FloorTile.tileBaseX,
296+ (y - by) * FloorTile.tileBaseY,
297+ FloorTile.tileBaseX, FloorTile.tileBaseY, compo);
296298 }
297299 }
298300 }
--- CarnageHack2/trunk/src/CarnageHack/OkeDungeon.java (revision 43)
+++ CarnageHack2/trunk/src/CarnageHack/OkeDungeon.java (revision 44)
@@ -70,11 +70,13 @@
7070 for (i = 0; i < 8; i++) {
7171 tsukikage[i]
7272 = tk.getImage(obj.getClass().
73- getResource("tile/tsukikage" + dir_word[i] + ".png"));
73+ getResource("tile/tsukikage" + dir_word[i]
74+ + ".png"));
7475 mt.addImage(tsukikage[i], 0);
7576 tsukikage2[i]
7677 = tk.getImage(obj.getClass().
77- getResource("tile/tsukikage2" + dir_word[i] + ".png"));
78+ getResource("tile/tsukikage2" + dir_word[i]
79+ + ".png"));
7880 mt.addImage(tsukikage2[i], 0);
7981 }
8082 explosion
@@ -96,35 +98,38 @@
9698 ImageObserver obs) {
9799 int i;
98100 int n = 0;
99- g.drawImage(hige, x, y, obs);
100- x += 16;
101+ g.drawImage(hige, x, y, FloorTile.tileBaseX, FloorTile.tileBaseY, obs);
102+ x += FloorTile.tileBaseX;
101103 if (x >= cx) {
102104 x = 0;
103- y += 16;
105+ y += FloorTile.tileBaseY;
104106 }
105107 n++;
106- g.drawImage(explosion, x, y, obs);
107- x += 16;
108+ g.drawImage(explosion, x, y, FloorTile.tileBaseX, FloorTile.tileBaseY,
109+ obs);
110+ x += FloorTile.tileBaseX;
108111 if (x >= cx) {
109112 x = 0;
110- y += 16;
113+ y += FloorTile.tileBaseY;
111114 }
112115 n++;
113116 for (i = 0; i < 8; i++) {
114- g.drawImage(tsukikage[i], x, y, obs);
115- x += 16;
117+ g.drawImage(tsukikage[i], x, y,
118+ FloorTile.tileBaseX, FloorTile.tileBaseY, obs);
119+ x += FloorTile.tileBaseX;
116120 if (x >= cx) {
117121 x = 0;
118- y += 16;
122+ y += FloorTile.tileBaseY;
119123 }
120124 n++;
121125 }
122126 for (i = 0; i < 8; i++) {
123- g.drawImage(tsukikage2[i], x, y, obs);
124- x += 16;
127+ g.drawImage(tsukikage2[i], x, y,
128+ FloorTile.tileBaseX, FloorTile.tileBaseY, obs);
129+ x += FloorTile.tileBaseX;
125130 if (x >= cx) {
126131 x = 0;
127- y += 16;
132+ y += FloorTile.tileBaseY;
128133 }
129134 n++;
130135 }
@@ -278,8 +283,8 @@
278283 int x;
279284 int y;
280285 Dimension winsize = getSize();
281- int view_x = winsize.width / 16;
282- int view_y = winsize.height / 16;
286+ int view_x = winsize.width / FloorTile.tileBaseX;
287+ int view_y = winsize.height / FloorTile.tileBaseY;
283288 Image offscreen = createImage(winsize.width, winsize.height);
284289 Graphics g = offscreen.getGraphics();
285290 nowdraw = true;
@@ -330,7 +335,9 @@
330335 if (x >= basex && x < basex + view_x && y >= basey && y < basey
331336 + view_y) {
332337 g.drawImage(icon,
333- (x - basex) * 16, (y - basey) * 16, this);
338+ (x - basex) * FloorTile.tileBaseX,
339+ (y - basey) * FloorTile.tileBaseY,
340+ FloorTile.tileBaseX, FloorTile.tileBaseY, this);
334341 }
335342 }
336343 }
@@ -351,7 +358,9 @@
351358 //
352359 //draw higeoyaji
353360 if (havehige == false && higefloor == current_floor) {
354- g.drawImage(hige, (higex - basey) * 16, (higey - basey) * 16, this);
361+ g.drawImage(hige, (higex - basey) * FloorTile.tileBaseX,
362+ (higey - basey) * FloorTile.tileBaseY,
363+ FloorTile.tileBaseX, FloorTile.tileBaseY, this);
355364 }
356365 //
357366 nowdraw = false;
@@ -1210,8 +1219,8 @@
12101219 }
12111220 } else if ((e.getModifiers() & (MouseEvent.BUTTON2_MASK
12121221 | MouseEvent.BUTTON3_MASK)) != 0) {
1213- int x = dungeon.get_basex() + e.getX() / 16;
1214- int y = dungeon.get_basey() + e.getY() / 16;
1222+ int x = dungeon.get_basex() + e.getX() / FloorTile.tileBaseX;
1223+ int y = dungeon.get_basey() + e.getY() / FloorTile.tileBaseY;
12151224 if (e.isShiftDown() == true) {
12161225 dungeon.set_lockview(false);
12171226 dungeon.set_viewoke(x, y);
@@ -1218,8 +1227,8 @@
12181227 } else {
12191228 Dimension winsize;
12201229 winsize = dungeon.getSize();
1221- x -= winsize.width / 16 / 2;
1222- y -= winsize.height / 16 / 2;
1230+ x -= winsize.width / FloorTile.tileBaseX / 2;
1231+ y -= winsize.height / FloorTile.tileBaseY / 2;
12231232 dungeon.set_lockview(true);
12241233 dungeon.set_base(x, y);
12251234 }
--- CarnageHack2/trunk/src/CarnageHack/FloorTile.java (revision 43)
+++ CarnageHack2/trunk/src/CarnageHack/FloorTile.java (revision 44)
@@ -1,6 +1,5 @@
11 package CarnageHack;
22
3-import java.awt.Color;
43 import java.awt.Component;
54 import java.awt.Graphics;
65 import java.awt.Image;
@@ -24,6 +23,8 @@
2423 static Image upstairs;
2524 static Image downstairs;
2625 static Image parts;
26+ static public int tileBaseX = 16;
27+ static public int tileBaseY = 16;
2728 int id;
2829 CHArrayList item;
2930
@@ -62,32 +63,42 @@
6263 static public int startup_image(Graphics g, int x, int y, int cx,
6364 ImageObserver obs) {
6465 int n = 0;
66+ int basex = blank.getWidth(obs);
67+ int basey = blank.getHeight(obs);
68+ if (basex != -1) {
69+ //取得できるはずだが念のため取得できた時にタイル幅を更新
70+ tileBaseX = basex;
71+ }
72+ if (basey != -1) {
73+ //取得できるはずだが念のため取得できた時にタイル長を更新
74+ tileBaseY = basey;
75+ }
6576 g.drawImage(blank, x, y, obs);
66- x += 16;
77+ x += tileBaseX;
6778 if (x >= cx) {
6879 x = 0;
69- y += 16;
80+ y += tileBaseY;
7081 }
7182 n++;
7283 g.drawImage(wall, x, y, obs);
73- x += 16;
84+ x += tileBaseX;
7485 if (x >= cx) {
7586 x = 0;
76- y += 16;
87+ y += tileBaseY;
7788 }
7889 n++;
7990 g.drawImage(upstairs, x, y, obs);
80- x += 16;
91+ x += tileBaseX;
8192 if (x >= cx) {
8293 x = 0;
83- y += 16;
94+ y += tileBaseY;
8495 }
8596 n++;
8697 g.drawImage(downstairs, x, y, obs);
87- x += 16;
98+ x += tileBaseX;
8899 if (x >= cx) {
89100 x = 0;
90- y += 16;
101+ y += tileBaseY;
91102 }
92103 n++;
93104 g.drawImage(parts, x, y, obs);
@@ -172,7 +183,8 @@
172183 }
173184 }
174185 if (icon != null) {
175- g.drawImage(icon, x, y, compo);
186+ g.drawImage(icon, x, y, FloorTile.tileBaseX, FloorTile.tileBaseY,
187+ compo);
176188 }
177189 }
178190 }