Collision detector fixing on going, hangul combining (johab) font
Former-commit-id: d225fb399ea7ca6c80da1fa35db3c13a1505f1cc Former-commit-id: e218312c567bb7b2ea30961076e8bd24a8f2c131
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"smoothlighting" : true,
|
||||
"imtooyoungtodie" : false
|
||||
"imtooyoungtodie" : false,
|
||||
"language" : "enUS"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 342 B |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 620 B |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 158 B |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 738 B |
|
Before Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
BIN
res/graphics/fonts/han_johab.png
Normal file
|
After Width: | Height: | Size: 785 B |
BIN
res/graphics/fonts/han_johab_black.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 673 KiB After Width: | Height: | Size: 673 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 673 B |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 18 KiB |
BIN
res/graphics/gui/zoom_menu.png
Normal file
|
After Width: | Height: | Size: 383 B |
BIN
res/graphics/gui/zoom_menu.raw
Normal file
BIN
res/graphics/gui/zoom_menu12.raw
Normal file
@@ -1,7 +1,7 @@
|
||||
"STRING_ID";"IETF language tag(s) without dash";"enUS";"frFR";"esES";"deDE";"itIT";"ptBR";"ptPT";"ruRU";"elGR";"trTR";"daDK";"noNB";"svSE";"nlNL";"plPL";"fiFI";"jaJP";"zhCN";"zhTW";"koKR";"csCZ";"huHU";"roRO";"thTH";"bgBG";"heIL";"jakanaJP";"isIC"
|
||||
|
||||
"DEV_MEMORY_SHORT_CAP";;"MEM";"MEM";;;;;;;;;;;;;;;"メモリー";;;"메모리";;;;;;;"メモリー";"MIN"
|
||||
"DEV_MEMORY_A_OF_B";;"%1$sM out of %2$sM";"%1$sM sur %2$sM";;;;;;;;;;;;;;;"%2$sM中%1$sM";;;"%2$sM 중 %1$sM";;;;;;;"%2$sM ちゅう %1$sM";"%1$sM af %2$s"
|
||||
"DEV_MEMORY_A_OF_B";;"%1$sM out of %2$sM";"%1$sM sur %2$sM";;;;;;;;;;;;;;;"%2$sM中%1$sM";;;"%2$sM 중 %1$sM";;;;;;;"%2$sM ちゅう %1$sM";"%1$sM af %2$sM"
|
||||
|
||||
"DEV_COLOUR_LEGEND_GREEN";;" GREEN";" VERT";;;;;;;;;;;;;;;"緑";;;"녹";;;;;;;" みどり";"grænn"
|
||||
"DEV_COLOUR_LEGEND_BLUE";;" BLUE";" BLEU";;;;;;;;;;;;;;;"青";;;"청";;;;;;;" あお";"blár"
|
||||
|
||||
|
@@ -98,6 +98,25 @@ public class GameFontBase implements Font {
|
||||
return ret;
|
||||
}
|
||||
|
||||
private int getHanChosung(int hanIndex) {
|
||||
return hanIndex / (JUNG_COUNT * JONG_COUNT);
|
||||
}
|
||||
|
||||
private int getHanJungseong(int hanIndex) {
|
||||
return hanIndex / (JONG_COUNT) % JUNG_COUNT;
|
||||
}
|
||||
|
||||
private int getHanJongseong(int hanIndex) {
|
||||
return hanIndex % JONG_COUNT;
|
||||
}
|
||||
|
||||
private int getHanChosungShift(int hanIndex) {
|
||||
int jungseongIndex = getHanJungseong(hanIndex);
|
||||
Integer[] jungseongWide = {8, 12, 13, 17, 18, 21};
|
||||
return (Arrays.asList(jungseongWide).contains(jungseongIndex))
|
||||
? 1 : 0;
|
||||
}
|
||||
|
||||
private boolean isAsciiEF(char c) {
|
||||
return (Arrays.asList(asciiEFList).contains(c));
|
||||
}
|
||||
@@ -288,7 +307,8 @@ public class GameFontBase implements Font {
|
||||
public void drawString(float x, float y, String s) {
|
||||
// hangul fonts first
|
||||
hangulSheet.startUse();
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
// WANSEONG
|
||||
/*for (int i = 0; i < s.length(); i++) {
|
||||
char ch = s.charAt(i);
|
||||
|
||||
if (isHangul(ch)) {
|
||||
@@ -303,6 +323,53 @@ public class GameFontBase implements Font {
|
||||
, hanPos[1]
|
||||
);
|
||||
}
|
||||
}*/
|
||||
|
||||
// JOHAB
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char ch = s.charAt(i);
|
||||
|
||||
if (isHangul(ch)) {
|
||||
int hIndex = ch - 0xAC00;
|
||||
|
||||
int indexCho = getHanChosung(hIndex);
|
||||
int indexJung = getHanJungseong(hIndex);
|
||||
int indexJong = getHanJongseong(hIndex);
|
||||
|
||||
int choRow = getHanChosungShift(hIndex);
|
||||
int jungRow = 2;
|
||||
int jongRow = 3;
|
||||
|
||||
int glyphW = getWidth("" + ch);
|
||||
|
||||
// chosung
|
||||
hangulSheet.renderInUse(
|
||||
Math.round(x
|
||||
+ getWidthSubstr(s, i + 1) - glyphW
|
||||
)
|
||||
, Math.round((H - H_HANGUL) / 2 + y + 1)
|
||||
, indexCho
|
||||
, choRow
|
||||
);
|
||||
// jungseong
|
||||
hangulSheet.renderInUse(
|
||||
Math.round(x
|
||||
+ getWidthSubstr(s, i + 1) - glyphW
|
||||
)
|
||||
, Math.round((H - H_HANGUL) / 2 + y + 1)
|
||||
, indexJung
|
||||
, jungRow
|
||||
);
|
||||
// jongseong
|
||||
hangulSheet.renderInUse(
|
||||
Math.round(x
|
||||
+ getWidthSubstr(s, i + 1) - glyphW
|
||||
)
|
||||
, Math.round((H - H_HANGUL) / 2 + y + 1)
|
||||
, indexJong
|
||||
, jongRow
|
||||
);
|
||||
}
|
||||
}
|
||||
hangulSheet.endUse();
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class GameFontBlack extends GameFontBase {
|
||||
super();
|
||||
|
||||
hangulSheet = new SpriteSheet(
|
||||
"./res/graphics/fonts/han_atlas_black.png"
|
||||
"./res/graphics/fonts/han_johab_black.png"
|
||||
, W_CJK, H_HANGUL
|
||||
);
|
||||
asciiSheet = new SpriteSheet(
|
||||
|
||||
@@ -12,7 +12,7 @@ public class GameFontWhite extends GameFontBase {
|
||||
super();
|
||||
|
||||
hangulSheet = new SpriteSheet(
|
||||
"./res/graphics/fonts/han_atlas.png"
|
||||
"./res/graphics/fonts/han_johab.png"
|
||||
, W_CJK, H_HANGUL
|
||||
);
|
||||
asciiSheet = new SpriteSheet(
|
||||
|
||||
@@ -182,8 +182,14 @@ public class ActorWithBody implements Actor, Visible, Glowing {
|
||||
updateNextHitboxFromVelo();
|
||||
|
||||
|
||||
updateHorizontalPos();
|
||||
updateVerticalPos();
|
||||
if (Math.abs(veloX) < 0.5) {
|
||||
updateVerticalPos();
|
||||
updateHorizontalPos();
|
||||
}
|
||||
else {
|
||||
updateHorizontalPos();
|
||||
updateVerticalPos();
|
||||
}
|
||||
updateHitboxX();
|
||||
updateHitboxY();
|
||||
|
||||
@@ -358,7 +364,7 @@ public class ActorWithBody implements Actor, Visible, Glowing {
|
||||
} while (newXOff < TSIZE && colliding);
|
||||
|
||||
float newX = nextHitbox.getPosX() + newXOff;
|
||||
nextHitbox.setPosition(newX, newY);
|
||||
nextHitbox.setPosition(newX + 1, newY);
|
||||
}
|
||||
|
||||
private boolean isColliding(int side) {
|
||||
|
||||
@@ -62,7 +62,7 @@ public class PBFSigrid {
|
||||
|
||||
p.actorValue.set("luminosity", 22819);
|
||||
|
||||
p.setHitboxDimension(18, 47, 8, 0);
|
||||
p.setHitboxDimension(18, 46, 8, 0);
|
||||
|
||||
p.inventory = new ActorInventory(0x7FFFFFFF, true);
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
|
||||
* @param absAxisVal (set AXIS_POSMAX if keyboard controlled)
|
||||
*/
|
||||
private void walkHorizontal(boolean left, float absAxisVal) {
|
||||
if ((!super.isWalledLeft() && left) || (!super.isWalledRight() && !left)) {
|
||||
//if ((!super.isWalledLeft() && left) || (!super.isWalledRight() && !left)) {
|
||||
readonly_totalX = super.getVeloX()
|
||||
+
|
||||
actorValue.getAsFloat("accel")
|
||||
@@ -132,7 +132,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
|
||||
// Heading flag
|
||||
if (left) walkHeading = LEFT;
|
||||
else walkHeading = RIGHT;
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,7 @@ public class Terrarum extends StateBasedGame {
|
||||
public static String defaultDir;
|
||||
public static String defaultSaveDir;
|
||||
|
||||
public static String gameLocale = "isIC";
|
||||
public static String gameLocale = ""; // locale override
|
||||
|
||||
public static Font gameFontWhite;
|
||||
|
||||
@@ -70,6 +70,22 @@ public class Terrarum extends StateBasedGame {
|
||||
catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// TODO if config language is not defined
|
||||
if (gameLocale.length() < 2) { // get system language if not overridden
|
||||
String lan = System.getProperty("user.language");
|
||||
String country = System.getProperty("user.country");
|
||||
|
||||
// exception handling
|
||||
if (lan.equals("en")) country = "US";
|
||||
else if (lan.equals("fr")) country = "FR";
|
||||
else if (lan.equals("de")) country = "DE";
|
||||
else if (lan.equals("ko")) country = "KR";
|
||||
|
||||
gameLocale = lan + country;
|
||||
}
|
||||
|
||||
System.out.println("[Terrarum] Locale: " + gameLocale);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
126
work_files/Tools/crypto-hangul.py
Normal file
@@ -0,0 +1,126 @@
|
||||
# encoding: utf-8
|
||||
|
||||
import sys
|
||||
|
||||
reload(sys)
|
||||
sys.setdefaultencoding('utf8')
|
||||
|
||||
|
||||
def encrypt(ch):
|
||||
base = 0xAC00
|
||||
|
||||
if ord(ch) == 0x20:
|
||||
return '모'
|
||||
|
||||
if ord(ch) < 0xAC00 or ord(ch) > 0xD7A3:
|
||||
return ''
|
||||
|
||||
crypt_initials = [
|
||||
'거',
|
||||
'거거',
|
||||
'로',
|
||||
'자',
|
||||
'자자',
|
||||
'가',
|
||||
'라',
|
||||
'러',
|
||||
'러러',
|
||||
'구',
|
||||
'구구',
|
||||
'', # ㅇ
|
||||
'저',
|
||||
'저저',
|
||||
'마',
|
||||
'조',
|
||||
'머',
|
||||
'고',
|
||||
'주'
|
||||
]
|
||||
|
||||
crypt_medians = [
|
||||
'그',
|
||||
'지',
|
||||
'디',
|
||||
'지',
|
||||
'리',
|
||||
'르',
|
||||
'기',
|
||||
'으',
|
||||
'므',
|
||||
'므그',
|
||||
'므지',
|
||||
'므미',
|
||||
'이',
|
||||
'드',
|
||||
'드리',
|
||||
'드르',
|
||||
'드미',
|
||||
'비',
|
||||
'즈',
|
||||
'브',
|
||||
'미'
|
||||
]
|
||||
|
||||
crypt_finals = [
|
||||
'', # x
|
||||
'더', # ㄱ
|
||||
'더더',
|
||||
'더오',
|
||||
'어',
|
||||
'어무',
|
||||
'어아',
|
||||
'루',
|
||||
'보',
|
||||
'보더',
|
||||
'보버',
|
||||
'보다',
|
||||
'보오',
|
||||
'보부',
|
||||
'보우',
|
||||
'보아',
|
||||
'버',
|
||||
'다',
|
||||
'다오',
|
||||
'오',
|
||||
'바',
|
||||
'도',
|
||||
'무',
|
||||
'두',
|
||||
'두',
|
||||
'부',
|
||||
'우',
|
||||
'아'
|
||||
]
|
||||
|
||||
key = ord(ch) - base
|
||||
size_f = len(crypt_finals)
|
||||
size_m = len(crypt_medians)
|
||||
|
||||
initial = key / (size_m * size_f)
|
||||
median = (key / size_f) % size_m
|
||||
final = key % size_f
|
||||
|
||||
return crypt_initials[initial] + crypt_medians[median] + crypt_finals[final]
|
||||
|
||||
|
||||
plainmsg = u'''동해 물과 백두산이 마르고 닳도록 하느님이 보우하사 우리나라 만세
|
||||
남산 위에 저 소나무 철갑을 두른 듯 바람서리 불변함은 우리 기상일세
|
||||
가을 하늘 공활한데 높고 구름 없이 밝은 달은 우리 가슴 일편단심일세
|
||||
무궁화 삼천리 화려강산 대한 사람 대한으로 길이 보전하세'''
|
||||
cryptmsg = []
|
||||
|
||||
width = 24
|
||||
|
||||
for i in range(len(plainmsg)):
|
||||
crypted = unicode(encrypt(plainmsg[i]))
|
||||
|
||||
for j in range(len(crypted)):
|
||||
cryptmsg.append(crypted[j])
|
||||
|
||||
for i in range(len(cryptmsg)):
|
||||
if i % width == 0 and i > 0:
|
||||
sys.stdout.write("\n")
|
||||
|
||||
sys.stdout.write(cryptmsg[i])
|
||||
|
||||
sys.stdout.write("\n")
|
||||