-
Notifications
You must be signed in to change notification settings - Fork 1
Getting Started
The fastest way to begin developing is to create your own mini world!
- Make your own branch
git pull
git checkout -b [name_of_your_new_branch]
git push origin [name_of_your_new_branch]
(Don't actually include the brackets)
-
Take a look at
src/game/worlds/CubeWorld.ts
This is the world you see on the main page. Notice it is just a function that returns an instance ofWorld
.Systems
andEntities
andComponents
are added to the world to give it it's functionality. This is the ECS (Entity Component System) in use! -
Make your own world! Copy
CubeWorld.ts
and call if something likeMyCrazyWorld.ts
. Make sure you change the function name to match the filename! -
Navigate to
src/components/App.tsx
. This is the top level React component. Notice the html like syntax. Pattern match and create a new route:
<Route path={"/myCrazyWorld"}>
<Game worldFunction={MyCrazyWorld}/>
</Route>
-
Now if you go to
http://localhost:8080/#/myCrazyWorld
you'll see your world in action! (Note the hashtag! Also you might have to change the port number) -
Take a look at the code in
src/game/systems
andsrc/game/components
. Can you see how they work? -
Commit your changes
git add .
git commit -m [your commit message]
git push origin [name_of_your_new_branch]
- Pull request to bring your changes into master! Go to the github repo site, click "Branches". Find your branch and click "New Pull Request". Submit your pull request if everything looks good!