Zoomland is a web game developed on react with Vite.
npm install
In the array of chapters in src/data/chapters.json
, add the chapter metadata to which the price refers to, with the following properties:
viewType
: the type of the price (seesrc/constants
for the list of available types)category
: the category of the price (seesrc/constants
for the list of available categories)position
: the position of the price in the worldid
: the id of the chapter, usually its position in the list of chapters followed by a suffix, for example0-introduction
for the introduction chapter and1-adventure-in-zoomland
for the first chapter.
This way, we refer to the right chapter in the <Price>
component.
Then add a related <Price>
component inside the <Physics>
tag in src/components/World.jsx
:
import Chapters from '../data/chapters'
return (
// ... a lot of other stuff here
<Price
viewType={Chapters[1].viewType}
category={Chapters[1].category}
position={Chapters[1].position}
id={Chapters[1].id}
/>
// ... a lot of other stuff here
)
or, shortly
<Price {...Chapters[1]} />
that's it!
├── README.md
├── package.json
├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json