All Projects → SaFrMo → phaser-mario

SaFrMo / phaser-mario

Licence: other
Mario-like class for Phaser

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to phaser-mario

phaser-typescript-webpack
Another Phaser CE boilerplate using TypeScript and Webpack.
Stars: ✭ 17 (-10.53%)
Mutual labels:  games, phaser
phaser3-plugin-pathbuilder
Draw and edit Lines, Bezier Curves, Splines at runtime, explore your scene and export your paths to Phaser
Stars: ✭ 67 (+252.63%)
Mutual labels:  games, phaser
Games
一个基于Phaser的小游戏集合
Stars: ✭ 1,167 (+6042.11%)
Mutual labels:  games, phaser
phaser-particle-editor-plugin
This plugin creates particles based on JSON data generated by Phaser Particle Editor
Stars: ✭ 28 (+47.37%)
Mutual labels:  games, phaser
Dude-SideScroll
🎮 A side-scrolling adventure game.
Stars: ✭ 19 (+0%)
Mutual labels:  mario, phaser
phaser multiplayer demo
HTML5 Multiplayer with Phaser and Go
Stars: ✭ 35 (+84.21%)
Mutual labels:  games, phaser
phaser-candy-crush
Candy crush like game made with Phaser HTML5 game engine
Stars: ✭ 46 (+142.11%)
Mutual labels:  phaser
leagueoflegends
A command-line interface for League of Legends Esports.
Stars: ✭ 28 (+47.37%)
Mutual labels:  games
chessmsgs
Play chess over Twitter, SMS, iMessage, Facebook, Snap, Whatsapp, Google Chat. WeChat, Telegram, KaTalk, Viber, and many more.
Stars: ✭ 72 (+278.95%)
Mutual labels:  games
decentraland-workshop
Decentraland workshop - Learn how to get started building stuff on decentraland
Stars: ✭ 26 (+36.84%)
Mutual labels:  games
MHW-Shop-Editor
Monster Hunter World Provisions Stockpile Shop Editor
Stars: ✭ 52 (+173.68%)
Mutual labels:  games
phaser-plugin-debug-arcade-physics
Draws properties of Arcade Physics bodies. Phaser 2/CE
Stars: ✭ 18 (-5.26%)
Mutual labels:  phaser
Commandline-Games-hacktoberfest
A repository to share command line games. An opportunity to start and learn about open source code contributions flow.
Stars: ✭ 16 (-15.79%)
Mutual labels:  games
another js
Another World/Out of This World (HTML5)
Stars: ✭ 46 (+142.11%)
Mutual labels:  games
QuestJS
A major re-write of Quest that is written in JavaScript and will run in the browser.
Stars: ✭ 47 (+147.37%)
Mutual labels:  games
gstatsjs
Graphics statistic (DrawCalls and TextureCount) for WebGL
Stars: ✭ 48 (+152.63%)
Mutual labels:  phaser
BlueVGA
VGA library for STM32F103C (BluePill) that can manipulate a screen with 28x30 tiles with 8x8 pixels each, in a total resolution of 224x240 pixels with 8 colors using a very low footprint
Stars: ✭ 39 (+105.26%)
Mutual labels:  games
StickMan-3D
StickMan 3D: First Round | indie fighting game | C++ OpenGL
Stars: ✭ 60 (+215.79%)
Mutual labels:  games
manu.ninja
Frond-End Development, Games and Digital Art
Stars: ✭ 15 (-21.05%)
Mutual labels:  games
phaser-jam-template
A Phaser Template to kick off your Game Jam with everything you need. Typescript, code quality, building for itch, various input methods, examples, bootloader, preloader, main game, end screen, credits screen and license screen.
Stars: ✭ 18 (-5.26%)
Mutual labels:  phaser

What

This is part of the Phaser Component Library.

A "mario" is a player-controlled character than can move on the X axis and jump on the Y axis. It is affected by gravity, has a given amount of health, and uses WASD/arrow keys and space bar to move.

How

npm install phaser-mario

Then, in your Phaser source code

import Mario from 'phaser-mario'

// in your game creation method:
this.game.physics.startSystem( Phaser.Physics.ARCADE )
this.game.physics.arcade.gravity.y = 500

// add a controllable (arrow keys/space bar) Mario-like player character
const mario = this.game.add.existing(new Mario({
    game: this.game,
    key: 'your-sprite-key',
    controls: true
}))

API

new Mario( { options } )

options

collideWorldBounds

Type: boolean
Default: false

Whether or not the mario collides with the world bounds.

controls

Type: boolean
Default: false

Whether or not the mario can be controlled by the player.

deadzone

Type: object: { left, width }
Default: {}

The camera's deadzone.

If left is exactly 1 or lower, a percentage of the screen width will be used; ditto for width. Otherwise, the defined pixel amount will be used.

follow

Type: boolean
Default: false

Whether or not the camera follows the mario.

frame

Type: string | number
Default: ''

See Sprite docs.

game

Required
Type: Phaser.Game

The game where this mario will live.

health

Type: number
Default: 1

This mario's starting health.

height

Type: number
Default: 64

This mario's height.

jump

Type: number
Default: -250

The jump force of the mario. Note that to jump up, this value must be negative.

jumps

Type: number
Default: 1

The number of times the mario can jump. Set to 2 for double-jump, for example.

key

Type: string | Phaser.RenderTexture | Phaser.BitmapData | PIXI.Texture
Default: ''

See Sprite docs.

speed

Type: number
Default: 350

The x-axis speed of the mario.

width

Type: number
Default: 64

This mario's width.

x

Type: number
Default: 0

The x-value of the mario's spawn location.

y

Type: number
Default: 0

The y-value of the mario's spawn location.

Properties

direction

Type: number

Shortcut to current mario X direction. -1 = left, 0 = no active X movement, 1 = right.

facing

Type: number

Shortcut to direction mario is facing. -1 = left, 1 = right.

opts

Type: object

The options initially passed to the Mario.

state

Type: Phaser.State

Shortcut to the current state object. Useful for accessing global properties from that state.

Versions

  • 1.1.2 - fixed opts reference bug in update and updated docs
  • 1.1.0 - fixed bug in update that prevented marios with controls: false from running
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].