Jump to content

Search the Community

Showing results for tags 'bad'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. 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
×
×
  • Create New...