Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions static/examples/zh-CN/ASCII.wp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ASCII码视频
===
colors: Camera(20px 20px 100ms)
scale: "@%#*+=-:. " → []

Stage(
colors.combined(
[]
ƒ(phrases•[Phrase] row•[Color] y•#)
phrases.append(
row.translate(
ƒ(color•Color x•#)
Phrase(
"\scale[(color.lightness · 9).round()]\"
place: Place((-x - 1) · 0.5m y · -0.5m)
duration: 0s
size: 0.75m
face: "Noto Sans Mono"
)
)
)
)
description: "20 by 20 video stylized with ASCII"
)
41 changes: 41 additions & 0 deletions static/examples/zh-CN/Adventure.wp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
冒险
=== 开始/zh-CN
•State(action•"" description•[""] options•[State] won•?)

stand: State('站立' ["你站不起来,你被束缚住了。"] [] ⊥)
cut: State('自我解脱' [ "你已经解脱了。"] [] ⊤)
throw: State('扔掉' [ "你扔了刀。"] [stand] ⊥)
pickup: State('拾起' ['你有一把刀。'] [ cut throw ] ⊥)
roll: State('翻滚' ['你身边有一把刀。'] [ pickup stand ] ⊥)
start: State("开始" ["你醒来在一间黑暗冷冽的房间里。"] [ roll stand ] ⊥)

key: Key()

¶start at the state state, and if the key changes, either go to start if there are no options, stay if the key isn't valid, or choose the option.¶
state•State:
start … ∆ key …
state.won ? start
state.options.length() = 0 ? start
~((key = '1') | (key = '2')) ? state
state.options[key → #]

options:
state.won ? [ Phrase(`*你自由了!*`) ]
(state.options.length() = 0) ? [ Phrase(`*重新开始!*`) ]
state.options.translate(ƒ(option•State index•#) Phrase(`\index\. *\option.action\*` size: 2m name: option.action duration: 1s entering: Pose(opacity: 0%)))


Stage(
[
Group(
Stack()
[
Phrase(state.description duration: 0.5s name: state.action entering: Pose(offset: Place(0m 2m)))
:options
]
)
]
background: Color(0 0 0°)
color: Color(100% 0 0°)
face: "Permanent Marker"
)
5 changes: 5 additions & 0 deletions static/examples/zh-CN/Amplitude.wp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
振幅
===
amplitudes•[#]: ←← 10 Volume()
vis: amplitudes.translate(ƒ (amp•#) Phrase("⚫️" opacity: amp size: 10m))
Stage([Group( Row() vis )] place: Place(0m 0m -50m))
43 changes: 43 additions & 0 deletions static/examples/zh-CN/BasketballStar.wp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
篮球之星
=== 开始
click: ∆ Button()

clickCount: 0 … click … 1 + .

basketballPlace: (clickCount % 2) = 0 ? Place(x: Pointer().x y: 8m z: 0m) Motion(place: Place(0m 8m 0m))

basketball: Phrase(
"🏀" 0.7m
matter: Matter(0.623kg 0.99)
place: basketballPlace
name: "篮球"
)

¶ 每次投篮时随机确定篮筐位置 ¶
basketXPlace: Random(-9000m 9000m) ÷ 1000 … (click & ((clickCount % 2) = 1)) … Random(-9000m 9000m) ÷ 1000

¶ 记录得分和尝试次数 ¶
¶ 记录得分和尝试次数 ¶
score: 0 … (click & ((clickCount % 2) = 1) & ((basketXPlace + 0.81m) > (basketball.place ?? Place()).x) & ((basketXPlace - 0.8m) < (basketball.place ?? Place()).x)) & (2.1m > (basketball.place ?? Place()).y) … 1 + .

attempt: (clickCount ÷ 2).roundUp()

basketballStar: Group(Stack() [
Phrase("篮球" offset: Place(0m 2m 0m))
Phrase("之星" offset: Place(0m 1m 0m))
Phrase("得分: " + score → '' offset: Place(0m -4.5m 3m))
Phrase("尝试次数: " + attempt → '' offset: Place(0m -5m 3m))
] size: 2m face: "Sue Ellen Francisco" offset: Place(0m 4m 10m))

Stage(
[
basketball
Shape(Rectangle(-1m + basketXPlace 0.1m 1m + basketXPlace 0m 0m) background: Color(60% 100 30°))
Shape(Rectangle(0.9m + basketXPlace 2m 1m + basketXPlace 0m 0m) background: Color(60% 100 30°))
Shape(Rectangle(-1m + basketXPlace 2m -0.9m + basketXPlace 0m 0m) background: Color(60% 100 30°))
Shape(Rectangle(-10m 0.01m 10m -2m))
basketballStar
]
place: Place(x: 0m y: 5m z: -10m)
gravity: 5m/s^2
)
7 changes: 7 additions & 0 deletions static/examples/zh-CN/Between.wp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
之间
=== 开始/zh
¶如果 n 介于最小值和最大值之间,则为真,不包括最小值和最大值。¶
ƒ between(n•# min•# max•#) (n > min) & (n < max)

¶让我们来测试一下!¶
between(1 0 5)