fixed boss and added tutorial
This commit is contained in:
parent
11856156fd
commit
6df16a9a68
@ -78,9 +78,11 @@ public class Npc extends Person {
|
|||||||
int direction = Integer.parseInt(imageInfo[2]);
|
int direction = Integer.parseInt(imageInfo[2]);
|
||||||
int offsetX = Integer.parseInt(imageInfo[3]);
|
int offsetX = Integer.parseInt(imageInfo[3]);
|
||||||
int offsetY = Integer.parseInt(imageInfo[4]);
|
int offsetY = Integer.parseInt(imageInfo[4]);
|
||||||
|
int widthCoef = Integer.parseInt(imageInfo[5]);
|
||||||
|
int heightCoef = Integer.parseInt(imageInfo[6]);
|
||||||
image = ImageIO.read(new File("src/main/resources/characters/" + scanner.nextLine())).getSubimage(width * direction, 0, width, height);
|
image = ImageIO.read(new File("src/main/resources/characters/" + scanner.nextLine())).getSubimage(width * direction, 0, width, height);
|
||||||
g.drawImage(image, getX() * getSize() + (getSize() / 5) + offsetX,
|
g.drawImage(image, getX() * getSize() + (getSize() / 5) + offsetX,
|
||||||
getY() * getSize() - (getSize() * 3/5) + offsetY, getSize() * 3/5, getSize() * 3/2, null);
|
getY() * getSize() - (getSize() * 3/5) + offsetY, getSize() * widthCoef/5, getSize() * heightCoef/2, null);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -216,8 +216,10 @@ public class Person extends Cell {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
distanceOfAnimation = getSize();
|
distanceOfAnimation = getSize();
|
||||||
// g.drawImage(imagePerson.getImagesOfDirection()[directionSight + 4], getX() * getSize(),
|
if (map.getName().equals("tutorial"))
|
||||||
// getY() * getSize(), getSize(), getSize(), null);
|
g.drawImage(imagePerson.getImagesOfDirection()[directionSight + 4], getX() * getSize() + (getSize() / 10),
|
||||||
|
getY() * getSize(), getSize() * 8/10, getSize(), null);
|
||||||
|
else
|
||||||
g.drawImage(imagePerson.getImagesOfDirection()[directionSight + 4], getX() * getSize(),
|
g.drawImage(imagePerson.getImagesOfDirection()[directionSight + 4], getX() * getSize(),
|
||||||
getY() * getSize() - (getSize() * 3/5), getSize(), getSize() * 3/2, null);
|
getY() * getSize() - (getSize() * 3/5), getSize(), getSize() * 3/2, null);
|
||||||
}
|
}
|
||||||
@ -240,19 +242,22 @@ public class Person extends Cell {
|
|||||||
Xsize -= distanceOfAnimation;
|
Xsize -= distanceOfAnimation;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// if (distanceOfAnimation > getSize() * 3 / 4) {
|
if (map.getName().equals("tutorial")) {
|
||||||
// g.drawImage(imagePerson.getImagesOfDirection()[direction], getX() * getSize() + Xsize,
|
if (distanceOfAnimation > getSize() * 3 / 4) {
|
||||||
// getY() * getSize() + Ysize, getSize(), getSize(), null);
|
g.drawImage(imagePerson.getImagesOfDirection()[direction], getX() * getSize() + (getSize() / 10),
|
||||||
// } else if (distanceOfAnimation > getSize() / 2) {
|
getY() * getSize(), getSize() * 8/10, getSize(), null);
|
||||||
// g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + Xsize,
|
} else if (distanceOfAnimation > getSize() / 2) {
|
||||||
// getY() * getSize() + Ysize, getSize(), getSize(), null);
|
g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + (getSize() / 10),
|
||||||
// } else if (distanceOfAnimation > getSize() / 4) {
|
getY() * getSize(), getSize() * 8/10, getSize(), null);
|
||||||
// g.drawImage(imagePerson.getImagesOfDirection()[direction + 8], getX() * getSize() + Xsize,
|
} else if (distanceOfAnimation > getSize() / 4) {
|
||||||
// getY() * getSize() + Ysize, getSize(), getSize(), null);
|
g.drawImage(imagePerson.getImagesOfDirection()[direction + 8], getX() * getSize() + (getSize() / 10),
|
||||||
// } else{
|
getY() * getSize(), getSize() * 8/10, getSize(), null);
|
||||||
// g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + Xsize,
|
} else {
|
||||||
// getY() * getSize() + Ysize, getSize(), getSize(), null);
|
g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + (getSize() / 10),
|
||||||
// }
|
getY() * getSize(), getSize() * 8/10, getSize(), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
if (distanceOfAnimation > getSize() * 3 / 4) {
|
if (distanceOfAnimation > getSize() * 3 / 4) {
|
||||||
g.drawImage(imagePerson.getImagesOfDirection()[direction], getX() * getSize() + Xsize,
|
g.drawImage(imagePerson.getImagesOfDirection()[direction], getX() * getSize() + Xsize,
|
||||||
getY() * getSize() + Ysize - (getSize() * 3 / 5), getSize(), getSize() * 3 / 2, null);
|
getY() * getSize() + Ysize - (getSize() * 3 / 5), getSize(), getSize() * 3 / 2, null);
|
||||||
@ -267,6 +272,7 @@ public class Person extends Cell {
|
|||||||
getY() * getSize() + Ysize - (getSize() * 3 / 5), getSize(), getSize() * 3 / 2, null);
|
getY() * getSize() + Ysize - (getSize() * 3 / 5), getSize(), getSize() * 3 / 2, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getIsMoving() {
|
public boolean getIsMoving() {
|
||||||
return isMoving;
|
return isMoving;
|
||||||
|
|||||||
@ -74,7 +74,8 @@ public class LoadManager {
|
|||||||
while (scanner.hasNextLine()) {
|
while (scanner.hasNextLine()) {
|
||||||
String mapName = scanner.nextLine();
|
String mapName = scanner.nextLine();
|
||||||
Map map = Map.loadMapFromFile(mapName, window);
|
Map map = Map.loadMapFromFile(mapName, window);
|
||||||
map.getPerson().setImagePerson("main", rec);
|
if (mapName.equals("tutorial")) map.getPerson().setImagePerson("tutorialpers", rec);
|
||||||
|
else map.getPerson().setImagePerson("main", rec);
|
||||||
map.setName(mapName);
|
map.setName(mapName);
|
||||||
mapLinkedList.add(map);
|
mapLinkedList.add(map);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
4 2 boss
|
4 2 boss
|
||||||
50 91 0 0 30
|
50 91 0 -10 30 5 3
|
||||||
boss.png
|
boss.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
17 20 openspace
|
17 20 openspace
|
||||||
35 86 1 0 30
|
35 86 1 0 30 3 3
|
||||||
boy1.png
|
boy1.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
5 1 openspace
|
5 1 openspace
|
||||||
35 86 0 0 0
|
35 86 0 0 0 3 3
|
||||||
boy2.png
|
boy2.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
4 12 openspace
|
4 12 openspace
|
||||||
35 84 0 0 0
|
35 84 0 0 0 3 3
|
||||||
boy3.png
|
boy3.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
2 20 openspace
|
2 20 openspace
|
||||||
35 84 1 0 30
|
35 84 1 0 30 3 3
|
||||||
boy4.png
|
boy4.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
12 20 openspace
|
12 20 openspace
|
||||||
35 86 1 0 30
|
35 86 1 0 30 3 3
|
||||||
boy5.png
|
boy5.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
6 1 openspace
|
6 1 openspace
|
||||||
35 86 2 0 0
|
35 86 2 0 0 3 3
|
||||||
girl1.png
|
girl1.png
|
||||||
@ -1,3 +1,3 @@
|
|||||||
7 24 openspace
|
7 24 openspace
|
||||||
35 86 1 0 30
|
35 86 1 0 30 3 3
|
||||||
girl2.png
|
girl2.png
|
||||||
2
src/main/resources/characters/tutorialpers.txt
Normal file
2
src/main/resources/characters/tutorialpers.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
40 40
|
||||||
|
mainpng.png
|
||||||
@ -7,5 +7,5 @@ BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY MOVETO,7,4,openspace
|
|||||||
BLOCK EMPTY EMPTY INTER,first-dialog EMPTY INTER,dialog-test EMPTY EMPTY EMPTY BLOCK
|
BLOCK EMPTY EMPTY INTER,first-dialog EMPTY INTER,dialog-test EMPTY EMPTY EMPTY BLOCK
|
||||||
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
BLOCK MOVETO,5,1,m5 EMPTY MOVETO,6,1,m6 EMPTY EMPTY EMPTY EMPTY MOVETO,1,1,m2 BLOCK
|
BLOCK MOVETO,5,1,tutorial EMPTY MOVETO,6,1,m6 EMPTY EMPTY EMPTY EMPTY MOVETO,1,1,m2 BLOCK
|
||||||
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
|
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
|
||||||
@ -1,10 +0,0 @@
|
|||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
0 0 0 0 0 0 0 0 0 0
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<tileset> A2_Ground.png 512 384 32
|
|
||||||
<tileset> D_OutDoor.png 512 512 32
|
|
||||||
1 1 1 1 1 1 1 1 1 1
|
|
||||||
1 1 1 1 1 1 1 1 1 1
|
|
||||||
1 1 82 94 1 1 82 94 1 1
|
|
||||||
1 1 83 95 1 1 83 95 1 1
|
|
||||||
1 1 1 1 1 1 1 1 1 1
|
|
||||||
1 1 153 1 1 1 1 153 1 1
|
|
||||||
1 1 153 153 153 153 153 1 1 1
|
|
||||||
1 1 1 1 1 1 1 1 1 1
|
|
||||||
1 1 1 1 1 1 1 1 1 1
|
|
||||||
1 1 1 1 1 1 1 1 1 1
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
10 10
|
|
||||||
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
|
|
||||||
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
|
|
||||||
EMPTY EMPTY EMPTY BLOCK MOVETO,5,3,m1 BLOCK EMPTY EMPTY EMPTY EMPTY
|
|
||||||
EMPTY EMPTY EMPTY BLOCK SPAWN BLOCK EMPTY EMPTY EMPTY EMPTY
|
|
||||||
EMPTY EMPTY EMPTY BLOCK BLOCK BLOCK EMPTY EMPTY EMPTY EMPTY
|
|
||||||
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
|
|
||||||
BLOCK EMPTY EMPTY BLOCK BLOCK BLOCK EMPTY BLOCK EMPTY EMPTY
|
|
||||||
BLOCK EMPTY EMPTY BLOCK EMPTY BLOCK EMPTY BLOCK EMPTY EMPTY
|
|
||||||
BLOCK BLOCK EMPTY BLOCK BLOCK BLOCK EMPTY BLOCK BLOCK EMPTY
|
|
||||||
EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY
|
|
||||||
13
src/main/resources/maps/tutorial-objectset.txt
Normal file
13
src/main/resources/maps/tutorial-objectset.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
|
0 0 0 0 0 0 0 0 0 0 0 0 0
|
||||||
16
src/main/resources/maps/tutorial-tileset.txt
Normal file
16
src/main/resources/maps/tutorial-tileset.txt
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<tileset> A2_Ground.png 512 384 32 192
|
||||||
|
<tileset> D_OutDoor.png 512 512 32 256
|
||||||
|
<tileset> tutorialtiles.png 288 96 32 448
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 448 451 454 457 460 463 466 469 472 1 1
|
||||||
|
1 1 449 452 455 458 461 464 467 470 473 1 1
|
||||||
|
1 1 450 453 456 459 462 465 468 471 474 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
|
1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||||
14
src/main/resources/maps/tutorial.txt
Normal file
14
src/main/resources/maps/tutorial.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
13 13
|
||||||
|
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY MOVETO,5,4,m1 BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY EMPTY BLOCK
|
||||||
|
BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK BLOCK
|
||||||
@ -2,8 +2,8 @@ m1
|
|||||||
m2
|
m2
|
||||||
m3
|
m3
|
||||||
m4
|
m4
|
||||||
m5
|
|
||||||
m6
|
m6
|
||||||
|
tutorial
|
||||||
openspace
|
openspace
|
||||||
office
|
office
|
||||||
boss
|
boss
|
||||||
|
|||||||
@ -0,0 +1,90 @@
|
|||||||
|
<map>
|
||||||
|
<mapName>m1</mapName>
|
||||||
|
<events>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>m2</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>7</x>
|
||||||
|
<y>2</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>m3</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>2</x>
|
||||||
|
<y>5</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>m4</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>3</x>
|
||||||
|
<y>3</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>m6</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>11</x>
|
||||||
|
<y>11</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>tutorial</mapName>
|
||||||
|
<events>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>openspace</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>7</x>
|
||||||
|
<y>4</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
<chest>
|
||||||
|
<x>15</x>
|
||||||
|
<y>7</y>
|
||||||
|
<active>true</active>
|
||||||
|
</chest>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>office</mapName>
|
||||||
|
<events>
|
||||||
|
<chest>
|
||||||
|
<x>1</x>
|
||||||
|
<y>9</y>
|
||||||
|
<active>true</active>
|
||||||
|
</chest>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>boss</mapName>
|
||||||
|
<events>
|
||||||
|
<trigger>
|
||||||
|
<x>4</x>
|
||||||
|
<y>18</y>
|
||||||
|
<active>true</active>
|
||||||
|
</trigger>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
|
<map>
|
||||||
|
<mapName>treasure</mapName>
|
||||||
|
<events>
|
||||||
|
</events>
|
||||||
|
</map>
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
<location>
|
||||||
|
<map>openspace</map>
|
||||||
|
<x>8</x>
|
||||||
|
<y>16</y>
|
||||||
|
<direction>3</direction>
|
||||||
|
</location>
|
||||||
@ -0,0 +1 @@
|
|||||||
|
TODO: Village
|
||||||
BIN
src/main/resources/tutorialtiles.png
Normal file
BIN
src/main/resources/tutorialtiles.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user