1.0.2 • Published 2 years ago

@kevinorriss/tappy-plane v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Tappy Plane

Tappy plane is a clone of the popular Flappy Bird game, created in the Phaser HTML5 game framework.

A simple game created to experiment with Phaser games in React.

Tappy Plane

How to play

Simply click or tap anywhere on the game scene to make the plane ascend and try to fly safely between as many rocks as you can.

Requirements

Usage

You can use this package directly with Phaser like so:

import Phaser from 'phaser'
import TappyPlane from '@kevinorriss/tappy-plane'

const tappyPlane = new Phaser.Game({
    ...TappyPlane,
    scale: {
        ...TappyPlane.scale,
        parent: 'tappy-plane',
        fullscreenTarget: 'tappy-plane'
    },
    loader: { 
        ...TappyPlane.loader, 
        baseURL: 'http://localhost:4566/',
        path: 'images/tappy-plane'
    }
})

By overriding the scale object, you can specify the DOM element by ID where you want Phaser to place the HTML5 canvas. The same element can also be specified when in fullscreen mode otherwise the scaling and centering won't work.

The loader scene sets the baseURL and path values which are prepended to all load calls when loading the game assets.

Game Assets

This game was created for a React application so the assets do not get included in the package so that they can be lazy loaded.

You can download the assets for this game over on GitHub.