gabdab

Members
  • Content count

    20
  • Joined

  • Last visited

  1. Is there a way to change default anchor points to 0.5 , 0.5 in for all sprites in a row ? Mighty Editor Source editing ?
  2. Can you monetize games on Facebook somehow ?
  3. Is there an example of how to share like on facebook or twitter ?
  4. Seen that . I am trying to cope with DFP AdSense mechanics . Gaming portal ads systems are next on my to-do list .
  5. I am after ads for games on game portals like kongregate and else . Googling it I got: http://www.cpmfun.com/ An ad network , not sure how it comes in . http://www.labnol.org/internet/google-dfp-tutorial/14099/ Google Doubleclick idem . http://ad4game.com/adspec/html5sdk/ Ad4game .. http://gamemix.com/developers/ Game mix , not directly related . I am confused as of now .
  6. Is it allowed to monetize a Phaser based game for the web ( not mobile) trough Google AdSense ads ?
  7. Avoid sqrt if possible by using squared distance (ex: dist = 2 ; sqdist = 4): functiondistanceSq(object,target) { var xDif = object.x - target.x; var yDif = object.y - target.y; return (xDif * xDif) + (yDif * yDif); };
  8. I was setting up a sort of path for player to follow based on a set of images exported from inkscape and parsed with python as a .svg . So I need to find the center of image , not set the anchor . I have sort of solved it , by exporting a path from inkscape and converting it to an array for phaser to parse and feed to a tween (points and angles) . Also I found an old post where it is outlined how to find the center of an image : http://gamedev.stackexchange.com/questions/57211/how-to-get-the-center-of-a-rotated-rectangle-regardless-of-point-of-rotation
  9. How do you find an image center without arcade physics ? As an example I am using a matrix as exported by inkscape , but elements order looks different. -45 degrees rotation about (0,0) of a 10 by 10 px image square es ( can't figure out if correct) : var tank = this.add.image(-5, 5, 'testImg'); var ar = [0.70710678,0.70710678,0,-0.70710678,0.70710678,0];//svg inkscape matrix var mat = new Phaser.Matrix(); console.log(tank.getBounds(mat.fromArray(ar)));
  10. By using intel xdk , it complains about window not being defined and so on . I included cordova.js before phaser in index.html, but it isn't recognized apparently . Any hint ? [EDIT] Just checking this app -Audio Player- from intel xdk repository : https://github.com/gomobile/sample-audio-player
  11. Yes , perfect ! Thanks a bunch .
  12. How do you code a simple drop down button menu for a game ?
  13. [SOLVED] line end (pointer position) must be relative to bitmapdata so : bitmapdata center +( pointer.pos - sprite.pos): this.bmd.ctx.lineTo(148+this.input.worldX-this.sprite.x,148+this.input.worldY-this.sprite.y); How does phaser handle such relative positions ? drawLine: function(){ this.sprite.x= player.body.position.x; this.sprite.y=player.body.position.y; this.bmd.clear(); this.bmd.ctx.beginPath(); this.bmd.ctx.moveTo(148,148); this.bmd.ctx.lineTo(148+this.input.worldX-this.sprite.x,148+this.input.worldY-this.sprite.y); //this.input.x-this.sprite.x , this.input.y-this.sprite.y); //this.input.activePointer.position.x+this.sprite.x,this.input.activePointer.position.y+this.sprite.y); //this.input.activePointer.position.x,this.input.activePointer.position.y); console.log(this.sprite.x-this.input.worldX,this.sprite.y-this.input.worldY); //this.sprite.x+this.input.activePointer.position.x,this.sprite.y+this.input.activePointer.position.y); this.bmd.ctx.lineWidth = 4; this.bmd.ctx.stroke(); this.bmd.ctx.closePath(); this.bmd.render(); //this.bmd.refreshBuffer(); this.bmd.update(); } [WAS] -larger than canvas map scrolling - I am struggling to get a simple mouse pointer / player line behaving properly on a 2516x2146 map inside a 960x640 canvas . Looks like mouse pointer position is wrong , not calculating map scroll somehow. I am using this example , which doesn't work as expected in my code : http://codepen.io/codevinsky/pen/dAjDp create: this.bmd = game.add.bitmapData(296, 296); var color = 'white'; this.bmd.ctx.beginPath(); this.bmd.ctx.lineWidth = "4"; this.bmd.ctx.strokeStyle = color; this.bmd.ctx.stroke(); this.sprite = game.add.sprite(player.body.position.x, player.body.position.y, this.bmd); this.sprite.anchor.set(0.5); update: drawLine: function(){ this.sprite.x= player.body.position.x; this.sprite.y=player.body.position.y; this.bmd.clear(); this.bmd.ctx.beginPath(); this.bmd.ctx.moveTo(148,148); this.bmd.ctx.lineTo( this.input.activePointer.position.x,this.input.activePointer.position.y); this.bmd.ctx.lineWidth = 4; this.bmd.ctx.stroke(); this.bmd.ctx.closePath(); this.bmd.render(); //this.bmd.refreshBuffer(); this.bmd.update(); },
  14. It is a easy task to port RVO2 library ( RVO2 Library: Reciprocal Collision Avoidance for Real-Time Multi-Agent Simulation ) to js with emscripten. Looking for suggestions on best interoperability with phaser .
  15. Is there a way to avoid player passing trough collidable tiles sometimes ? Would using a different system other than tilemaps for collision avoid it ?