Search the Community

Showing results for tags 'components'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 3 results

  1. Hey guys, I was profiling my game and it seems like I could save some cpu time if I could bypass this function call in my objects' postUpdate : postUpdate: function() { ... if (this.components.PhysicsBody) {; } ... } My question is, since my game doesn't use any physics at all, do I have to rebuild phaser without physic support? Or is there a simpler way to simply disable the creation of physics body on all my game objects? Thanks for any input!
  2. I built a 1st release of entity system with typescript. You can find the library at and here an example with a quick developed game shooter (crimson like): I hear suggestions.. Thanks
  3. Hi, in a game I'm developing I'm trying to implement the entity component model in such a way that I can have units get their components information from the tiledMap file, I load the components from the Json like so if ( !== "") {",").forEach(function (componentName) { entity.addComponent(new FYP.Components[componentName](this)); }, this); } FYP.Entity.prototype.addComponent = function (component) { 'use strict'; // Add component data to the entity // NOTE: The component must have a name property (which is defined as // a prototype protoype of a component function) this.components[] =; return this; }; FYP.Components.PlayerInputComponent = function () { 'use strict'; this.cursors = null; return this; }; FYP.Components.PlayerInputComponent.prototype = new FYP.Components.PlayerInputComponent(); = 'PlayerInputComponent'; FYP.Components.PlayerInputComponent.prototype.type = 'Input'; FYP.Components.PlayerInputComponent.prototype.constructor = FYP.Components.PlayerInputComponent; FYP.Components.PlayerInputComponent.prototype.initialize = function (actor) { 'use strict'; this.cursors =; this.cursors.leftHand = this.keyboard.addKey(Phaser.Keyboard.X); this.cursors.rightHand = this.keyboard.addKey(Phaser.Keyboard.Z); this.cursors.pause = this.keyboard.addKey(Phaser.Keyboard.P); }; FYP.Entity = function (game, position, spriteKey) { 'use strict';, game, position.x, position.y, spriteKey); this.commands = []; this.components = []; // Set the pivot point for this sprite to the center this.anchor.setTo(0.5, 0.5); return this; }; FYP.Entity.prototype = Object.create(Phaser.Sprite.prototype); FYP.Entity.prototype.constructor = FYP.Entity; FYP.Entity.prototype.update = function () { 'use strict'; if (this.components) { this.components.forEach(function (component) { component.update(); console.log(component); }, this); } this does not work however, and even though Entity.components seems to contain all the appropriate components the array always seems to have a length of 0 so I can't traverse it to execute the update functions