Jump to content

Search the Community

Showing results for tags 'moveto'.

  • 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. Greetings, I recently started working in Phaser and it seems like a pretty good framework, for practice I started working on simple top down shooter game and now it seems I have a problem with move toward the object functionality (enemies moving toward player), I have tried few solutions including all from this post: http://www.html5gamedevs.com/topic/3441-movetoobject-help/ but I was unable to make it work, I'm complete noob and probably doing something wrong but I cant figure out what, so I hope some you guys can help me out, thanks in advance. Here is the part of code I have done so far: function create() { game.world.width = 800; game.world.width = 600; game.physics.startSystem(Phaser.Physics.ARCADE); bullets = game.add.group(); bullets.enableBody = true; bullets.physicsBodyType = Phaser.Physics.ARCADE; bullets.createMultiple(50, 'bullet'); bullets.setAll('checkWorldBounds', true); bullets.setAll('outOfBoundsKill', true); player = game.add.sprite(400, 300, 'arrow'); player.anchor.set(0.5, 0.5); game.physics.enable(player, Phaser.Physics.ARCADE); player.body.allowRotation = false; enemies = game.add.group(); enemies.enableBody = true; createEnemies();} function createEnemies () { for (var y = 0; y < 2; y++) { for (var x = 0; x < 5; x++) { var enemy = enemies.create(game.world.randomX, game.world.randomY, 'enemy'); enemy.anchor.setTo(0.5, 0.5); enemy.body.moves = false; } }} function update() { player.rotation = game.physics.arcade.angleToPointer(player); if (game.input.activePointer.isDown) { fire(); } game.physics.arcade.overlap(bullets, enemies, collisionHandler, null, this);}
×
×
  • Create New...