fixed boss and added tutorial

This commit is contained in:
musilto9 2020-04-16 00:54:19 +02:00
parent 11856156fd
commit 6df16a9a68
25 changed files with 191 additions and 73 deletions

View File

@ -78,9 +78,11 @@ public class Npc extends Person {
int direction = Integer.parseInt(imageInfo[2]);
int offsetX = Integer.parseInt(imageInfo[3]);
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);
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) {
e.printStackTrace();
}

View File

@ -216,8 +216,10 @@ public class Person extends Cell {
}
} else {
distanceOfAnimation = getSize();
// g.drawImage(imagePerson.getImagesOfDirection()[directionSight + 4], getX() * getSize(),
// getY() * getSize(), getSize(), getSize(), null);
if (map.getName().equals("tutorial"))
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(),
getY() * getSize() - (getSize() * 3/5), getSize(), getSize() * 3/2, null);
}
@ -240,19 +242,22 @@ public class Person extends Cell {
Xsize -= distanceOfAnimation;
break;
}
// if (distanceOfAnimation > getSize() * 3 / 4) {
// g.drawImage(imagePerson.getImagesOfDirection()[direction], getX() * getSize() + Xsize,
// getY() * getSize() + Ysize, getSize(), getSize(), null);
// } else if (distanceOfAnimation > getSize() / 2) {
// g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + Xsize,
// getY() * getSize() + Ysize, getSize(), getSize(), null);
// } else if (distanceOfAnimation > getSize() / 4) {
// g.drawImage(imagePerson.getImagesOfDirection()[direction + 8], getX() * getSize() + Xsize,
// getY() * getSize() + Ysize, getSize(), getSize(), null);
// } else{
// g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + Xsize,
// getY() * getSize() + Ysize, getSize(), getSize(), null);
// }
if (map.getName().equals("tutorial")) {
if (distanceOfAnimation > getSize() * 3 / 4) {
g.drawImage(imagePerson.getImagesOfDirection()[direction], getX() * getSize() + (getSize() / 10),
getY() * getSize(), getSize() * 8/10, getSize(), null);
} else if (distanceOfAnimation > getSize() / 2) {
g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + (getSize() / 10),
getY() * getSize(), getSize() * 8/10, getSize(), null);
} else if (distanceOfAnimation > getSize() / 4) {
g.drawImage(imagePerson.getImagesOfDirection()[direction + 8], getX() * getSize() + (getSize() / 10),
getY() * getSize(), getSize() * 8/10, getSize(), null);
} else {
g.drawImage(imagePerson.getImagesOfDirection()[direction + 4], getX() * getSize() + (getSize() / 10),
getY() * getSize(), getSize() * 8/10, getSize(), null);
}
}
else {
if (distanceOfAnimation > getSize() * 3 / 4) {
g.drawImage(imagePerson.getImagesOfDirection()[direction], getX() * getSize() + Xsize,
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);
}
}
}
public boolean getIsMoving() {
return isMoving;

View File

@ -74,7 +74,8 @@ public class LoadManager {
while (scanner.hasNextLine()) {
String mapName = scanner.nextLine();
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);
mapLinkedList.add(map);
}

View File

@ -1,3 +1,3 @@
4 2 boss
50 91 0 0 30
50 91 0 -10 30 5 3
boss.png

View File

@ -1,3 +1,3 @@
17 20 openspace
35 86 1 0 30
35 86 1 0 30 3 3
boy1.png

View File

@ -1,3 +1,3 @@
5 1 openspace
35 86 0 0 0
35 86 0 0 0 3 3
boy2.png

View File

@ -1,3 +1,3 @@
4 12 openspace
35 84 0 0 0
35 84 0 0 0 3 3
boy3.png

View File

@ -1,3 +1,3 @@
2 20 openspace
35 84 1 0 30
35 84 1 0 30 3 3
boy4.png

View File

@ -1,3 +1,3 @@
12 20 openspace
35 86 1 0 30
35 86 1 0 30 3 3
boy5.png

View File

@ -1,3 +1,3 @@
6 1 openspace
35 86 2 0 0
35 86 2 0 0 3 3
girl1.png

View File

@ -1,3 +1,3 @@
7 24 openspace
35 86 1 0 30
35 86 1 0 30 3 3
girl2.png

View File

@ -0,0 +1,2 @@
40 40
mainpng.png

View File

@ -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 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

View File

@ -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

View File

@ -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

View File

@ -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

View 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

View 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

View 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

View File

@ -2,8 +2,8 @@ m1
m2
m3
m4
m5
m6
tutorial
openspace
office
boss

View File

@ -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>

View File

@ -0,0 +1,6 @@
<location>
<map>openspace</map>
<x>8</x>
<y>16</y>
<direction>3</direction>
</location>

View File

@ -0,0 +1 @@
TODO: Village

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB