-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.js
153 lines (147 loc) · 4.62 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import Layout from "@theme/Layout";
import clsx from "clsx";
import React from "react";
import "./home.css";
import styles from "./index.module.css";
const FEATURES = [
{
image: "https://i.eryn.io/2228/carbon%20%281%29.png",
title: "Data-Driven Architecture",
description: (
<>
With ECS, your data and your code are separate. Data exists as
Components, any number of which can be present on an Entity. Systems
contain your game code and run in a fixed order, every frame. Systems
query for Entities that have specific Components, and declare what the
state of the world should be.
<br />
<br />
The separation of state and behavior enables quality of life features
like Hot Reloading, allowing you to see the changes you've made to your
code in real time - as soon as you save the file. No need to stop and
start the game.
</>
),
},
{
image: "https://i.eryn.io/2228/89tcYlOq.png",
title: "Debug View and Editor",
description: (
<>
Matter comes with a world-class debug view and editor. In addition to
viewing all your game state in one place, the debugger integrates with
an immediate-mode widget system to make creating debug conditions dead
simple. Performance information, queries, logs, and recent errors are
displayed for each system, enabling deep insight into what your code is
really doing.
</>
),
},
{
Art: () => (
<div>
<div className={styles.event}>
<p className={styles.frameTitle}>
All systems run in a fixed order, every frame
</p>
<div>
<h4>RenderStepped</h4>
<span>moveCutSceneCamera</span>
<span>animateModels</span>
<span>camera3dEffects</span>
</div>
<div>
<h4>Heartbeat</h4>
<span>spawnEnemies</span>
<span>poisonEnemies</span>
<span>enemiesMove</span>
<span>fireWeapons</span>
<span>doors</span>
</div>
</div>
</div>
),
title: "Robust and Durable",
description: (
<>
Event-driven code can be sensitive to ordering issues and new behaviors
can be created accidentally. With ECS, your code runs contiguously in a
fixed order every frame, which makes it much more predictable and
resilient to new behaviors caused by refactors.
<br />
<br />
All systems have access to all the data in the game, which means adding
a new feature is as simple as creating a new system that simply declares
something about the world.
</>
),
},
];
function Feature({ image, title, description, Art }) {
return (
<div className={styles.feature}>
{image && <img className={styles.featureSvg} alt={title} src={image} />}
{Art && <Art className={styles.featureSvg} />}
<div className={styles.featureDescription}>
<h3>{title}</h3>
<p>{description}</p>
</div>
</div>
);
}
export function HomepageFeatures() {
if (!FEATURES) return null;
return (
<section>
<div className="container">
<div className={styles.features}>
{FEATURES.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</div>
</div>
</section>
);
}
function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();
return (
<header className={clsx("hero", styles.heroBanner)}>
<div className="container">
<h1 className="hero__title">
<img
src={siteConfig.baseUrl + "logo.svg"}
className="bigLogo"
alt="Moonwave"
/>
</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/intro"
>
Get Started →
</Link>
</div>
</div>
</header>
);
}
export default function Home() {
const { siteConfig, tagline } = useDocusaurusContext();
return (
<Layout title={siteConfig.title} description={tagline}>
<HomepageHeader />
<main>
<p className={styles.tagline}>
Matter is an Entity-Component-System library that empowers developers
to build games that are extensible, performant, and easy to debug.
</p>
<HomepageFeatures />
</main>
</Layout>
);
}