This repo serves as a template project to make it easy to get started with the FrostFlake game engine.
This repo also acts as a set of end-to-end tests for most of the features of FrostFlake so as features are added, a test View should also exist in this repo to test the feature.
The general idea is to fork this repo to get an easy starting point, and use that as the basis of your game.
These are the Views that exist and what they are demonstrating. Each View is heavily commented to help new developers understand how to use engine features.
- AnimationDemo - This
Viewshows how to load and play a frame-based animation using a spritesheet and anAnimationto define frames. It also scales up the sprite so it is more visible, which demonstrates how to use scaling in Frostflake. - AudioDemo - This
Viewshows how to load and play an audio file. It also shows how to listen for mouse clicks, since a mouse click is what triggers the audio event. - CollisionDemo - This
Viewshows how to create collidable sprites and collide them against each other using Frostflake's simple physics system. - ManySpritesDemo - This
Viewrenders thousands ofSprites, showing how FrostFlake can handle high-volume sprite rendering. It also randomizes the position, scale, alpha, and rotation velocity properties on eachSprite. - ParentChildDemo - This
Viewdemonstrates how relative position and velocity work when parentingPositionableobjects (in this caseSprites) in the scene graph. - RenderTargetDemo - This
Viewdemonstrates a more advanced concept called "Render Targets". It renders 100,000Sprites to a dynamic texture a single time, then it uses that texture in a newSpritewhich is rendered every frame. - ShapesDemo - This
Viewdemonstrates FrostFlake's shape-rendering capabilities. It renders thousands ofCircleandSquareshapes with random colors and velocities. - TextStringDemo - This
Viewdemonstrates FrostFlake'sTextobject. It renders a short string of text with custom font, size, alignment, stroke, and fill.
You will need to have Node installed and a basic understanding of how to run Node commands in a terminal. Follow these steps to start a new project with the FrostFlake game engine:
- Clone the FrostFlake game engine
- Fork this repo (optional) and clone locally, it must be in the same parent folder as the frostflake source for example:
- desktop/projects/frostflake
- desktop/projects/frostflake-template
- Run:
npm installto install dependencies. - Run:
npm run buildto build the project. - Run:
npm startto build, watch for file changes, and serve the game. - Visit
http://localhost:8080to see the template game running. - Browse the src folder to see the capabilities highlighted in each
View.
You can fork this repo, or just download the code, as a starting point for using the engine with everything ready to go!