yaroslav kornilov

Members
  • Content count

    8
  • Joined

  • Last visited

About yaroslav kornilov

  • Rank
    Newbie

Contact Methods

  • Twitter
    yaroslav.kornilov.1999@mail.ru
  1. How sprite zoomed in in Phaser ?

    Great thanks!
  2. How sprite zoomed in in Phaser ?

    I have an idea of 2d-arcade multiplayer game, i tried many frameworks and now i think Phaser is tehe most friendly and easy to learn. But i haven't found way to zoom in sprite in phaser. It's really important in my game becouse it used 16-bit stiled sprites. Is any way how i can do it?
  3. Something bad with code.

    Great thanks. And how about zoom?
  4. Something bad with code.

    Thanks, but problem doesn't left. I used debagger - nothing. I used console output, and i understand that problem is wiht last frame in sprite. You can move right, move left - it works, but when you move in 1 direction and the last sprite in spritesheet is appear app crashed. It is strange problem, becouse it must work and it doesn't! Maybe problem is with spriteshet(but it's casual)? And there is one more point. I'd like to zoom in Main hero, but in official guide i didn't found sth about it. Can you help me with it? (sorry for my english, i hope i don't make so mistakes in each word) I put it on server: http://www.yaroslavkornilov.96.lt/MainGamePage.html
  5. Something bad with code.

    The main problem is with strange parametr 'uuid'
  6. Something bad with code.

    body.scrollTop is deprecated in strict mode. Please use 'documentElement.scrollTop' if in strict mode and 'body.scrollTop' only if in quirks mode. phaser.js:20550body.scrollLeft is deprecated in strict mode. Please use 'documentElement.scrollLeft' if in strict mode and 'body.scrollLeft' only if in quirks mode. phaser.js:20551Phaser v1.1.3 - Renderer: WebGL - Audio: WebAudio phaser.js:13613Uncaught TypeError: Cannot read property 'uuid' of null phaser.js:27995 Phaser.Animation.updatephaser.js:27995 Phaser.AnimationManager.updatephaser.js:27547 Phaser.Sprite.updateAnimationphaser.js:18657 Phaser.Sprite.preUpdatephaser.js:18586 Phaser.World.updatephaser.js:13066 Phaser.Game.updatephaser.js:13699 Phaser.RequestAnimationFrame.updateRAFphaser.js:22114 _onLoop This i get with crome- dev tools, i looked into the phaser source, but i can't find whe my code crash. The problem is with animations.
  7. Something bad with code.

    Plese help me with this code, it work's good first 5-6 seconds and then crash(all sprites stop), i don't know to do with it: //begin var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); var MainHero;//окvar Zombie;//окvar upKey;//окvar leftKey;//окvar rightKey;//окvar bullet;var bullets;var bulletTime = 0;var backgroundimage; function preload() { game.load.spritesheet('MainHero', 'playerwithpistol.png', 17, 9, 24); //главный герой game.load.spritesheet('Zombie','zombies.png', 11, 15, 6); // враги game.load.image('bullet', 'bullet.png'); //пуля game.load.image('backgroundimage','backgroundimage.jpg');//фон} function create() { //главный герой MainHero = game.add.sprite(30, 400,'MainHero'); MainHero.animations.add('left', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 10, true);//идти влево MainHero.animations.add('right', [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], 10, true);//идти в право upKey = game.input.keyboard.addKey(Phaser.Keyboard.UP); leftKey = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); rightKey = game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); //пули bullets = game.add.group(); bullets.createMultiple(10, 'bullet'); bullets.callAll('events.onOutOfBounds.add', 'events.onOutOfBounds', resetBullet, this); //enemy Zombie = game.add.sprite(600,30,'Zombie'); Zombie.animations.add('walk'); Zombie.animations.play('walk', 20, true); } function update() { MainHero.body.velocity.x = 0; MainHero.body.velocity.y = 0; //input getting if (leftKey.isDown) { MainHero.x--; MainHero.animations.play('left', 10, true); } else if (rightKey.isDown) { MainHero.x++; MainHero.animations.play('right', 10, true); } if (game.input.keyboard.isDown(Phaser.Keyboard.SPACEBAR)) { fireBullet(); } if (upKey.isDown && MainHero.body.touching.down) { MainHero.body.velocity.y = -350; } } //отдельный модуль 2function resetBullet (bullet) { bullet.kill();} //отдельный модульfunction fireBullet () { if (game.time.now > bulletTime) { bullet = bullets.getFirstExists(false); if (bullet) { bullet.reset(MainHero.x + 3, MainHero.y - 8); bullet.body.velocity.x = +300; bulletTime = game.time.now + 250; } } } //end. // //function create() { ///platforms = game.add.group(); ///var ground = platforms.create(0, game.world.height - 64, 'ground'); //ground.scale.setTo(2, 2); //ground.body.immovable = true; //var ledge = platforms.create(400, 400, 'ground'); ///ledge.body.immovable = true; //ledge = platforms.create(-150, 250, 'ground'); //player.body.gravity.y = 6; //}//отдельный конструктор //самое важное//функция взаимодействия thank's
  8. what's wrong

    what's wrong help please var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update });//иницилизация//куча перемменыхvar MainHero;var Zombie;var upKey;var leftKey;var rightKey;var bullet;var bullets;var bulletTime = 0;var backgroundimage;//загрузка спрайтов для последующего использованияfunction preload() { game.load.spritesheet('MainHero', 'playerwithpistol.png', 17, 17, 24); //главный герой game.load.spritesheet('Zombie','zombies.png', 11, 15, 6); // враги game.load.image('bullet', 'bullet.png'); //пуля game.load.image('backgroundimage','backgroundimage.jpg'); //фон}//инициализация function create() {MainHero = game.add.sprite(30, 400,'MainHero');//добавить гг//MainHero.animations.add('run',10, true);//MainHero.animations.add('left', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], 10, true);//идти влево //MainHero.animations.add('right', [13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], 10, true);//идти в право //враг createZombie(600, 300); //все клавиши upKey = game.input.keyboard.addKey(Phaser.Keyboard.UP); leftKey = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); rightKey = game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); //работа с выстрелом bullets = game.add.group(); bullets.createMultiple(10, 'bullet'); bullets.callAll('events.onOutOfBounds.add', 'events.onOutOfBounds', resetBullet, this); platforms = game.add.group(); var ground = platforms.create(0, game.world.height - 64, 'ground'); ground.scale.setTo(2, 2); ground.body.immovable = true; var ledge = platforms.create(400, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-150, 250, 'ground'); player.body.gravity.y = 6;}//отдельный конструктор function createZombie(x,y) { Zombie = game.add.sprite(x,y,'Zombie'); Zombie.animations.add('walk'); Zombie.animations.play('walk', 15, true); Zombie.health = 100; Zombie.speed = 50; //это на будущее var zombies = [];}//самое важное//функция взаимодействияfunction update() {sprite.body.velocity.x = 0; sprite.body.velocity.y = 0;//регистрация ввода if (leftKey.isDown) { MainHero.x--; //MainHero.animations.play('left', 10, true); } else if (rightKey.isDown) { MainHero.x++; //MainHero.animations.play('right', 10, true); } if (game.input.keyboard.isDown(Phaser.Keyboard.SPACEBAR)) { fireBullet(); } if (cursors.up.isDown && MainHero.body.touching.down) { //MainHero.body.velocity.y = -350; }} function fireBullet () { if (game.time.now > bulletTime) { bullet = bullets.getFirstExists(false); if (bullet) { bullet.reset(MainHero.x + 3, MainHero.y - 8); bullet.body.velocity.x = +300; bulletTime = game.time.now + 250; } }}function resetBullet (bullet) { bullet.kill();}