Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


symof last won the day on August 4 2016

symof had the most liked content!

About symof

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Go to this webpage on your smartphone www.goodboydigital.com/pixijs/benchmark/ Keep your input(finger) pressed until the frames drop bellow 30 fps. Share your results. If it's bellow 30fps from the start... Then pixijs does not support that graphics chipset properly. I attached 2 screenshots, - my smarphone Moto g3 3rd generation with Android 6.0.1 - with an astounding 17800 bunnies! - my desktop Dual-Core Pentium G4400 @3.30 per core, with a NVIDIA GT 1060 3Gb. Windows 7, DirectX 11 - with 184,000 bunnies!
  2. So I'm gonna disseminate his code a bit , since his question has been answered anyway var self = this; this.stage.disableVisibilityChange = false; game.add.text(20, 20, 'Level 1', { font: "20px Arial", fill: '#ffffff'}) Now in his current scope "this" refers to the "game" object so what happens here is var self = this; "self" becomes a copy of "this" so in essence it works as a pull request to work on local content. This is good in cases where you don't wish to alter the values in the original, but you want to modify them in your current instance and then dispose of them.
  3. Yes you can use any naming, the way he uses it holds no special meaning, he could have written it as anything and it would made no difference in his current code. var self = this; var this = this; let self = this; var sf = this; var thiz = this; var p = this; But ! "self" is a global operand, so it's scope is pretty much like "this" noadays(and no they are not the same thing but very similar in some aspects), so he should change it to something else such as "-this" and not "_this" since "_" is also used sometimes to declare variables that are in the global scope. Now
  4. That must be it since I have MVPS hosts http://winhelp2002.mvps.org/hosts.htm on all my machines. Which is kinda like an add blocker.
  5. var Obj= { foo: "bar", log: function() { var self = this; console.log("external function: this.foo = " + this.foo); console.log("external function: self.foo = " + self.foo); console.log(this.foo === self.food); (function() { console.log("internal function: this.foo = " + this.foo); console.log("internal function: self.foo = " + self.foo); console.log(this.foo === self.food); }()); } }; Obj.log(); https://jsfiddle.net/caxjvLL0/ Well Initially I wrote a longer post but I kinda deleted it when I wrote the code (Ooops!).
  6. Good game. Loved playing it for around 10 minutes. No clue how it is in 100 players but 1v1 is bad, especially if someone is already with a fully upgraded ship. On my machine I had to refresh the website everytime I died since after pressing play again, all I see is "please wait" greyed out. A few things I think it would improve in the game. 1. Add some base income even without having any satelites. 2. Have the satellites start at level 1, so they can shoot a bit, this was people can hog the satelite to get upgrades if they just spawned. 3. Movement speed shouldn't be
  7. Using Phaser is fine. (hint : the secret word is : phaser) https://jsfiddle.net/cwLfqu0x/3/
  8. I thought maybe I should clarify further. This contains some extracts from https://en.wikipedia.org/wiki/Apple_A7 "Apple states that it is up to twice as fast and has up to twice the graphics power compared to its predecessor, the Apple A6." What this means is that the GPU for A7 should render twice as fast and the older A6, but since you are saying that you get exactly half of 60fps, that leads me to believe that pixi does not properly support 64 bit chipsets or at least the Apple 64 bit chipset. And frankly some of the 64 bit android smartphones are not that widely used. So I
  9. @samid737 The difference here is in the chipset that they are using. iPhone 5C uses Apple A6 The Apple A6 is a 32-bit package on package (PoP) system on a chip (SoC) iPhone 5S uses Apple A7 The Apple A7 is a 64-bit system on a chip (SoC) So this might be a PixiJS issue. And i'm sorry to say I don't really know that much on how pixi works? Maybe @rich can offer some insight on this?
  10. Generally speaking WEBGL and webview will work best on new smartphones. So it does depend on your project needs. There are other alternatives to phaser such as https://crosswalk-project.org/ You might also try to edit the css of the div you are using #game-area { margin : 0; padding: 0; transform: translate3d(0,0,0); -webkit-transform: translate3d(0,0,0); } This triggers the WEBGL before you actually try to run Phaser. It's a simple hack to trigger it since javascript use JIT compiling. It's kinda like saying to Javascript "hey i'm gonna use webgl on this page, in
  11. symof

    If velocity than

    do: function(objects){ objects.body.velocity.x *= -1; } So if body.velocity = 50, on collion it would be 50*-1 = -50, then if it collides again its -50 * -1 = 50. The issue was that you were setting //set speed to 50 element.body.velocity.x = 50; inside the collision handler . so it's always going to start at 50. You need to set the velocity outside of the collision handler and simply reverse it when it collides. Or use the bounce function that @samid737 provided as an example.
  12. My guess would be that you are using Phaser.WEBGL or Phaser.AUTO that defaults to Phaser.WEBGL when you create the game object, using Phaser.CANVAS might solve that. var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'GameDiv' ); If that doesn't solve it then your issue might be with the physics and amount of bodies you have on the screen. ARCADE is best for mobiles.
  13. I wrote it so it's simple to see the process. There is no reason "domain.tld" can't be a variable that you generate on the way by doing string operations. The end goal would be to have a variable that contains the name of the url. So you can do: https://jsfiddle.net/Lnbos3ns/1/ Be Creative!
  14. symof

    If velocity than

    Fiddle to the rescue. http://jsfiddle.net/ya22nbdr/3/ So your code should look something like this: do: function(objects){ objects.body.velocity.x = -50; } So as your "do" function is the Collision handler function you only need to get the object who's direction you want to change.
  15. I don't actually URL lock my projects as of yet. But this is how I would do it if(document.URL.indexOf("domain.tld") != -1) { //found } else { //nope } I wrote this handy fiddle for a more in-depth example: https://jsfiddle.net/Lnbos3ns/
  • Create New...