Skip to content

Commit

Permalink
feat: 添加 'M (#89)
Browse files Browse the repository at this point in the history
* feat: 添加 'M 并重构 word.tscn 精灵表导出功能

- 添加了 'M 字符。
- 重构了 word.tscn 精灵表导出。现在将 word_sprite_sheet.ase 导出成一行
  word_sprite_sheet.png 后,运行 export.py 即可完成精灵图导出。

* feat(word): 添加 'M

* feat: 添加 'M 相关的计算和验证功能

* feat: 添加关于 'M 的新章节、关卡和配色
  • Loading branch information
cutekibry authored Sep 27, 2024
1 parent b1f863d commit 9bcb3af
Show file tree
Hide file tree
Showing 321 changed files with 1,141 additions and 458 deletions.
15 changes: 13 additions & 2 deletions data/level_data.gd
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ const LEVEL_DATA := [
"level_code": 24,
}
],

# Matrix
[
{
"question": "M {} {} [] [] []",
"choices": "MMMM MMMM 1 0 + < =",
"level_code": 29,
}
],

# Extra
[
{
"question": "[] {} {} [] [] [] [] {} {} {} {} {} [] [] [] [] [] []",
Expand All @@ -177,10 +188,10 @@ const LEVEL_DATA := [
]

## 章节的唯一标识符。
const CHAPTER_CODE := [0, 1, 2, 3, 4, 5]
const CHAPTER_CODE := [0, 1, 2, 3, 4, 5, 6]

## 章节解锁所需要前一个章节通关的关卡数量。
const CHAPTER_UNLOCK_REQUIRE := [-1, 5, 3, 3, 3, 3]
const CHAPTER_UNLOCK_REQUIRE := [-1, 1, 1, 1, 1, 1, 1]
# [][][][] {}{}{} []

# pp qqq <>=
Expand Down
15 changes: 8 additions & 7 deletions lang/translations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ CHAPTER_NAME_5,"Extra Challenges","额外挑战",""

LEVEL_NAME_0_0,"P=P","P=P","P=P"
LEVEL_NAME_0_1,"=P","=P","=P"
LEVEL_NAME_0_2,"Another Smile","Another Smile","Another Smile"
LEVEL_NAME_0_3,"Reverse","Reverse","Reverse"
LEVEL_NAME_0_4,"Reverse Again","Reverse Again","Reverse Again"
LEVEL_NAME_0_5,"Snake","Snake","Snake"
LEVEL_NAME_0_2,"Reversed","反转了","Reverse"
LEVEL_NAME_0_3,"desreveR","了转反","Reverse Again"
LEVEL_NAME_0_4,"Snake","蛇","蛇"

LEVEL_NAME_1_0,"0+0=0, 0+1=1","0+0=0, 0+1=1","0+0=0, 0+1=1"
LEVEL_NAME_1_1,"1+1=1","1+1=1","1+1=1"
LEVEL_NAME_1_2,"Swap","交换","Swap"
LEVEL_NAME_1_3,"Always True","Always True","Always True"
LEVEL_NAME_1_4,"Paper Tiger","纸老虎","Paper Tiger"
LEVEL_NAME_1_5,"Make Me Laugh","Make Me Laugh","Make Me Laugh"
LEVEL_NAME_1_5,"Make Me Laugh","令我欢笑","Make Me Laugh"
LEVEL_NAME_1_6,"Reset","重置","Reset"
LEVEL_NAME_1_7,"Not Necessary","并非必要","Not Necessary"
LEVEL_NAME_1_8,"True Reset","真正的重置","True Reset"
Expand All @@ -38,5 +37,7 @@ LEVEL_NAME_4_0,"<","<","<"
LEVEL_NAME_4_1,"<=","<=","<="
LEVEL_NAME_4_2,"<>","<>","<>"

LEVEL_NAME_5_0,"[EX] Erase Which?","[EX] Erase Which?","[EX]Erase Which?"
LEVEL_NAME_5_1,"[EX] Really Challenging","[EX] Really Challenging","[EX] Really Challenging"
LEVEL_NAME_5_0,"'M","'M","'M"

LEVEL_NAME_6_0,"[EX] Erase Which?","[EX] Erase Which?","[EX]Erase Which?"
LEVEL_NAME_6_1,"[EX] Really Challenging","[EX] Really Challenging","[EX] Really Challenging"
Binary file modified lang/translations.en.translation
Binary file not shown.
Binary file modified lang/translations.ja.translation
Binary file not shown.
Binary file modified lang/translations.zh.translation
Binary file not shown.
19 changes: 19 additions & 0 deletions objects/word/assets/export.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from PIL import Image

step = 16

# row = 6
# col = 6

# num = 30
# for frame in range(3):
# img = Image.new('RGBA', (col * step, row * step), (0, 0, 0, 0))
# for i in range(num):
# x = i % col
# y = i // col
# img.paste(Image.open(f'sprite{i + 1 + frame * num}.png'), (x * step, y * step))
# img.save(f'frame{frame + 1}.png')

img = Image.open("word_sprite_sheet.png")
for i in range(img.size[0] // step):
img.crop((i * step, 0, (i + 1) * step, step)).save(f"exports/sprite{i + 1}.png")
Binary file added objects/word/assets/exports/sprite1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

importer="texture"
type="CompressedTexture2D"
uid="uid://bko34sovvv5r0"
path="res://.godot/imported/sprite1.png-398b579c2f29e6a78c581458d4519101.ctex"
uid="uid://b7a24ol236vnu"
path="res://.godot/imported/sprite1.png-9349babecebbc7ea7cc21feec4261168.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/sprites/sprite1.png"
dest_files=["res://.godot/imported/sprite1.png-398b579c2f29e6a78c581458d4519101.ctex"]
source_file="res://objects/word/assets/exports/sprite1.png"
dest_files=["res://.godot/imported/sprite1.png-9349babecebbc7ea7cc21feec4261168.ctex"]

[params]

Expand Down
Binary file added objects/word/assets/exports/sprite10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

importer="texture"
type="CompressedTexture2D"
uid="uid://cd0khnn37qxy6"
path="res://.godot/imported/sprite10.png-6cfbefd99e52917dec748fe1a45d1f6b.ctex"
uid="uid://ifcdtsiy4bje"
path="res://.godot/imported/sprite10.png-5da54943bdfeaa0fb9f52e9e6b2a03eb.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/sprites/sprite10.png"
dest_files=["res://.godot/imported/sprite10.png-6cfbefd99e52917dec748fe1a45d1f6b.ctex"]
source_file="res://objects/word/assets/exports/sprite10.png"
dest_files=["res://.godot/imported/sprite10.png-5da54943bdfeaa0fb9f52e9e6b2a03eb.ctex"]

[params]

Expand Down
Binary file added objects/word/assets/exports/sprite100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions objects/word/assets/exports/sprite100.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bv5pcw3cj5oxr"
path="res://.godot/imported/sprite100.png-faff3b04eebfca5c1fbaa2b561cb9772.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/assets/exports/sprite100.png"
dest_files=["res://.godot/imported/sprite100.png-faff3b04eebfca5c1fbaa2b561cb9772.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added objects/word/assets/exports/sprite101.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions objects/word/assets/exports/sprite101.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cs0miuwmlfy53"
path="res://.godot/imported/sprite101.png-03286354f0c5699926b6c6076533a3e1.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/assets/exports/sprite101.png"
dest_files=["res://.godot/imported/sprite101.png-03286354f0c5699926b6c6076533a3e1.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added objects/word/assets/exports/sprite102.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions objects/word/assets/exports/sprite102.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b18qx2ufc6l3k"
path="res://.godot/imported/sprite102.png-1e91b582de560d0d28acf124b74b8112.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/assets/exports/sprite102.png"
dest_files=["res://.godot/imported/sprite102.png-1e91b582de560d0d28acf124b74b8112.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added objects/word/assets/exports/sprite103.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions objects/word/assets/exports/sprite103.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://bmspn03bfdgvr"
path="res://.godot/imported/sprite103.png-b1521eee23dc9b11bd5649c6e663ee5c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/assets/exports/sprite103.png"
dest_files=["res://.godot/imported/sprite103.png-b1521eee23dc9b11bd5649c6e663ee5c.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added objects/word/assets/exports/sprite104.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions objects/word/assets/exports/sprite104.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://jquir18mfrn2"
path="res://.godot/imported/sprite104.png-e5ef1405bb073eddb441bd9cc9bc3cfa.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/assets/exports/sprite104.png"
dest_files=["res://.godot/imported/sprite104.png-e5ef1405bb073eddb441bd9cc9bc3cfa.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added objects/word/assets/exports/sprite105.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions objects/word/assets/exports/sprite105.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://byflepui11851"
path="res://.godot/imported/sprite105.png-c04ddfc998879ca9576d73faf40cde81.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/assets/exports/sprite105.png"
dest_files=["res://.godot/imported/sprite105.png-c04ddfc998879ca9576d73faf40cde81.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added objects/word/assets/exports/sprite106.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions objects/word/assets/exports/sprite106.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://d15d7dacibxg4"
path="res://.godot/imported/sprite106.png-5386a0b5c2400eacc09f7c24269a0e4d.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://objects/word/assets/exports/sprite106.png"
dest_files=["res://.godot/imported/sprite106.png-5386a0b5c2400eacc09f7c24269a0e4d.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added objects/word/assets/exports/sprite107.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9bcb3af

Please sign in to comment.