Anny

Members
  • Content Count

    14
  • Joined

  • Last visited

About Anny

  • Rank
    Member

Profile Information

  • Gender
    Female

Contact Methods

  • Twitter
    Annyv2
  1. I'm having problems using tilemaps created with TIled and colliding with it with the Arcade System, sometimes it detects the collision but other it just does'nt, it's random. Is there a way to fix this? I'm using the same code there's on most examples in this forum this.game.physics.startSystem(Phaser.Physics.ARCADE); map = this.game.add.tilemap('map'); map.addTilesetImage('level1'); layer = map.createLayer('Capa de Patrones 1'); layer.resizeWorld(); map.setCollisionBetween(425, 450); // El judador principal. player = game.add.sprite(200, 400, 'player'); this.game.physics.enable(player, Phaser.Physics.ARCADE); And then in the update function this.game.physics.arcade.collide(player, layer);
  2. Anny

    clickable area

    Hey! I was wondering if there's a way to define a clickable area on the screen without using buttons or sprites. Or to create this effect I would need to create an invisible sprite or something like that? Thanks
  3. Anny

    Connecting Sprites

    Wow, the example is great! I didn't know I could use an array, now I can have a function that creates lines in the arrangement . Thank you! gracias n.n
  4. Anny

    Connecting Sprites

    Hey! I used your pseudocode and it works great, but what if I wanted to create more than one line and leave the previous one drawed in the bitmap? For example, I went from A to B and clicked in B so the line connected them and now I want to connect C and D. I need to use this.line = game.add.bitmapData(800, 600); this.sprite = game.add.sprite(0,0,this.line); for as many lines as I want? Thank you for your time
  5. Anny

    Connecting Sprites

    Hey guys! I have asked about this in different topics but I haven't been able to find a good way to do it. What I need is to connect sprites dragging and dropping a point of one of them (like a button) to connect it to another sprite. I have tried to do this creating lines with a bitmap and using new Phaser.line but I don't want any diagonal line and when I use bitmap I haven't been able to create multiple lines. I thought of adding a sprite with the draw of the line but that wouldn't follow the player's movement ): I wan't it to be whatever the player draws on the field that connects the two sprites (but with straigth lines, like if they were cables that connect 2 electronic pieces) I add an image to illustrate what i'm trying to do Thank you so much in advance PD: Ignore B's position haha
  6. I have the same question, have you found a way to do this?
  7. I need to create lines between 2 sprites like the question before, I tried with this.line = game.add.bitmapData(800, 600); but I don't know why it doesn't work with more than one line, so I went with new Phaser line and I can't find a way to make the lineWidth bigger. What I need is to "connect" sprites with lines, what would be the best way to implement this? Thanks
  8. Anny

    Line moving

    Thank you so much!
  9. Anny

    Line moving

    It doesn't work if I put it on the public folder of dropbox (I read somewhere it was a good way to skip the server thingy) https://dl.dropboxusercontent.com/u/73761993/index.html I used your code
  10. Anny

    Line moving

    This is the complete code // Initialize Phaser var game = new Phaser.Game(800, 600, Phaser.AUTO, 'game_div'); // Creates a new 'main' state that will contain the game var main_state = { // Function called first to load all the assets preload: function() { // Load the sprite this.game.load.image('background', 'images/debug-grid-1920x1920.png'); }, create: function() { this.background = this.game.add.sprite(0,0, 'background'); this.line = game.add.bitmapData(320, 480); }, update: function() { this.line.clear(); this.line.ctx.beginPath(); this.line.ctx.moveTo(origine.x, origine.y); this.line.ctx.lineTo(this.input.activePointer.x , this.input.activePointer.y); this.line.ctx.lineWidth = "5"; this.line.ctx.strokeStyle = origine.color; this.line.ctx.stroke(); this.line.ctx.closePath(); this.line.render(); this.line.refreshBuffer(); }, } // Add and start the 'main' state to start the game game.state.add('main', main_state); game.state.start('main');
  11. Anny

    Line moving

    It's the same that Zaidar put without this line this.lineSprite = game.add.sprite(0, 0, this.line); It's the same if I put that line though
  12. Anny

    Line moving

    Hey! Im trying to implement this with phaser but I get an error saying that ctx is not defined ): do you have any ideas on how to fix this?
  13. Anny

    Phaser 2.0.2 Released

    Hey! Is there a minified version of this update? or how can I do my own? Thanks! Duh. It's in the build folder
  14. Hi I'm really new to phaser I am trying to make something like a factory, where you have to drag and drop "products" that come out of a machine. I created these products as a group but now when I try to drag them, it keeps pointing to the last element created, not to the product i'm clicking on. I'm not sure how to implement this, I saw somewhere on the examples that they used as a parameter _ball and _brick and that somehow works with the current brick. But I don't see how to do this with clicking. I also need to "unite" somehow different elements of a group to create something bigger. Should I do this with diferent functions like the tank examples or is it doable with groups? Thank you so much in advance Here's the code on pastebin http://www.pastebin.ca/2690180