StrykerKKD

Members
  • Content Count

    29
  • Joined

  • Last visited

About StrykerKKD

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  • Location
    Hungary
  • Interests
    Html5 Game Development, Node.js, Html5 API, Dart
  1. New version of DartRocket is available.(0.1.5) Changelog Blog post about the update I also started working on the physics system and now the gravity works.
  2. Sprite is a little incomplete and now kills everything that goes out of bounds. Another thing i have to fix for the next update.
  3. New version of DartRocket is available.(0.1.4) Changelog Blog post about the update.
  4. Nice work. There are other Dart ports fo Pixi on pub, but i like yours, because it has a really good documentation.
  5. DartRocket is an open source 2D HTML5 Game Framework, which i made with Dart and it's built on top of StageXL. You can find it on github or pub(Dart package manager). You can also find the documentation on pub, because the documentations are automatically generated for the packages. My goal with this framework is to make the same kind of game framework like Phaser, but using Dart. DartRocket is in alpha(0.1.2), but i already have two examples to show how it works. StateMachine and SpaceInvader. Features: State and StateManager: This was the first thing I made, because i just love to use states and it breaks up the game smaller manageable parts.GameObjects(Sprite,Button,Background)SoundStageXL classes(ResourceManager,Juggler for animation,EventListeners etc..)I started this framework for 4 basic reasons: I couldn't program in Javascript how i wanted and i was never satisfied with my code structure even though i used Require.js . I fell in love with Dart. It's bad practice to fall in love with a language, but it's just too awesome. There was no HTML5 game framework for Dart The challenge that I can create something newI do not recommend using it now because it's in alpha and will have a lot of breaking changes, unless you are a brave developer, who knows or want to know Dart and StageXL. All in all this is what i'm working on now a days.
  6. I started my own little game framework and the first thing that i made was a state machine. It breaks up the code and the game to smaller parts. It's better to have ten smaller source code than a big one. Not to mention you don't have to load every resources at the beginning of the game and the main file of your game looks more clean with states.
  7. Only Phaser is global, so it's not a huge problem and sometimes it comes handy that i don't have to pass Phaser around. I don't even know if it's a good way to require phaser this way. I found this solution by chance and I couldn't find anything about it in the Require.js docs. My guide is pretty old now that Phaser 2.0.0 came out, but you can find here: http://www.html5gamedevs.com/topic/4437-how-to-organize-your-phaser-game-even-better/?hl=organize I remade the Invaders example using require.js with Phaser 2.0.2(No Physics). The best thing about the game is that it uses states. You can find it here: https://github.com/StrykerKKD/SpaceInvaders
  8. I got the same error. My solution is to not give Phaser a name, when loading it. require(['module/Player','lib/phaser.min'],function(Player){ var game = new Phaser.Game(etc..);});This makes Phaser globally accessible, so you can use Phaser in modules without passing it to them.
  9. I remade the space invader phaser game example. What i changed: Phaser 2.0.1 no PhysicsUsing require.jsUsing State and Statemanager4 new stage: Load, Start, Play and EndThe shooting is automatic ( Timer.loop() )There are a lot more bulletsInstead of extending a group, i wrap the group inside a private classPlayer and Aliens are configurable in the sourcePlayer and Aliens have health(Player has healthbar) and bullets have damage What i did not change: ImagesAnimationsSo it almost look the same. You can play it here: http://strykerkkd.github.io/SpaceInvaders/ Source is here: https://github.com/StrykerKKD/SpaceInvaders
  10. Try without the start() function. I think in phaser 2.0 the loop automatically starts. I use the loop this way: event = game.time.events.loop(time,function,this);
  11. @jerome Thanks for the page about states in Phaser. I was thinking about how to make my game more structured. It looks like i need to use states to organize my game better. I think your doc is really good, because it has a good amount of theory and small examples, which covers the theory.
  12. You have to set the checkWorldBounds value to true. From the migration guide: By default Sprites no longer check if they are within the world bounds. It's quite an expensive process (calling getBounds every frame), so you have to enable directly. For example: enemies1.checkWorldBounds = true;
  13. Overwriting your group with a sprite is a bad thing. water = water.getFirstDead();First: make a firstDeadWater variable outside the update loop and firstDeadWater = water.getFirstDead()Use this variable instead of water.
  14. Maybe you should enable the physics for the water as you did with the floor and the player. game.physics.enable(floor, Phaser.Physics.ARCADE);
  15. I'm making a Space invader clone(based on the Phaser example) and i read in the migration guide about outOfBoundsKill being an expensive call, therefore we should use something else. Aha, but what should we use? In this kind of situation, i went to the Phaser docs:http://docs.phaser.io/ and i started searching for something that i can use to solve this problem. In the sprite class i found the lifespan variable. http://docs.phaser.io/Phaser.Sprite.html#lifespan "The lifespan of the Sprite (in ms) before it will be killed." Cool, but how should i calculate the time(lifespan)? Time = Distance / Velocity Time will have to be in ms. The distance will be in pixels. The Velocity has to be in pixels/ms, but in Phaser Velocity's value is in pixels/s , so it need to be converted. We know that 1s = 1000ms(1/1000s = 1ms), so we need to divide Velocity by 1000. Finally we have: Time = Distance / (Velocity/1000) In my case: _bullet.lifespan = _game.height / (_bulletSpeed/1000);Use it with caution, because I don't really know if using lifespan gives us a better performance. Maybe Rich can enlighten us or i test it out.