Code Monkey home page Code Monkey logo

haxe-flixel-template's Introduction

HaxeFlixel Game Template

Everything you need to quickly start making your HF game

No need to install Haxe, OpenFL, Lime or HaxeFlixel separately.
This template takes care of all of that with the power of Lix and Nodejs.


This template requires Node.js v16 or higher to be installed to run most of the commands below.

1. Download

You can also create a new project based on this template using degit which will ignore all .git related files.

npx degit RichardBray/haxe-flixel-template [my-flixel-game]
cd [my-flixel-game]

NOTE: Replace [my-flixel-game] with the name of your game.

2. Install dependencies

These steps only need to be applied the first time you download the template.

Then install package dependencies

cd [my-flixel-game]
npm i -g lix
npm i
npx lix download
npm run dev

3. Running the project

If you've applied the steps above before, this means you have lix installed globally.

All you need to do is

cd [my-flixel-game]
npm run dev

Navigate to port 1212 in your browser. http://localhost:1212/




How it works

The project heavily relies on a package called hf-scripts. This package contains the two main scripts that are used to run the project, startup and comp-server.

startup

This script is triggered on the npm start or npm run dev command and does a few things by default:

  • builds the game for HTML5
  • starts the watcher web and compilation server

Build for HTML5

This runs the command lix lime build HTML5 -debug and is connected to the compilation server if it is run in a different tab.

You can run your project without a compilation server by creating a file called config.json in the root of your project and using these settings:

{
  "useCompServer": false
}

The useCompServer setting is set to true by default. This will cache unchanging code making subsequent builds much faster.


The watcher and web server

Your .hx files are watched with Chokadir. Anytime you save a file it will trigger an automatic rebuild.

npm start

The web server runs the game in a given port. You can change the port in your config.json file with these settings:

{
  "webServerPort": 3000
}

Github actions

This template contains a github action file that will:

  • create a gh_pages branch
  • build the game for HTML5 to that branch tab

This action is commented out and would need to be uncommented to be enabled.

By default this will happen whenever code is merged to the main branch but this can be changed.

haxe-flixel-template's People

Contributors

gama11 avatar richardbray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

haxe-flixel-template's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.