Star Exploration is an HTML website. It can be served as a static web page.
This was deployed to https://star-exploration.web.app with Firebase Hosting.
-
Install Node.js, npm
-
Install Firebase CLI
-
Run
npm install
to install dependenciescd website npm install
-
Run
npm start
to run the website locallynpm start
-
View the local website
-
Set your Firebase Project ID
firebase use --add YOUR_FIREBASE_PROJECT_ID # Example: firebase use --add star-exploration
-
Build the project before deploying
npm run build
-
Deploy the project to a public server with Firebase Hosting
firebase deploy
-
View the public webisite
https://YOUR_FIREBASE_PROJECT_ID.web.app
Example: https://star-exploration.web.app
website/public/index.html
: Main HTML page.website/src/App.js
: Create the React game canvas.website/src/GameCanvas.js
: Most of the website logic is in this file.- Files that render and draw the graphics
- Star update logic
- Generate random stars
- Data models
website/src/model/Star.js
: Star informationwebsite/src/model/Vector2.js
: We do math with (x, y) coordinates to add, subtract, and scale (x, y) coordinates. We shorten the usage in most of the code by renaming this classV
when it is imported usingimport { V } from './model/Vector2';
Copyright 2019 Chris Cartland. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.