Skip to content

Commit

Permalink
chore: update game demo
Browse files Browse the repository at this point in the history
  • Loading branch information
BIYUEHU committed Sep 1, 2024
1 parent f5dc856 commit f28c2a7
Show file tree
Hide file tree
Showing 71 changed files with 6,608 additions and 45 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config/navbar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default [
{ text: 'Guide', link: '/guide/' },
{ text: 'Demo', link: '/guide/demo/' },
// { text: '接口', link: '/api/' },
// { text: '模块中心', link: '/modules/' },
{ text: 'Log', link: 'https://github.com/biyuehu/misakura/blob/master/CHANGELOG.md' }
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/demo.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Demo

<!-- markdownlint-disable-next-line -->
<a href="/demo.html" target="_blank">Demo</a>
<a href="/demo.html" target="_blank">Misakura ~ Demo</a>
1 change: 1 addition & 0 deletions docs/src/public/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./**/* linguist-detectable=false
1,249 changes: 1,249 additions & 0 deletions docs/src/public/assets/index-BMcJ6zOx.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/src/public/assets/index-dUDQZV40.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions docs/src/public/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/misakura.svg" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
/>
<title>Misakura</title>
<link
href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:[email protected]&display=swap"
rel="stylesheet"
/>
<link
href="http://fonts.font.im/css?family=Orbitron:500,700"
rel="stylesheet"
type="text/css"
/>
<link
href="http://fonts.font.im/css?family=Raleway:500,600"
rel="stylesheet"
type="text/css"
/>
<script async type="module" crossorigin src="/assets/index-BMcJ6zOx.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-dUDQZV40.css">
</head>

<body>
<div id="root">
<div id="misakura-app"></div>
</div>
</body>
</html>
Expand Down
Binary file added docs/src/public/gui/dialog/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/auto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/autoHover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/load.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/loadHover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/logHover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/quickLoad.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/quickSave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/saveHover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/skip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/buttons/skipHover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/dialog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/dialog3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/input.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/option.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/dialog/optionHover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/home/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/gui/home/foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/images/background/inside.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/src/public/images/background/outside.png
Binary file added docs/src/public/images/background/outside_2.png
Binary file added docs/src/public/images/background/sky_night.png
Binary file added docs/src/public/images/background/station.png
Binary file added docs/src/public/images/background/sunset.png
Binary file added docs/src/public/images/figure/shiori.png
Binary file added docs/src/public/images/figure/shiori_close.png
Binary file added docs/src/public/images/figure/shiori_open.png
Binary file added docs/src/public/images/figure/shiori_open_low.png
Binary file added docs/src/public/images/figure/shiori_shy.png
Binary file added docs/src/public/images/figure/shiori_smile.png
Binary file added docs/src/public/images/figure/shiori_squint.png
1,208 changes: 1,208 additions & 0 deletions docs/src/public/misakura.svg

Large diffs are not rendered by default.

178 changes: 178 additions & 0 deletions docs/src/public/scripts/main.mrs
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
# Misakura/AvgJS Engine Game Demo
# Version: 1.0.0
# Author: Arimura Sena
# License: GPL-3.0
# Repository: https://github.com/biyuehu/avgjs

# Main.mrs - Misakura scritp entry point

# Register global variables
const soi shiori.png
const soiC shiori_close.png
const soiCS shiori_close_smile.png
const soiS shiori_smile.png
const soiO shiori_open.png
const soiOL shiori_open_low.png
const soiSh shiori_shy.png
const soiSq shiori_squint.png
let score 0

# Register characters
character soi --name '少女' --figure $soi
character self --name '“我”?'
character author --name '夏叶的师傅'

# Start game

title 现实的边缘开始模糊...
title 闪烁的霓虹—— -T red
title 伴随意识的碎片—— -T orange
title 世界在头脑中不断重组... -T yellow
title .
title ...
title ......
title ...
title .
title "⌈世界」连接成功。" -T lightgreen

think: 刺眼的阳光令我难以忍受。

background /images/background/seaside_beach.png

: 我睁开了眼——
: 我意识到我似乎我一直都在这站着。
: 我向四周望去,没有所谓陌生的天花板,视野格外广阔。
: 等下...

show soi

: 不知什么时候,在我面前出现了一位和服少女。
: 浅蓝色的瞳孔,和一副看起来既可爱又显冷淡的样子。
: 少女目不转睛地盯着我。
: 某种本能让我产生开口说些什么的欲望,以试图解答各种眼前的疑惑。
: 正当我准备开口时,突然发现。
: 我对自己的名字有点模糊了...我是“我”吗?我在心里问着自己。

show soi -F $soiSq

soi: 有什么疑惑吗?
think: 少女向满脸疑惑的我轻声开口道。
self: 请问...你是?
soi: 啊...抱歉,忘记做自我介绍了。

character soi --name '诗织'

show soi -F $soiSh

soi: 初次见面,我叫夏叶诗织。
self: 你好,我是...
think: 我不断努力地从脑海中寻找名字的信息。
title "Uncaught ReferenceError: name is not defined" -B red -T black
: ...?
: 搜寻名字的过程中突然出现了一串费解的文字在我眼前。

show soi -F $soi

soi: 看来情况有点乱啊...那就让我一一回答下你的疑惑吧。
think: 夏叶看着不知所措的我再次说道。
soi: 这里是由我的师傅创造出的世界,而我是这个世界的管理者之一。
self: 之一?
soi: 嗯...师傅是这样跟我说的,可能是在挖坑吧。
: 至于你自己,当我尝试使用 typeof 操作符后发现你并非 Character 及其子类的实例——
: 而是 Player 的实例,这说明你并非这个世界的角色或路人,在你这一实例的 prototype 上还定义了一些 setTime 之类与时间相关的方法。
self: 啊?这是什么意思?
soi: 怎么说呢,我也是第一次见到这种实例,之前只是听闻过。
: 总之你有操作这个世界时间的能力,在我所知的 Constructor 中甚至是我自己都没有被定义与时间相关的方法——
: 据我推测,你并不属于这个世界,而是来自第四维度的人,Player 实例是你寄宿在这个世界的一种方式。
self: 啊???那为什么我不知道自己的名字也没有这方面的记忆?
soi: 嗯...你不知道自己名字应该是师傅不知道怎么取名,所以没有为 Player 实例定义 name 属性吧,至于剩下的,可能得问他本人呢,当然也说不定是程序 bug 哦。
: 总之,要不这样吧...请你现在给自己想一个称呼——
think: 叫什么好呢?

prompt name

character self --name $name

show soi -F $soiCS

soi: 你好$name,以后请多多关照哦
self: 初次见面。对了,你一直说的师傅是...?

show soi -F $soiS

soi: 如前面所说,师傅他创造了这个世界,同时也创造出了我的一切,给予了我生命和名字,是我非常非常尊敬的人,而他本身也不属于这个世界,跟你一样都来自第四维度。
: 顺带一提,师傅给我的设定是带有反差萌并且充满智慧的三无少女,因为他似乎很喜欢这一类角色...不过我觉得也有他懒得给我画表情这一原因在里面。

options choice 我好像想起什么了 那你话是不是有点多了?
if "$choice == 1" "say 请不要在意这些细节! -S soi"
if "$choice == 1" "calc score $score-1"
if "$choice == 0" "say 是指? -S soi"
if "$choice == 0" "say 可能是几分钟前,又或者更早,我点开了一个叫做⌈Misakura」的程序,好像是什么视觉小说制作引擎? -S self"
if "$choice == 0" "say 原来如此...世界之外的存在是这样称呼这个世界的啊 -S soi"

think: 紧接着,夏叶的旁边出现了一个人。

show soi -F $soi

soi: 来得正好。$name,在我旁边的这位就是我的师傅。
author: ...
soi: 喂喂,要不说点什么吧...?
author: ...
show soi -F $soiO
soi: 抱歉,师傅他有点不善言谈,接下来就由我替他给你进一步解释吧——
think: 夏叶接过了师傅给他的稿子,距离有点远,没能看清上面的字。
show soi -F $soi
soi: 我尽量按照师傅的原意转述,有些地方会有点理解困难我会尽量补充说明,还请见谅。
: 咳咳。
: 如你所见,在第四维度,这个世界的一切都被一个称之为⌈Misakura」的程序所运行着,世界的创造者...确切的说是这个程序的制作者是我的师傅。

calc device "navigator.userAgent.toLowerCase().includes(`windows`) && `电脑` || `手机`"
self: 说起来,我确实在我的$device上打开了这样一个程序,然后就...眼前一黑了?
show soi -F $soiSh
soi: 在你们的世界,这个世界被统一称之为视觉小说或者说美少女游戏...?
self: 确实是这么回事,我记得我玩过许多的美少女游戏——
: 那是由文字、音乐、图像巧妙结合的一种独特载体,每一个美少女游戏对我来说都是一个故事——
: 尽管有些故事看似平凡又枯燥,但却依旧动人心弦,足以铭记良久的眼泪收割情景。
show soi -F $soi
soi: 嗯...身为这个世界之中的我并不是很能体会到这种心情...能说说为什么喜欢这样的世界呢?
self: 无论最终是喜是悲,这里都有太多美好和感动,或许是我过于厌倦真正枯燥无味的现实了吧...
soi: 对你们而言,这样的世界是虚拟的吗?如果是的话...那还有什么意义呢?

options choice 世界的意义在于世界之外 不是虚拟的!一定在某个遥远的地方真实存在!
if "$choice == 0" "say 净说些难懂的话欺负我! -S soi"
if "$choice == 1" "say 这样啊...我明白呢。 -S soi"

show soi -F $soiS
soi: 那么对你们而言,这样的世界或者说...故事。在结束之后是否会有失落感呢?
self: 肯定会的啊——
: 就像我刚才说的那样,有些故事是 bad end,这会让人感到意难平,即便是一些留白的或者美好的 good end,也不免会让人产生一种空虚感,似乎叫什么⌈完结综合征」?
: 不同的人会用不同的方式去回味故事中的点点滴滴。有些人会写感言,有些人会循环播放游戏的音乐、会把自己的账号头像、壁纸、背景甚至是签名都换成游戏中的某一角色——
: 当然,我想也会有选择沉默将这份感情藏于心底的人吧。
soi: 看来你对这样的虚拟世界感到满足呢。
self: 是啊,不过...当空虚感经历地太多,我就会想着自己也要去做些什么的念头——
soi: 具体是指?
self: 比如说成为一名脚本家,或者一名作曲家制作音乐感动他人,又或者成为一名画师通过画笔绘制出令人喜爱的美少女。
show soi -F $soiOL
soi: 脚..本..家?
self: 就是指故事的编写者,类似于⌈编剧」吧?
soi: 呃,是吗...还以为是写脚本文件的程序员呢...能否告诉我你最喜欢的脚本家呢?
self: 那当然是——

options choice 麻子 爱的战士 奈须蘑菇 片岗智 RKR 扶她自 雪人 濑户口 口三才 丸户史明 打越钢太郎 其它
if "$choice == 11" "prompt temp"

show soi -F $soiS
soi: 我知道了。
self: 简而言之就是想要自己制作一款美少女游戏,让其它的观众也能因自己笔下的角色流泪或者产生共鸣!
: 没错,这也正是我打开⌈Misakura」的原因。
soi: 那么说回正题——

show soi -F $soi

: ⌈Misakura」基于 PIXIJS、Tauri 与 TypeScript 开发,致力于为用户提供一个简单、易用、功能丰富的编辑环境与游戏框架,让用户能够轻松制作出一个独属于自己的作品。
: 前端底层使用基于真实 DOM 操作的 SolidJS 框架,桌面端使用基于 Rust 开发的 Tauri 框架,保证了高性能与流畅的渲染效果——
: SolidJS 从根本实现上便碾压一众基于 Vue / React 框架的视觉小说引擎,而 Tauri 从性能与打包大小上双重碾压肮脏的 Electron 等框架。
: 并且同时支持原生 Web 应用、桌面应用、移动应用等多个平台。
: 既支持自定义脚本文件,也支持引用 JavaScript 文件实现各种复杂逻辑,以及高定制度的 JsonUI。
: 好了,故事就暂时到这里了。
: bye~
Loading

0 comments on commit f28c2a7

Please sign in to comment.