mariante

Members
  • Content Count

    13
  • Joined

  • Last visited

  1. Thanks mate i'll try some codes later.. (pode me add no facebook henrique? facebook.com/pablomariante)
  2. Hi Henrique, I'll try some stuffs.. Have you an AngularJS doc that can help me? Thanks
  3. An example of what i want to do with PHASER http://www.aasoberana.com.br/simulador/simulador.php?site=asoberana
  4. Hello all, I'm actually doing a service system to my company with Phaser. So then I want to export this, because the client will fill the truck with his stuff and I'll create a SAVE button to export this to my email or to a server so I can read what the client want to take in the change. Sorry for my english... Is there any way to do this with Phaser like i'm doing or you guys recommend me other framework?! Thanks in advance!
  5. Code: initGraphics: function(){ this.backgroundImage = this.game.add.tileSprite(0, 0, 440, 600, spriteAssets.backgroundName); this.backgroundGraphics = this.game.add.graphics(0, 0); this.backgroundGraphics.lineStyle(2, 0xFFFFFF, 1); for (var x = 0; x < gameProperties.screenHeight; x += gameProperties.dashSize * 2) { this.backgroundGraphics.moveTo(x, this.game.world.centerY); this.backgroundGraphics.lineTo(x, this.game.world.centerY + gameProperties.dashSize); } this.ballSprite = this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, spriteAssets.ballName); this.ballSprite.anchor.set(0.5, 0.5); this.ballSprite.scale.setTo(0.09, 0.09); this.ballSprite.filters = [ this.game.add.filter('Glow') ]; this.paddleUpSprite = this.game.add.sprite(this.game.world.centerX, gameProperties.paddleLeft_y, spriteAssets.paddleName); this.paddleUpSprite.anchor.set(0.5, 0.5); this.paddleDownSprite = this.game.add.sprite(this.game.world.centerX, gameProperties.paddleRight_y, spriteAssets.paddleName); this.paddleDownSprite.anchor.set(0.5, 0.5); }, initGraphicsBarreira: function(x){ var qnt = 25; for(var j = 0; qnt >= j; j++){ var p = j*22; //this.barreiraGroup.create(x, j+p, spriteAssets.backgroundBarreira); this.barreiraSpriteS = this.game.add.sprite(x, j+p, spriteAssets.backgroundBarreira); this.barreiraGroup.add(this.barreiraSpriteS); this.barreiraGroup.setAll('tint', '0x677E52'); this.barreiraGroup.setAll('blendMode', PIXI.blendModes.MULTIPLY); } }, initPhysics: function(){ this.game.physics.startSystem(Phaser.Physics.ARCADE); this.game.physics.arcade.enable(this.ballSprite); this.ballSprite.checkWorldBounds = true; this.ballSprite.body.collideWorldBounds = true; this.ballSprite.body.immovable = true; this.ballSprite.body.moves = true; this.ballSprite.body.bounce.set(1); this.paddleGroup = this.game.add.group(); this.paddleGroup.enableBody = true; this.paddleGroup.physicsBodyType = Phaser.Physics.ARCADE; this.paddleGroup.add(this.paddleUpSprite); this.paddleGroup.add(this.paddleDownSprite); this.paddleGroup.setAll('checkWorldBounds', true); this.paddleGroup.setAll('body.collideWorldBounds', true); this.paddleGroup.setAll('body.immovable', true); this.barreiraGroup = this.game.add.group(); this.barreiraGroup.enableBody = true; this.barreiraGroup.physicsBodyType = Phaser.Physics.ARCADE; this.initGraphicsBarreira(0); this.initGraphicsBarreira(this.game.world.centerX+190); this.barreiraGroup.setAll('checkWorldBounds', true); this.barreiraGroup.setAll('body.collideWorldBounds', true); this.barreiraGroup.setAll('body.immovable', true); this.barreiraGroup.setAll('body.moves', false); this.barreiraGroup.setAll('body.allowGravity', false); }, update: function(){ this.moveLeftPaddle(); this.moveRightPaddle(); this.smokeEmitter.x = this.ballSprite.x; this.smokeEmitter.y = this.ballSprite.y; this.game.physics.arcade.overlap(this.ballSprite, this.paddleGroup, this.collideWithPaddle, null, this); this.barreiraGroup.forEach(function(barreiras){ console.log(this.ballSprite, barreiras); this.game.physics.arcade.collide(this.ballSprite, barreiras); }, this); }, render: function(){ //this.game.debug.bodyInfo(this.ballSprite, 0, 20); this.barreiraGroup.forEachAlive(this.renderGroup, this); }, renderGroup: function(member){ this.game.debug.body(member); }, } Result:
  6. Thanks guys, maybe WebSocket is better.. Any good tutorials by implementing Nodejs or WebsocketIO or others in my games?!
  7. S*#% bro! Already tryied everything and nothing different (or collides and moves or doesnt collide).. Last try was adding forEach in update for collides this.barreiraGroup.forEach(function(barreiras){ this.game.physics.arcade.collide(this.ballSprite, barreiras); }, this); but no success.. My create and update: create: function(){ //this.game.rnd.integerInRange(0,800) //RANDOM //this.game.state.start("game"); //COMEƇA OUTRA TELA this.initGraphics(); this.initPhysics(); this.initKeyboard(); this.startDemo(); this.smokeTrail(); }, update: function(){ this.moveLeftPaddle(); this.moveRightPaddle(); this.smokeEmitter.x = this.ballSprite.x; this.smokeEmitter.y = this.ballSprite.y; this.game.physics.arcade.overlap(this.ballSprite, this.paddleGroup, this.collideWithPaddle, null, this); this.barreiraGroup.forEach(function(barreiras){ this.game.physics.arcade.collide(this.ballSprite, barreiras); }, this); }, My 3 others importantes functions: initGraphics: function(){ this.backgroundImage = this.game.add.tileSprite(0, 0, 440, 600, spriteAssets.backgroundName); this.backgroundGraphics = this.game.add.graphics(0, 0); this.backgroundGraphics.lineStyle(2, 0xFFFFFF, 1); for (var x = 0; x < gameProperties.screenHeight; x += gameProperties.dashSize * 2) { this.backgroundGraphics.moveTo(x, this.game.world.centerY); this.backgroundGraphics.lineTo(x, this.game.world.centerY + gameProperties.dashSize); } this.ballSprite = this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, spriteAssets.ballName); this.ballSprite.anchor.set(0.5, 0.5); this.ballSprite.scale.setTo(0.09, 0.09); this.ballSprite.filters = [ this.game.add.filter('Glow') ]; this.paddleUpSprite = this.game.add.sprite(this.game.world.centerX, gameProperties.paddleLeft_y, spriteAssets.paddleName); this.paddleUpSprite.anchor.set(0.5, 0.5); this.paddleDownSprite = this.game.add.sprite(this.game.world.centerX, gameProperties.paddleRight_y, spriteAssets.paddleName); this.paddleDownSprite.anchor.set(0.5, 0.5); }, initPhysics: function(){ this.game.physics.startSystem(Phaser.Physics.ARCADE); this.game.physics.arcade.enable(this.ballSprite); this.barreiraGroup = this.game.add.group(); this.barreiraGroup.enableBody = true; this.barreiraGroup.physicsBodyType = Phaser.Physics.ARCADE; this.barreiraGroup.setAll('body.immovable', true); this.barreiraGroup.setAll('body.moves', false); this.barreiraGroup.setAll('body.allowGravity', false); this.initGraphicsBarreira(0); this.initGraphicsBarreira(this.game.world.centerX+190); this.ballSprite.checkWorldBounds = true; this.ballSprite.body.collideWorldBounds = true; this.ballSprite.body.immovable = true; this.ballSprite.body.bounce.set(1); this.paddleGroup = this.game.add.group(); this.paddleGroup.enableBody = true; this.paddleGroup.physicsBodyType = Phaser.Physics.ARCADE; this.paddleGroup.add(this.paddleUpSprite); this.paddleGroup.add(this.paddleDownSprite); this.paddleGroup.setAll('checkWorldBounds', true); this.paddleGroup.setAll('body.collideWorldBounds', true); this.paddleGroup.setAll('body.immovable', true); }, initGraphicsBarreira: function(x){ var qnt = 25; for(var j = 0; qnt >= j; j++){ var p = j*22; this.barreiraGroup.create(x, j+p, spriteAssets.backgroundBarreira); this.barreiraGroup.setAll('tint', '0x677E52'); this.barreiraGroup.setAll('blendMode', PIXI.blendModes.MULTIPLY); } },
  8. Hi, I'm thinking in few ideas to create a game but i was wondering if is there a way to interact with bluetooth in Phaser (or some javascript pure that its possible to implement). Any ideas?! Thanks in advance
  9. Hi again @alessandronunes, i tryied your code but no success... Look my code updated with your help: ................ initGraphics: function(){ ............. ............. this.barreiraGroup = this.game.add.group(); this.barreiraGroup.enableBody = true; this.barreiraGroup = this.game.add.physicsGroup(); this.initGraphicsBarreira(0); this.initGraphicsBarreira(this.game.world.centerX+190); ............. }, initGraphicsBarreira: function(x){ var qnt = 25; for(var j = 0; qnt >= j; j++){ var p = j*22; var barreira = this.barreiraGroup.create(x, j+p, spriteAssets.backgroundBarreira); barreira.body.immovable = true; barreira.body.moves = false; barreira.body.allowGravity = false; barreira.tint = 0x677E52; barreira.blendMode = PIXI.blendModes.MULTIPLY; } }, update: function(){ ............... this.game.physics.arcade.collide(this.ballSprite, this.barreiraGroup); }, ............... And here the result (same, no collide): @edit: If i put the barreira.body.immovable = true; barreira.body.moves = false; barreira.body.allowGravity = false; outside the for loop, i get the same result like before (collide and move):
  10. Thanks mate, ill try your help, after i test i post here the feedback.
  11. Hi, i'm trying to make my bomb collide with the sprite at border left and right, it's colliding but i wanna make them immovable and i'm getting stuck. this.backgroundImage = this.game.add.tileSprite(0, 0, 440, 600, spriteAssets.backgroundName); this.backgroundGraphics = this.game.add.graphics(0, 0); this.backgroundGraphics.lineStyle(2, 0xFFFFFF, 1); //this.barreiraGroup = this.game.add.group(); this.barreiraGroup = this.game.add.physicsGroup(); for(var j = 0; qnt >= j; j++){ var p = j*22; //this.barreiraGroup.create(0, j+p, spriteAssets.backgroundBarreira); this.backgroundBarreira = this.game.add.sprite(0, j+p, spriteAssets.backgroundBarreira); this.backgroundBarreira.tint = 0x677E52; this.backgroundBarreira.blendMode = PIXI.blendModes.MULTIPLY; this.barreiraGroup.add(this.backgroundBarreira); } for(var j = 0; qnt >= j; j++){ var p = j*22; //this.barreiraGroup.create(this.game.world.centerX+190, j+p, spriteAssets.backgroundBarreira); this.backgroundBarreira = this.game.add.sprite(this.game.world.centerX+190, j+p, spriteAssets.backgroundBarreira); this.backgroundBarreira.tint = 0x677E52; this.backgroundBarreira.blendMode = PIXI.blendModes.MULTIPLY; this.barreiraGroup.add(this.backgroundBarreira); } //this.barreiraGroup.setAll('body.immovable', true); //this.barreiraGroup.setAll('body.moves', false); With that code, my result: But without comment: this.barreiraGroup.setAll('body.immovable', true); this.barreiraGroup.setAll('body.moves', false); My result: NO COLLIDE
  12. Thanks symof but my mistake was another that I already solved.. collisionTiles = game.physics.p2.convertTilemap(map, tiles); That was... About the range of collision, i set it to 87 and works nice but not perfect.. I can fix that i think, maybe Tiled wrong exportation.
  13. Hello, I'm new at Phaser and i'm trying to make a map in Tiled and use it in my game, but the collide isn't working. My json Data: "data":[100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 100, 100, 100, 100, 100, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 100, 100, 100, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 100, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 100, 100, 102, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, 100, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 86, 86, 86, 86, 86, 86, 86, 86, 86, 87, 86, 86, 86, 86, 86, 86, 86, 86, 100, 100, 100, 100, 100, 100, 100, 100, 100, 86, 86, 86, 86, 86, 86, 86, 86, 86, 86, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100], map.setCollisionBetween(0, 999, true); Already tyied everything... Any solutions?! Thanks in advance!