Sunflower Land
Search
K
👶

Getting Started

In this guide, we will walk you through the initial steps to get started with building your own Community Island in Sunflower Land. Let's dive in and unleash your creativity!
Here we will explore the basic project setup.
  1. 1.
    Creating a Public GitHub Project
To begin, we recommend creating a public GitHub project for your Community Island. Sunflower Land uses Github to host our game and make the code public to everyone. This makes it easy to share, educate and collaborate with others.
If you haven't already, you will need to head over to Github and create an account.
Once you have created an account, simply create a new repository and make it public, ensuring that your island project is accessible for others to explore, contribute to, and learn from. This repo is where you will store your island project.
  1. 2.
    Setting up the Basic Structure
To start building your Community Island, it's important to set up the basic structure of your project. This includes creating specific files that will define the visual elements and functionality of your island. We recommend the following files as a starting point:
  • public/Scene.js: This JavaScript file will serve as the main entry point for your island's scene. Here, you can define the interactions, gameplay mechanics, and visual elements that players will encounter when they visit your island. Don't worry if you are not a coder, the setup and usage is extremely minimal!
  • public/map.json: The map.json file is where you define the layout and structure of your island. We will show you how to make this file later in Designing Maps
// Example Scene.js
class ExternalScene extends window.BaseScene {
constructor() {
super({
player: {
// The x/y coordinates on your Map where you want the player to appear
spawn: {
x: 210,
y: 280,
},
},
});
}
}
By organizing your project with these files, you'll have a solid foundation to start building your Community Island.
You can check out this example to see the basic structure of an Island Project.
  1. 3.
    Enabling GitHub Pages
Once you have set up your GitHub repository and structured your project, it's time to make your island accessible to others. GitHub Pages allows you to host your static website, including your Community Island, directly from your repository. Enabling GitHub Pages is a simple process:
  • Navigate to the settings of your GitHub repository.
  • On the left hand side click 'Code And Automation' > Pages
  • Under 'Build and Development', select the 'root'
  • Click Save
GitHub Pages will now generate a URL where your Community Island can be accessed. This means that others can visit your island, experience your creations, and provide feedback or collaborate on your project.
Example:
https://sunflower-land.github.io/community-island-example/public/Scene.js`
Congratulations! You've completed the initial steps to get started with building your Community Island. Now it's time to let your imagination run wild, experiment with different designs and mechanics, and create a captivating experience for players to enjoy.
Head over to Designing Maps to create your first island!