Jump to content


  • Content Count

  • Joined

  • Last visited

About lukaMis

  • Rank
    Advanced Member

Contact Methods

  • Website URL
  • Twitter

Profile Information

  • Gender
  • Location
  • Interests
    Js, Html5, motion graphics.

Recent Profile Visitors

1759 profile views
  1. Tweens and physics do not mix particularly well. If you use physics system you should move your objects with physics forces not tweens. If you need physics just for collisions u can use overlap instead and move objects with tweens.
  2. You are starting P2JS physics system and than checking for collide with arcade physics system. You can only have one system active in Phaser.
  3. Yes. You get images in your code from file-names of images in atlas not coordinates.
  4. Give them images correct file names before you pack them in atlas (blue.png, red.png, green.png) then you can reference them with that names. // (x, y, atlas_key, name_of_image_in_atlas) this.mySprite = this.game.add.sprite(0, 0, 'atlas_key', 'name_of_image_in_atlas');
  5. lukaMis

    where to start?

    http://phaser.io/examples http://www.emanueleferonato.com/ http://www.lessmilk.com/phaser-tutorial/ good luck, and have fun.
  6. I use Prepros. It has checkbox that you check for transpiling to es5.
  7. This time i made demo in english. link: http://demo.irokus.si/luka/crkovnica/kem8_crk_01/index.html This game is part of our html5 powered textbook for seventh grade of primary school. It is a serious game as it uses game-like mechanic to teach chemistry. It is made with html5, css3, jquery... no Phaser here. Goal is to find all the hidden words by clicking on letters. (Do dragging, we support touch and mouse enabled devices.). Can you find them all? Texts are supplied via json, that means i can just load different words or different language or different subjects (physics
  8. this.game.renderer.renderSession.roundPixels = true; Can that be set in like Boot state or it needs to be in main game state?
  9. lukaMis

    GUI - Html or Canvas

    It depends how much gui you have. A few buttons are easier wth phaser alone. If you plan dropdown menus and off-canvas navigation than css3 is your friend. Here is example that has gui in html&css3 and phaser for animation render. (Spoiler that is mine): http://demo.irokus.si/irokusplus/kem8uc/kem8_ani_02/ There are no problems with mixing dom and canvas... Just structure you code appropriately. Phaser and jquery have very different ideas about code organization.
  10. I was not thinking global globals like old school but one global object to namespace everything. Like this var MyGame = MyGame || {}; MyGame.game = new Phaser.game(); MyGame.triggerUi =function () { // do UI magic here } ; Atm I structure stuff like this. As I am Always looking for better options that is the reason I started this topic.
  11. Interlocking would be great, i agree. Our designer has chosen wrong gears i guess. Gears of different sizes rotate with different speeds. That is all there is to it. This is part of our html5 powered textbook and serves as simulation/aide/presentation for teacher when he/she explains this stuff to pupils. This is finished and in use.
  12. Where ever you set the x and y of a sprite. Just do this: mySprite.x = Math.round(value): mySprite.y = Math.round(value): or mySprite = this.game.add.sprite(Math.round(value), Math.round(value), 'key');
  13. You can just not tween rotation in some tweens or if you must you can save and pass it in tween: var _angle = this.mySprite.angle; this.mySprite.moveTween = this.game.add.tween(this.mySprite).to( { x: some_value, y: some_value, rotation: _angle }, 1000, Phaser.Easing.Sinusoidal.InOut, true); or you can save it as property of your sprite and tween it this.mySprite.myNewAngle = 90; this.mySprite.moveTween = this.game.add.tween(this.mySprite).to( { x: some_value, y: some_value, rotation: this.mySprite.myNewAngle }, 1000, Phaser.Easing.Sinusoidal.InOut, true);
  14. When you use atlas there is an additional argument you need to pass to add sprite function: // (x, y, atlas_key, name_of_image_in_atlas) this.mySprite = this.game.add.sprite(0, 0, 'atlas_key', 'name_of_image_in_atlas');
  • Create New...