Search the Community

Showing results for tags 'disable'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 10 results

  1. Is it possible to disable or remove physics completely? No bodies, no collisions, no updates.
  2. When profiling my game in chrome, 8-20% of the time is spent in processInteractive(), but to my knowledge I haven't enabled interactions. Is there a way to turn them off? Is there a way to turn them on *accidentally* ? Perhaps by adding a function to a pixi object like sprite.onmousemove = fn; or something like that? The game is live (works best in Chrome, not sure about the others) http://sharkz.io/ . If you play it and run the profiler you can see what I mean. I've also attached a screen shot of the profile. The source code is http://sharkz.io/js/app.js which I've searched for the strings 'interactive', 'interaction', 'interact' which do not appear as far as I can tell. Thank you!
  3. var player; var keys; var shootButton; var bullet; function create() { //game.add.sprite(0,0, 'background'); game.physics.startSystem(Phaser.Physics.ARCADE); //creates player player = game.add.sprite(0.45*600,600-50,'galaga'); game.physics.arcade.enable(player); // allows player to fire 2 bullets bullet = game.add.weapon(2,'bullet'); // when bullet leaves the screen, it will be destroyed bullet.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; // offset rotation bullet.bulletAngleOffset = 90; // prevents ship from auto firing bullet.autofire = false; // The speed at which the bullet is fired bullet.bulletSpeed = 400; //keeps track of how many bullets were shot bullet.shots = 0; // Tell the bullet to track the 'player' Sprite, offset by 16px horizontally, 0 vertically bullet.trackSprite(player, 16, 0); //enabling keyboard use keys = game.input.keyboard.createCursorKeys(); shootButton = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); } function update() { // Reset the players velocity (movement) player.body.velocity.x = 0; if (keys.left.isDown) { // Move to the left player.body.velocity.x = -150; } else if (keys.right.isDown) { // Move to the right player.body.velocity.x = 150; } else { //ship is idle } //shooting the bullet if (shootButton.isDown) { bullet.fire(); } } What I'm trying to do is prevent my player variable from autofiring(holding down space button to fire bullets.). I want the player to be able to shoot two bullets at a time, but only when the player presses the fire button rather than holding it. I was under the impression that bullet.autofire = false; would do the trick, but I was wrong. Am I using the autofire variable the wrong way?
  4. Disable last group-child body

    Hello, I have been stuck on something regarding groups. I want a group to only have the newest group object use body physics, but once a new one is spawned, the old one's body gets disabled. Illustrations might explain it better Then after a new object is added...
  5. Disable mouse inputs

    I have Sprite and Sprite2 and i want to control only one at a time. Right now if i press somewhere on the screen, they both go in the direction of where the mouse was. What i would like to do is have only Sprite move there and if i press on Sprite2 and click somewhere on the screen again, only Sprite2 moves there and Sprite keeps on doing what it was doing before and not care about the mouse click. Is this possible?
  6. Crisp Text for Small Canvas

    Hello guys! I develop a small game. Really, its size is 90x160 pixels I scale it with Phaser scaling stuff. So i get a nice retro look. But there is something which went really wrong. It is the text. If i use simple game.add.text with Arial or using a bitmapText doesen't matters. There is always some kind of anti-alias or smoothing. Is there a way to get a Text crispy with hard edges? For a better understanding i have attached a screenshot. Tom
  7. I am making a spaceship game, to be more optimized I want to avoid calculing collisions when are far away from the player. I tried doing: 1) enemy.body.enable = false;2) Also this doesn't work. Because I never set it to true: enemy.body.data.shapes[0].sensor = false;3) Kill and revive them: it's not the best solution, because I want them to change positions. Nothing seems to work. What can I do? This is a part of my code for collisions in p2: this.body.setCollisionGroup(enemyCollisionGroup);this.body.collides([bulletCollisionGroup, playerCollisionGroup, enemyCollisionGroup, asteroidCollisionGroup], null );this.body.onBeginContact.add( this.startConstantDamage, this );this.body.onEndContact.add( this.endConstantDamage, this );Thanks
  8. Hi, I just creating pinball game with Phaser... I'm using P2 physics. I have one sprite BALL: this.ball = game.add.sprite(x, y, 'ball'); game.physics.p2.enable(this.ball, false); this.ball.body.setCircle(10); this.ball.body.fixedRotation = true;But in one case I need to make this ball to ignore collisions with all elements... (ball should to pass through other sprites without collisions) I just need to turn off gravity, collision and then randomly move ball to different place and then turn gravity/collisions ON. I'm trying to create ball movement in rails above other elements.
  9. Hello there I have a simple question: Is it possible to enable only one or two faces of a polygon body ? Furthermore, would it make me gain performances ? Is it worth it ? Thank you Edit: In fact I'm talking about the physic properties (will it collides or not), maybe it wasn't clear in my post.