• Content Count

  • Joined

  • Last visited

About MishaShapo

  • Rank

Profile Information

  • Gender
    Not Telling
  1. The setCollision method of the Tilemap take an array of tile indexes and so you only need to have the zero once. The index refers to the index of the tile in the tileset, not the index of the tile in the Tilemap data. So I see that you have 2 types of tiles, so you only need an array with theses two indexes this.map.setCollision([0,1]);Also, separating your collision layers from other layers is a good idea, so you are off to a good start. =) For other best practices, check out the official Tilemap examples, they may not be all that fancy but they cover a lot of the basics that should be great for a beginner. =)
  2. Perhaps you can just check if the player is hidden during your `detection` overlap. It depends on whether your "shadows" are tiles or Sprites. For tiles, use getTileWorldXY and check if the tile at the player's coordinates is a shadow (either through it's index or through it's properties object). For Sprites or objects, use: Phaser.Physics.Arcade.intersects which is self-explanatory. Hope this helps! =)
  3. Hey, s-p-n I tested on Chrome 47 on Windows and it worked better. I read A LOT of posts in this forum, and so far I've concluded that the issue is with browsers on Mac OS X. And to answer your questions: 1. YesIn Chrome 47, it's the worst In Canary, it's just as bad as Chrome 47. In Safari 9.0 , the stuttering is still there but it is much less frequent In Firefox 43, is much the same as Safari. 2. Yes, the stuttering is the same whether I used Canvas or WebGL with the same performance in each browser as listed above.3. There are very few background programs running, and from Activity Monitor, I saw that my CPU load never went above 50%4. My MacBook Air has Intel HD Graphics 4000 , so there is no standalone GPU. Activity Monitor shows 0 Bytes of Swap Memory (Good) and that App memory is at 1.48 GB which means that there is about 1.5 GB left (Memory Used shows 3.15 GB). For an explanation on Mac OSX memory readings, check out: https://support.apple.com/kb/PH19644?locale=en_US5. FPS was 60 in all browser. I used a key listener that logged game.time.fps so as to not hurt/influence performance. 6. I will post the smallest replicable code soon. In conclusion, I will just continue to work on features in my game and test on my Windows machine. I have yet to test my game on mobile, but hopefully CocoonJS can help with that.
  4. Been more than a year now. I have a simple game and I still get the random shuttering. I have just a couple of sprites with a velocity moving across the screen, resetting position, changing texture using loadTexture (http://phaser.io/docs/2.4.4/Phaser.Sprite.html#loadTexture ), and moving back across the screen. Specs: Phaser v 2.4.4Pixi v2.2.9CanvasTesting in icognito window on Chrome 47 on a 1.8 GHz i5 MacBook We'll see what happens when I package the game in CocoonJS, but I am thinking about libGDX too. It's about the same size project on GitHub. Shame though since Phaser is so simple, laughably easy to set-up (as apposed to libGDx and all the Gradle stuff), and I've invested time (and money) to learn it. I just hope that with Phaser 3 or 2.4.5 (whatever comes next) this will be fixed. I know this isn't the dev's fault. Just a paradigm of JS that we all have to deal with. =)
  5. Thanks, Rich! =) Merry Christmas!
  6. So are all the assets in the "Interphase1/coverdisk/bonus" folder free for us to use commercially? The Interphase page just said that there are some "goodies", but I don't know what that means. =\
  7. I've been trying to achieve the effect that this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL is supposed to achieve, but it seems that changing the scale mode has no effect. Here is my Boot.js this.game.input.maxPointers = 1; this.game.stage.disableVisibilityChange = true; this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.scale.setMinMax(360,480,560,960); this.scale.setGameSize(560,960); this.scale.windowContraints = {"right":"layout","bottom":"layout"}; this.stage.forcePortrait = true; this.game.scale.pageAlignHorizontally = true; this.game.scale.pageAlignVertically = true; this.game.scale.forceOrientation(false, true); this.game.scale.updateLayout(true); this.game.input.addPointer(); this.game.stage.backgroundColor = '#171642'; this.game.stage.width = 560; this.game.stage.height = 960; this.game.scale.refresh();But my images are still stretched. As you can see, there is an inline styled with dimensions that exceed the ones set in Boot.js Ideally, I would want it to look like the second image, centered with background padding on the sides in case the window exceeds the min/max dimensions. I have no idea what to do. And any and all help is very appreciated.
  8. I did notice the pack loading option after already finishing my project. I might look into it later. For now, here is the finished gulp script. Easy and fast. =D Enjoy: https://www.npmjs.com/package/phaser-asset-loader#quick-start-guide
  9. I've seen several tutorials do something like: update: function(){ if(this.cursors.up.isDown || this.game.input.activePointer.isDown){ //Start jump sequence } else if(this.cursors.up.isUp || this.game.input.activePointer.isUp){ //End jump sequence }}And other do this : create: function(){ this.game.input.onDown.add(function(){ //Start jump sequence }); this.game.input.onUp.add(function(){ //End jump sequence });}Are there any significant differences between the two? Is one more efficient than the other? Thank you for your responses. =) This has been bugging me for a while. =)
  10. I want to write a task-runner script that will take all of my assets in my asset folder and create a js file with the appropriate this.load commands. Does anyone have a list of all the file types (images, sounds, spreadsheets, etc) that Phaser supports? Thank you. =)
  11. Has this bug been addressed in a recent version of Phaser?
  12. I am sorry to have to do this but: bump.
  13. I've searched the Community Tutorials and I've Googled around, but I haven't been able to find a tutorial for an endless runner like Jetpack Joyride. I've seen the "Spring Ninja" tutorial but I am looking for something more complex. Specifically, I want to answer: How do I continuously load predefined tilemaps and unload them once they are off screen?Should I make the player traverse through the tilemap or make the tilemap move. Thank you for reading and helping. =)
  14. Thank you so much, rich. That fixed it! =) I will be sure to be more mindful of scope and search the documentation more often. Thanks again!
  15. Greetings fellow Game Devs, For some reason, all the set-up code that I do in the 'create' function becomes nullified once I call an external function from 'update'. Basically, I am checking in 'update' if the skeleton sprite is colliding with the tilemap layer, and when it does, I call an external function called 'moveSkeleton' to set the skeleton velocity. Except the console.log of 'update' says [object Object] while the console.log of 'moveSkeleton' says undefined. GameStates.Game = function (game) { this.map; this.backgroundLayer; this.blockLayer; this.bg; this.skeleton; this.enemySpeed = 40;};GameStates.Game.prototype = { create: function () { this.bg = this.add.tileSprite(0,0,640,640, 'bg'); this.map = this.add.tilemap('myTileMap'); this.map.addTilesetImage('scifi_platformTiles_32x32', 'myTileSet'); this.backgroundLayer = this.map.createLayer('background'); this.blockLayer = this.map.createLayer('blocklayer'); this.setUpEnemy(); this.physics.arcade.gravity.y = 300; this.map.setCollisionBetween(781,786,true,'blocklayer'); this.map.setCollisionBetween(463,464,true,'blocklayer'); this.map.setCollision(779,true,'blocklayer'); }, setUpEnemy: function() { this.skeleton = this.add.sprite(400,400,'skeleton'); this.physics.enable(this.skeleton, Phaser.Physics.ARCADE); this.skeleton.body.collideWorldBounds = true; this.skeleton.body.setSize(16,40,0,-3); this.skeleton.anchor.setTo(0.5,1); this.skeleton.animations.add('move-enemy-right', [148,149,150,151], 10, true); this.skeleton.animations.add('move-enemy-left', [118,119,120,121], 10, true); this.skeleton.animations.play('move-enemy-tight',10,true); console.log("setUpEnemy says this.skeleton : " + this.skeleton); }, moveSkeleton: function() {console.log('moveSkeleton says this.skeleton : ' + this.skeleton); this.skeleton.body.velocity.x = this.enemySpeed; }, update: function () { console.log('update says this.skeleton : ' + this.skeleton); this.game.physics.arcade.collide(this.skeleton, this.blockLayer,this.moveSkeleton); },}; I ran this exact minimal code and even tried to open and close Brackets. And I got nothing. Thank you for reading and helping out. You guys and gals are the best. =)