flowabuse

Members
  • Content Count

    22
  • Joined

  • Last visited

Everything posted by flowabuse

  1. I am sorry for this mistake. I was in a rush when I made the post.
  2. https://makizo.itch.io/phaseroids Arrows - Move Ship Space - Fire Weapon A, S, D - Change Weapon 3 Power Ups : - Slow Time - Speed - Shield
  3. Can somebody who is already using the TernJS plugin for vim help me configure the .tern-project file for a phaser project. I have generatated the files using yeoman phaser-official generator so my folder structure looks like this: src/ | assets/ | bower_components/ | | phaser-official/ | css/ | js/ | | boot.js | | game.js | | main.js | | main.js.bkup | | menu.js | | preloader.js | index.html Do I have to use RequireJS to configure Tern? If yes, is there any generator that does it automaticaly? I've never used RequireJS before so I don't know how to set my project up with it.
  4. I'm having an issue when using phsics.p2.enable on a sprite object. It shows me an error: Uncaught TypeError: Cannot read property 'set' of undefined. ( on object.anchor.set(0.5); ). Using physics.p2.enableBody works fine but I don't know if its the same as .enable, I don't want to have further problems. Here is the code: var Ball = function (game, x ,y ) { Phaser.Sprite.call(this, game, x, y); var graphics = game.add.graphics(0, 0); graphics.beginFill(0xffffff); graphics.lineStyle(1, 0x000000, 0.5); graphics.drawCircle(0, 0, BALL_RADIUS); graphics.endFill(); //this.anchor.setTo(0.5, 0.5); this.addChild(graphics); game.add.existing(this); game.physics.p2.enable(this, true); //game.physics.p2.enableBody(this, true); this works }; Ball.prototype = Object.create(Phaser.Sprite.prototype); Ball.prototype.constructor = Ball; Ball.prototype.update = function() { };
  5. You must save changes first. Ctrl-s should work... if not, you can press the buttons above the editing window (a floppy disk icon should appear). Your link should look like this https://phaser.io/sandbox/edit/QmrAYCBF
  6. Solved here: http://www.html5gamedevs.com/topic/15562-is-physicsp2enablebody-the-same-as-physicsp2enable/#entry88148
  7. The sandbox is automatically saved. You just have to save the link somewhere and just type it in.
  8. Where should i declare my graphics variable then? Can't get it to work, i'm sorry if it's very obvious and i'm being a nub.
  9. https://phaser.io/sandbox/edit/tpauMNLC When i try to enable p2 physics for a sprite i get Uncaught TypeError: Cannot read property 'set' of undefined. for the object.anchor.set(0.5); of @method Phaser.Physics.P2#enableBody. Please check the link above. Also how do i go about debugging in Sandbox? I have tried putting breakpoints in VM#### but a new one starts everytime i refresh or change something so that didn't work.
  10. Will the Phaser Sandbox get an autocomplete feature? The snippets are useful but a real autocomplete would be an awesome time saver and miss typing corrector. I love the Sandbox and currently using it on a Samsung Chromebook(the first one made) to learn game development.
  11. Oh, wow this is awesome! Thank you for the tip!
  12. Is there any way to use the vim keyboard shortcuts with the Phaser Sandbox? I'm currently using Typescript with Phaser because of the Autocomplete and VsVim plugin, but if the sandbox would have vim editing mode that would be awesome!
  13. The problem is I want the physics body shape to be the same as the 'pie' object, and to modify it using the 'progress'. So a rectangle or a circle body won't work for me.
  14. How can I add physics to a object like this :http://jsfiddle.net/f6tf8ue9/17/ ? I am trying to make a breakout game and i want to use an arc that moves and scales in a circular manner ( exactly like the progress bar in the link) , that would be my paddle that would not allow a ball to reach the center. Can this even be done?
  15. Wow, i thought linking Visual Studio to Chrome and refreshing linked browsers would save my changes that I made in my .ts file and update my .js file but it did't do that for me. So the code actualy worked but I've been failing to spot this.
  16. I'm having a bit of trouble trying to scale the body of my circle sprite using circleSprite.body.data.shapes[0] which I found in this thread http://www.html5gamedevs.com/topic/10094-cant-scale-sprite-body-using-tween/#entry59444 The sprite starts moving in a weird pattern across the screen. Here is a gif showing the movement: http://makeagif.com/i/SeqG8k I'm sorry if it's something obvious, I'm new to Phaser. class SimpleGame { constructor() { this.game = new Phaser.Game(800, 600, Phaser.AUTO, 'content', { create: this.create, update: this.update , render: this.render }); } game: Phaser.Game; circleSprite: Phaser.Sprite; graphics: Phaser.Graphics; circle: PIXI.Graphics; create() { this.circleSprite = this.game.add.sprite(200,300); this.game.physics.startSystem(Phaser.Physics.P2JS); this.graphics = this.game.add.graphics(0, 0); this.graphics.lineStyle(4, 0xFF0000, 0.5); this.circle = this.graphics.drawCircle(0, 0, 50); this.graphics.endFill(); this.circleSprite.addChild(this.circle); this.game.physics.enable(this.circleSprite, Phaser.Physics.P2JS,true); this.circleSprite.body.setCircle(20); this.game.add.tween(this.circleSprite.body.data.shapes[0]).to({ radius: 90 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true); update() { } render() this.game.debug.inputInfo(50, 50)}window.onload = () => { var game = new SimpleGame();}