Skip to content

Getting Started

larryoatmeal edited this page Mar 20, 2020 · 3 revisions

The fastest way to begin developing is to create your own mini world!

  1. 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)

  1. 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 of World. Systems and Entities and Components are added to the world to give it it's functionality. This is the ECS (Entity Component System) in use!

  2. Make your own world! Copy CubeWorld.ts and call if something like MyCrazyWorld.ts. Make sure you change the function name to match the filename!

  3. 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>
  1. 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)

  2. Take a look at the code in src/game/systems and src/game/components. Can you see how they work?

  3. Commit your changes

git add .

git commit -m [your commit message]

git push origin [name_of_your_new_branch]

  1. 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!
Clone this wiki locally