jjwallace

Members
  • Content Count

    146
  • Joined

  • Last visited

Posts posted by jjwallace


  1. The ideal way would be to do both.  If the client is interpolating movement then it will not appear gittery with lag.  Most likely you will have to write your own system for this.  I am also researching the same and will post my results.  Perhaps there is a phyics engine that does both client and server side.


  2. Hi guys, I have built a bunch of games in Phaser2 and now i am working with PixiJs since we can render 20,000 + entities on the screen and animated them.  PixiJS lacks a lot of features.  

    So, How fast is Phaser3?  Does it render as many objects as PixiJS 4?

    Anyone have experience using all 3?


  3. I come from the Phaser world but have recently been working on a new application using PixiJS v4.5+

    I don't like the pixiJS sprite sheet example and really would like to find a solution to handleing sprite animations much like phaser2 had.

    I have taken a look at smoothie.

    I use tweenMax for tweens.

    What animation libraries do you use for sprites?


  4. Hi guys, i seem to have some issues with loading jsons with webpack json loader.

    Loader Found here: https://github.com/mattcolman/phaser-manifest-loader

    I have added some code to allow for json to load but it seems not to be working.

    I tried just regular loading the json and got a 404 not found error.

    Quote

    Uncaught TypeError: url.match is not a function
        at Phaser.Loader.transformUrl (phaser-split.js:58768)
        at Phaser.Loader.loadFile (phaser-split.js:58848)
        at Phaser.Loader.processLoadQueue (phaser-split.js:58539)
        at Phaser.Loader.asyncComplete (phaser-split.js:58645)
        at Phaser.Loader.fileComplete (phaser-split.js:59464)
        at Image.file.data.onload (phaser-split.js:58920)

     


  5. I have a main class that attempts to make two groups collide.  The items are added to the group in different classes but it seems not collision occures.

    Main Class:  

    
    
    import DragObj from '../objects/drag.obj';
    import Block from '../objects/block';
    
    class MainState extends Phaser.State {
    
        preload() {
            
        }
    
        create() {
            //  Set-up the physics body
            this.game.physics.startSystem(Phaser.Physics.ARCADE);
            
            this.game.ballGroup = this.game.add.group();
            this.game.blockGroup = this.game.add.group();
            
            //this.game.physics.arcade.gravity.y = 200;
            
            this.game.ballGroup.enableBody = true;
            this.game.blockGroup.enableBody = true;
            
    //        this.game.ballGroup.bounce.setTo(1);
    //        this.game.blockGroup.bounce.setTo(1);
            
            this.game.physics.arcade.enable(this.game.ballGroup);
            this.game.physics.arcade.enable(this.game.blockGroup);
            
            this.game.physics.arcade.collide(this.game.ballGroup, this.game.blockGroup);
            
            var myBlock = new Block(this.game, this.game.world.centerX, this.game.world.centerY, 'block', 10);
            
            var dragObject = new DragObj(this.game, this.game.world.centerX, this.game.world.height);
            
        }
    
    }
    
    export default MainState;

     

     

     

     

    BLOCKS

    class Block extends Phaser.Sprite {
    
        constructor(game, x, y, key, health) {
            super(game, x, y, key, health);
            this.game.stage.addChild(this);
    
            //this.animations.add('ani');    
            //this.animations.play('ani', 30, true);
    
            this.anchor.setTo(0, 0);
    
            game.physics.arcade.enable(this);
    
            this.body.bounce.set(1);
            this.body.immovable = true;
            //var sfxHit = game.add.audio('ball_hit', 100, false);
            
            this.game.blockGroup.add(this);
            
            function hitWorldBounds (sprite) {
    
                //sfxHit.play();
    
                //  Play the flash animation.
                //  
                //  Sometimes you'll notice it doesn't always start, i.e. if the sprite
                //  collides with the world bounds quickly before the previous 'flash'
                //  has completed. This is just because the animation needs to complete
                //  before playing again, the event did actually occur twice.
    
                //sprite.play('ani');
    
            }
    
            //  And then listen for it
            //this.body.onWorldBounds.add(hitWorldBounds, this);
    
        }
    
        update() {
            //this.x ++;
        }
    }
    
    export default Block;

    Balls

     

    class Ball extends Phaser.Sprite {
    
        constructor(game, x, y, key, angle, speed) {
            super(game, x, y, key);
            this.game.stage.addChild(this);
            this.animations.add('ani');    
            //this.animations.play('ani', 30, true);
    
            this.anchor.setTo(0.5, 0.5);
            
            game.physics.arcade.enable(this);
    
            this.angle = angle;
            game.physics.arcade.velocityFromAngle(angle, speed, this.body.velocity);
    
            this.body.bounce.set(1);
    
            this.body.collideWorldBounds = true;
            this.body.onWorldBounds = new Phaser.Signal();
            
            var sfxHit = game.add.audio('ball_hit', 100, false);
            
            game.ballGroup.add(this);
            //game.ballGroup.add(this);
            
            function hitWorldBounds (sprite) {
    
                //sfxHit.play();
    
                sprite.play('ani');
    
            }
    
            //  And then listen for it
            this.body.onWorldBounds.add(hitWorldBounds, this);
            
        }
        
        update() {
            //this.x ++;
        }
    }
    
    export default Ball;

     


  6. I am trying to send the players score to the challenged player after a round of my game Sea Frenzy on FB.

    It seems the code they gave doesn't work.  I have implemented everything they have asked for.  See documentation link below.

     

    // This will post a custom update. If the game is played in a messenger
    // chat thread, this will post a message into the thread with the specified
    // image and text message. And when people launch the game from this
    // message, those game sessions will be able to access the specified blob
    // of data through FBInstant.getEntryPointData().
    FBInstant.updateAsync({
      action: 'CUSTOM',
      cta: 'Play',
      image: base64Picture,
      text: {
        default: 'Edgar just played BASH for 9 points!',
        localizations: {
          en_US: 'Edgar just played BASH for 9 points!',
          pt_BR: 'Edgar jogou BASH por 9 pontos!',
        }
      }
      template: 'WORD_PLAYED',
      data: { myReplayData: '...' },
      strategy: 'IMMEDIATE',
      notification: 'NO_PUSH',
    }).then(function() {
      console.log('Message was sent successfully');
    });

     

    20274129_158585391373063_1501118020871782400_n.png?_nc_cat=0&oh=3f9ed71b18295c7f0ca631f9667585ee&oe=5C0179ED

    Documentation Here: https://developers.facebook.com/docs/games/instant-games/rich-gameplay-features


  7. I am completely lost when it comes to how to use tile maps.

    I want to have blocks and shoot them with balls, each ball hit subtracts 1 from the text overlaying the tile block.

    Is there a way to overlay a text on every block?  do i need to write my own tile map engine for this?

    Any samples of what im trying to build?