Search the Community

Showing results for tags 'component'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

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

Found 10 results

  1. I built a 1st release of entity system with typescript. You can find the library at https://github.com/francoagusto/entities and here an example with a quick developed game shooter (crimson like): https://github.com/francoagusto/entities-example I hear suggestions.. Thanks
  2. Hello! At the beginning of the year, I have a plugin to manage behaviors (based on construct 2) in Phaser games. Now I'm creating some behaviors. Please feel free to help me with testing or feedback. The plugin: https://github.com/luizbills/phaser-behavior-plugin (How to install and use on README) Some behaviors: https://github.com/luizbills/phaser-behaviors (see the Pull Requests too) Check out demo game using "bevahiors": https://github.com/luizbills/phaser-platform-game (see the file game.js)
  3. Is there any Demo or Example how should Brake code on component (from blender Group or Parent Children). So that each component is seperatet .ts or .js and so that each component have its own methods and propertis? greetings ian
  4. Hi! I'm new to JS gamedev, but I had a good experience in Flash/AS3. So, I'm starting a board game, and I need to roll a dice/roulette every turn. A kind of window will appear over the board and the player will be prompted to click the roulette. It will return a value between 1~9. What I have until now is ths: https://jsfiddle.net/snake/m317ona9/ As you can see in my code, I'm using create() and update() methods just to create this example. In real game it wouldn't be handled like that, but in middle of game. I have not so much ideas on how I can make a nice architecture in my code.What I have in mind, with my current small knowledge in Phaser, is to make a lot of conditions to manage states in game loop. The final code would be a maze! The perfect case for me: Create a function which would treat this roulette as a component or something like it, maybe with his own create and update methods, and returning a value to the game, so I can reuse it without the need to mess up my code. Hope I've made myself clear How can I proceed with it? Thanks in advance!
  5. Hello all, I just released my PhaseSlider UI component, which is a (duh!) Slider with many options and functionalities, take a look at the github repo: https://github.com/netgfx/PhaseSlider or the examples here for advanced: http://www.netgfx.com/trunk/games/libs/phaseslider/examples/example1.html or here for basic example: http://www.netgfx.com/trunk/games/libs/phaseslider/examples/index.html
  6. Hi everyone, A few weeks ago Ezelia started a thread about ECS and HTML5 games. As a big fan of this pattern, I decided to build and release my own engine. It is called makr.js and is available on Github (https://github.com/ooflorent/makrjs) under MIT license. A basic sample is available into examples/. The library must be build using grunt in order to test the sample. Any feedback would be appreciated! Update (2015-01-06): Version 2 is under active development (more information) Feedback is welcome!
  7. Hi everybody! Let me start off by saying that I'm pretty new to Phaser – I've been playing around with it for a bit but never made a game with it... so I'm not super-familiar with it yet. However, I have made games using CraftyJS and while that engine pales in almost all aspects when compared to Phaser, I really loved its entity component architecture. Not having to create complicated inheritance tress to share functionality among game objects that are otherwise quite diverse makes so much sense to me. Here's what I've done to add similar functionality to my Phaser project, without touching the Phaser source. I want to get your guys' opinions on it. Also, I'm not completely familiar with the terminology so I'm not sure if these things I'm adding to game objects are mixins, components, traits or something else. 1. Create GameObject constructor function GameObject will be the constructor function that every visible object in the game will use/extend. GameObject extends Phaser.Sprite and adds some methods for managing components on a game object, for example: GameObject.prototype.addComponentGameObject.prototype.removeComponentGameObject.prototype.hasComponentGameObject.prototype.requireComponent // ensures that the game object has a particular component, otherwise throws an errorCurrently, GameObject provides an update method that goes through all registered components on the instance and calls their update-methods if they are provided: GameObject.prototype.update = function() { for (var componentName in this.components) { var component = this.components[componentName]; if (typeof component.update === 'function') { component.update(); } }};2. Create a component Here's a simple movement component that requires another component called "speed" to exist on the game object (entity). var movement = autoCurry(function(entity) { this.requiresComponent('speed'); var speed = entity.speed; var cursors = entity.game.input.keyboard.createCursorKeys(); return { name: 'movement', update: function() { // prepare var velocity = entity.body.velocity; // movement velocity.setTo(0, 0); if (cursors.left.isDown) { velocity.x = -speed; } if (cursors.up.isDown) { velocity.y = -speed; } if (cursors.down.isDown) { velocity.y = speed; } if (cursors.right.isDown) { velocity.x = speed; } } };});I'm using autoCurry to make the syntax a bit more appealing. 3. Add component to a game object var Player = function(game, x, y) { GameObject.call(this, game, x, y, 'player'); this.addComponents(speed(150), movement()); game.physics.enable(this, Phaser.Physics.ARCADE);};util.inherits(Player, GameObject);What do you guys think of this approach? Obviously there are alternative ways to provide components. You might want to have components be constructor functions or plain objects instead of curried functions returning an object – I think that part is probably preference. I'm interested in the viability of using such a system with Phaser particularly. I'm looking forward to a constructive discussion, thanks for posting your thoughts! Best, Max
  8. This isn't necessarily a Phaser- specific question, but I'm just curious about the patterns that are being leveraged in the Phaser community.. In my current project, I'm following the simple and common structure that can be seen in things like XNA. That is, I have my entities acting as wrappers for the phaser sprite something like this: entities/foo.js FooEntityFactory = function(someInitParams) { //some initialization code return { sprite: game.add.sprite(10, 20, 'sprite1'); update: function(game) { //some update code } };};And then I can keep my states relatively tidy by not cluttering it with entity logic and leaving more room for state-specific logic: states/bar.js BarState = { entities: [], create: function() { this.entities.push(FooEntityFactory()); }, update: function(game) { this.entities.forEach(function(entity) { entity.update(game); }; }};However, I'm trying to get some ideas on out how to augment things with an Entity-Component-System pattern. Has anyone else organized their code in such a way that that utilizes this pattern? How about EC?
  9. I've been into PlayCraft Labs game engine and found it quite nice. It utilize an Entity-Component-System framework with several components and systems ready to use by the author, such as particles, physics, effects, etc. Check it out here. To get access to the codes and documentation, you'll need to sign up.
  10. Hi to all, I present you port of the Artemis Entity System framework to TypeScript Before you start dive in the code go check the Artemis documentation and examples, cause they are 99% the same as this TS framework THE CODE: https://github.com/MikeMnD/ArtemisTS SOME WORDS: This is alpha release, and i didn't make any game yet, but i share the project and code because: 1. Its open source 2. It's a core framework (no things like rendering, input, collisions or physics) 3. It's TypeScript (which is still in development) but if you see the compiled JavaScript i think you're liked it 3. There was some struggles in the process of porting so i\ll be more than happy if some folks help me with code reviews, and suggestions also there is some changes to be expected when TypeScript add the generics feature 4. Some custom solutions for classes like Hashmap, BitSet, and ImmutableBag they are array based and there is a big chance that something is buggy More technical info about use: VisualStudio is used as IDE in my project and every .ts file is build to .js (but you can compile it with what you want) the AMD module pattern to load classes, also i've made an App class in which for test and probably for future use i included the: dat.gui as example how can other JS libraries can be imported. STARTING THE GAME (the app or whatever) Well if you download the github code it should just work try open the index.html and check if the console output something like this: document ready App.ts:68app started App.ts:34construct a logger So if all is ok without errors you could type: mg and hit enter and it the console should print you the Game object which is supposed to be singletone. SOME MORE WORDS: It,s 2 am and I'm going to sleep, I've been working on this for several weeks (I'm new to TypeScript, and also new to entity component design but i think i love both) So I hope more developers are interested in this and with the help of the community to make a solid game framework on which anyone could build his own game specific engine. I'm going to write more about the feature and also my plan is to expand the code in new project which will be fully featured game engine but based on ArtemisTS so ArtemisTS is going to be relative small and just a core. Also there is a DART port of Artemis which even has two examples, I've been looking closely to their structure so my goal is to make one example for ArtemisTS too.