Jump to content

Search the Community

Showing results for tags 'Spirite'.

  • 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. Hey guyz. collide method doesn't work when spirite is fixed to camera. I attached an image to show you what is the problem. Here's my code: var playState = { xPosition: 0, create: function(){ game.world.setBounds(0, 0, 500, 5000); //Create the World this.createWorld(); //Change background color game.stage.backgroundColor = "#ffffaf"; //Add Player to the World this.player = game.add.sprite(0,0,"player"); game.physics.arcade.enable(this.player); this.player.anchor.setTo(0.5,0.5); this.player.fixedToCamera = true; this.xPosition = game.world.centerX; this.player.cameraOffset.setTo(this.xPosition, game.world.height - 300); //Access to Arrow Keys this.cursor = game.input.keyboard.createCursorKeys(); //Initialize this.emitter = game.add.emitter(0, 0, 20); this.emitter.makeParticles('tear'); this.emitter.setYSpeed(-150,150); this.emitter.setXSpeed(-150,150); this.emitter.gravity = -20; game.camera.follow(this.player); }, update: function(){ game.physics.arcade.overlap(this.layer,this.player,this.playerDie, null, this); game.physics.arcade.collide(this.layer,this.emitter); this.movePlayer(); }, createWorld: function(){ //Starter Map this.startMap = game.add.tilemap('start_map'); this.startMap.addTilesetImage('rect'); this.layer = this.startMap.createLayer('Tile Layer 1'); this.layer.resizeWorld(); this.startMap.setCollision(1); //game.camera.y += -200; }, movePlayer: function(){ if(this.cursor.left.isDown){ this.xPosition += -20; this.player.cameraOffset.setTo(this.xPosition, game.world.height - 300); }else if(this.cursor.right.isDown){ this.player.body.velocity.x = 150; }else{ this.player.body.velocity.x = 0; } }, playerDie: function(){ if(!this.player.alive){ return; } this.player.kill(); // Set the position of the emitter on the player this.emitter.x = this.player.x; this.emitter.y = this.player.y; // Start the emitter, by exploding 15 particles that will live for 600ms this.emitter.start(true, 900, null, 15); game.time.events.add(1000, this.startMenu, this); //Start Menu },};
×
×
  • Create New...