VitaZheltyakov

Members
  • Content Count

    184
  • Joined

  • Last visited

Everything posted by VitaZheltyakov

  1. player.body.mass = 1; animal.body.mass = 999;
  2. sprite1.body.mass = 99999999; sprite2.body.mass = 99999999;
  3. Use code: var configuration = { 'render' : Phaser.CANVAS, // Render type 'canvas_width_max' : 2048, // The maximum width of the canvas 'canvas_width' : 1000, // The width of the canvas 'canvas_height_max' : 2048, // The maximum height of the canvas 'canvas_height' : 650, // The height of the canvas 'scale_ratio' : 1, // Scaling factor 'aspect_ratio' : 1, // Aspect ratio }; // Calculate the scaling factor and the aspect ratio configuration.canvas_width = window.screen.availWidth * window.devicePixelRatio; configuration.canvas_height = window.screen.availHeight * window.devicePixelRatio; configuration.aspect_ratio = configuration.canvas_width / configuration.canvas_height; if (configuration.aspect_ratio < 1) configuration.scale_ratio = configuration.canvas_height / configuration.canvas_height_max; else configuration.scale_ratio = configuration.canvas_width / configuration.canvas_width_max; game = new Phaser.Game(configuration.canvas_width, configuration.canvas_height, configuration.render, 'gamewindow', { preload: preload, create: create, update: update, render: render }); player = game.add.sprite(game.world.centerX, game.world.centerY, 'player'); player.scale.set(configuration.scale_ratio);
  4. setCircle(45); It sets new size and ignores the scale. You need use: setCircle(45*scaleValue);
  5. https://github.com/VitaZheltyakov/phaser-nine-patch-plugin
  6. What does the server?
  7. Use the forum search. This topic has been discussed a thousand times.
  8. Performance is almost the same.
  9. Yes, 'addMoveCallBack' not detect 'pointer.isUp'
  10. The angle of the Body in radians
  11. VitaZheltyakov

    Zoom

    https://github.com/photonstorm/phaser-examples/blob/master/examples/camera/zooming%20the%20camera.js
  12. I can assume that the problem is associated with different screen sizes. The relative sizes of the player are the same?
  13. Do as described in the commentary above. And turn off the GPU-backlist in Crosswalk
  14. Arcade, Box2D, P2 have good performance on PC. On mobile - only Arcade
  15. This code works as well as for portrait and landscape modes.
  16. Solution: game.input.enabled = false;
  17. I fixed a few bugs and added new argument "keyInCache". This optional argument specifies the name under which the image is stored in the PIXI.Texturecache. This is useful when creating multiple images. See examples
  18. var configuration = { 'canvas_width_max' : 2048, 'canvas_width' : 1000, 'canvas_height_max' : 2048, 'canvas_height' : 650, 'scale_ratio' : 1, 'aspect_ratio' : 1, }; configuration.canvas_width = window.screen.availWidth * window.devicePixelRatio; configuration.canvas_height = window.screen.availHeight * window.devicePixelRatio; configuration.aspect_ratio = configuration.canvas_width / configuration.canvas_height; if (configuration.aspect_ratio < 1) configuration.scale_ratio = configuration.canvas_height / configuration.canvas_height_max; else configuration.scale_ratio = configuration.canvas_width / configuration.canvas_width_max; game = new Phaser.Game(configuration.canvas_width, configuration.canvas_height, options.render, 'gamewindow'); this.game.scale.fullScreenScaleMode = Phaser.ScaleManager.SHOW_ALL; this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.game.scale.refresh(); sprite.scale.set(configuration.scale_ratio);
  19. //---------- Функция записи массива данных в локальное хранилище -------------// // array - сам массив, section - раздел данных (название массива) function dataSave(array, section) { for (key in array) { if (typeof section !== "undefined") { window.localStorage[section+'-'+key] = array[key]; } else window.localStorage[key] = array[key]; } }; //----------------------------------------------------------------------------// //--------- Функция чтения массива данных из локального хранилища ------------// // section - раздел данных (название массива) function dataLoad(array, section) { for (key in array) { if (typeof window.localStorage[section+'-'+key] !== "undefined") { if (!isNaN(window.localStorage[section+'-'+key])) array[key] = parseInt(window.localStorage[section+'-'+key], 10); else array[key] = window.localStorage[section+'-'+key]; } } }; //----------------------------------------------------------------------------//
  20. Hi! How PIXI.Texture save in the Phaser.cache, and then use it?
  21. I always use Canvas. In the game settings, the user can select WebGL